Beispiel #1
0
def launch(localDir, logsFile):
    # Sets the working directory to the python scripts directory
    os.chdir(dirname(__file__))
    # Sets the local directory and the logs file in the config file
    changeProperty("local_dir", localDir)
    changeProperty("logs_file", logsFile)
    # Launches the main program
    sync.main("client.conf")
def update_bigparser(keywords, data):
    curtime = round(time.time())
    arr = [keywords, data['price'], data['stdev'], str(curtime)]
    i = open("out.csv", 'a')
    i.write('Search Term, Average Price, Standard Deviation, Timestamp\n')
    for x in arr:
        i.write((str(x) if type(x) != str else x) + ',')
    i.write('\n')
    i.close()
    sync.main()
Beispiel #3
0
def main():
	"""Ingest, process, sync"""

	if not os.path.exists("data"):
		os.makedirs("data")

	parser = argparse.ArgumentParser(description='Ingest virus sequences')
	parser.add_argument('--headless', action='store_true', help='Run firefox in headless state (requires xvfb and x11vnc)', required=False)
	parser.add_argument('--clock', action='store_true', help='Run ntpdate to fix date', required=False)
	args = vars(parser.parse_args())
	headless = args['headless']
	clock = args['clock']

	ingest.main([headless])
	process.main()
	sync.main([clock])
Beispiel #4
0
def call_sync(**kw):
    environ = base_env.copy()
    environ.update(os.environ)
    environ.update(kw.pop('environ', {}))
    expected_code = kw.pop('returncode', 0)
    saved_stderr = sys.stderr
    sys.stderr = sys.stdout
    try:
        return sync.main(argv=['sync.py'] + kw.pop('args', []),
                         environ=environ, **kw)
    except SystemExit, exc:
        eq_(exc.code, expected_code)
Beispiel #5
0
def dispatch(profile: Profile, noman: NominalAnchor) -> None:
    """
    Dispatch a sync invocation.

    :param profile: tails client profile
    :param noman: open nominal anchor or None
    """

    if LOCK.acquire(False):  # demur if sync in progress
        try:
            do_wait(main(profile, noman))
        finally:
            LOCK.release()
Beispiel #6
0
def main(message):
    cc_exec(['update', '.'], errors=False)
    sync.main()
    git_exec(['add', '.'])
    git_exec(['commit', '-m', message])
    reset.main('HEAD')
Beispiel #7
0
def main(message):
    cc_exec(['update', '.'])
    sync.main('*')
    git_exec(['add', '.'])
    git_exec(['commit', '-m', message])
    reset.main('HEAD')
Beispiel #8
0
from concurrent import futures

from sync import save_flag, get_flag, show, main

# Number of threads to be used by ThreadPoolExecutor
MAX_WORKERS = 20


def download_one(cc):
    image = get_flag(cc)
    show(cc)
    save_flag(image, cc.lower() + '.gif')
    return cc


def download_many(cc_list):
    workers = min(MAX_WORKERS, len(cc_list))
    with futures.ThreadPoolExecutor(workers) as executor:

        # Map over the list of countries, downloading each flag separately in
        # thread from the tread pool
        res = executor.map(download_one, sorted(cc_list))
        return len(list(res))


if __name__ == '__main__':
    main(download_many)
Beispiel #9
0
def sync(options, fix=False):
	import sync as sync_module
	if options.verbose:
		print(sync_module.main(fix=fix, show_fixes=True))
	else:
		print(sync_module.main(fix=fix))
Beispiel #10
0
def main(message):
    cc_exec(['update', '.'], errors=False)
    sync.main()
    git_exec(['add', '-f', '.'])
    git_exec(['commit', '--allow-empty', '-m', message])
    reset.main('HEAD')
wall=None
action=None
if len(sys.argv) >= 2:   
	params = getParams(sys.argv[2])
	wall=getParam("wall", params)
	action=getParam("action", params)
	
streamAddonMV = Addon.getSetting("StreamMovies")
streamAddonTV = Addon.getSetting("StreamTV")

if wall is None:
	Addon.openSettings()
	updatesetting.main()
elif (wall == "update"):
	sync.main()
elif (action == "player"):
	imdb = getParam("imdb",params)
	print "*** {0}: Wall.Player {1} {2}".format(AddonName,wall,imdb)
	
	streamAddonMV = "Quasar"
	streamAddonTV = "Quasar"
	
if (wall == "movies"):
	imdb = getParam("imdb",params)
	trakt = getParam("trakt",params)
	year = getParam("year",params)
	name = getParam("name",params)
	title = getParam("title",params)
	url = getParam("url",params)
	slug = getParam("slug",params)
Beispiel #12
0
def main(message):
    cc_exec(["update", "."], errors=False)
    sync.main()
    git_exec(["add", "-f", "."])
    git_exec(["commit", "--allow-empty", "-m", message])
    reset.main("HEAD")
Beispiel #13
0
def setUpModule():
    sync.urllib2 = urllib2_mock
    sync.main(**settings)
Beispiel #14
0
# @auther 宋疆疆
# @since 2017/12/11.

import sys
import sync
import init
import forall
import Util

if len(sys.argv) <= 1:
    Util.cprint("need command [init, sync, forall]")
    sys.exit()

subModule = sys.argv[1]
if subModule == 'init':
    init.main()
elif subModule == 'sync':
    sync.main()
elif subModule == 'forall':
    forall.main()
else:
    Util.cprint("just support command [init, sync, forall]")