Пример #1
0
def main():
    args.init()
    c = args.sub('jobs', jobs_c, help="List all jobs matching JOBPATTERN")
    c.arg('jobpattern', metavar="JOBPATTERN")

    c = args.sub('builds', builds_c, help="Show recent builds for JOB")
    c.arg('job', metavar="JOB")

    c = args.sub('log', log_c, help="Show console output for JOB, build# BUILD (or latest)")
    c.arg('jobname', nargs='?', metavar="JOB")

    c.arg('build', type=int, nargs='?', metavar="BUILD")

    c = args.sub('set', set_c, help="Set permanent config variable (e.g. 'jenq set repository http://foo-jenkins.busyware.com')")
    c.arg('variable', metavar="VARIABLE")
    c.arg('value', metavar="VALUE")

    c = args.sub('sync', sync_c, help="Fetch list of jobs from repository to local cache")

    c  = args.sub('fav', fav_c, help="Favorite a job")
    c.arg('jobname', nargs='?', metavar="JOB")

    c = args.sub('favs', favs_c, help="Show recent builds for all favorited jobs")

    c = args.sub('alias', alias_c, help="Create convenient alias for JOB")
    c.arg('shortname', nargs='?', metavar="SHORTNAME")
    c.arg('jobname', nargs='?', metavar="JOB")

    c = args.sub('jobinfo', job_c, help="Display raw job info (json)")
    c.arg('jobname', nargs='?', metavar="JOB")

    c = args.sub('go', go_c, help="Open newest build for JOB in browser")
    c.arg('jobname', nargs='?', metavar="JOB")

    args.parse()
Пример #2
0
def main():
    pp = argparse.ArgumentParser(prog = "wpp",
    description="PATH optimization and management utility for Windows",
    epilog="See https://github.com/vivainio/wpathr for detailed documentation.")

    args.init(pp)
    args.sub("ls", ls, help = "List paths alphabetically")
    sqc = args.sub("squash", squash, help = "Shorten paths by squashing (convert to progra~1 format)")
    args.sub("dump", dump, help = "Dump paths to screen in original format (for backup)")
    ddc = args.sub("dedupe", dedupe, help = "Remove duplicate paths")
    exc = args.sub("exists", exists, help = "Remove nonexisting paths")
    src = args.sub("search", search, help = "Scan through path for files matching PATTERN")
    lnc = args.sub("long", longnames, help = "Show long names (progra~1 -> Program Files)")
    fac = args.sub("factor", factor, help = "Factor out runs of VALUE in path to %%VARIABLE%% referenses")
    fac.arg("variable", metavar="VARIABLE")
    fac.arg("value", metavar="VALUE")
    sset = args.sub("sset", sset_c, help="Set SYSTEM env variable to VALUE. Like xset /s, really")
    sset.arg("variable", metavar="VARIABLE")
    sset.arg("value", metavar="VALUE")

    syc = args.sub("sync", sync, help="Notify other processes to sync the environment")

    src.arg("pattern", type=str, nargs="+")

    adc = args.sub("add", add_s, help='Add directory to System path')
    adc.arg('directory', nargs="+")

    rmc = args.sub('remove', remove_s, help="Remove directory from path")
    rmc.arg('directory', nargs="+")

    pvc = args.sub('env', env_paths, help="List env variables that refer to existing paths")
    # operations that support --commit

    slc = args.sub('symlink', symlink_c, help="Create symbolic link at LINKPATH from SOURCE")
    slc.arg('linkname', metavar="LINKPATH")
    slc.arg('filepath', metavar="FILEPATH")

    alias = args.sub('alias', alias_c, help="Create alias for a command")
    alias.arg('name', nargs="?")
    alias.arg('command', nargs="?")

    runalias = args.sub('r', runalias_c, help="Run aliased command with arguments")
    runalias.arg('name', metavar="ALIAS")
    runalias.arg('args', metavar="ARGUMENTS", nargs=argparse.REMAINDER)

    up = args.sub('up', run_up_c, help="Run command that exist in any parent directory")
    up.arg("command")
    up.arg("argument", nargs="*")

    for a in [sqc, ddc, exc, fac, adc, rmc]:
        a.arg("--commit", action='store_true')

    args.parse()
Пример #3
0
    def __init__(self):
        self.frame_delay = 0
        ok,fail=pygame.init()
        self.sock,self.remote = args.init()
        self.screen = pygame.display.set_mode()
        self.game_surface = pygame.Surface((glb.game_screen_width,glb.game_screen_height))
        self.border = pygame.Surface((glb.border_width,glb.border_height))
        self.clock  = pygame.time.Clock()
        self.blocks = []
        self.player = sprite.Player()
        self.opponent = sprite.Opponent() 
        self.ball = sprite.Ball()
        self.oball = sprite.Ball()
        self.border.fill((255,255,255))
        self.frame_counter = 10
        self.rthread = threading.Thread(target = self.receive)
        
        self.rthread.start()
        if fail:
            print(f"Initialization passed = {ok} failed = {fail} ")

        for x in range (int(glb.columns/2)):
            for y in range (glb.rows):
                self.blocks.append(sprite.Block(True, x*glb.block_width, y*glb.block_height, glb.block_width, glb.block_height))
        
        for x in range (int(glb.columns/2), glb.columns):
            for y in range (glb.rows):
                self.blocks.append(sprite.Block(False, x*glb.block_width, y*glb.block_height, glb.block_width, glb.block_height))
Пример #4
0
def main():
    args.init()

    args.sub('here', here_c, help = 'Set current dir as prjroot')
    s = args.sub('g', grep_c, help = 'Grep the project')
    s.arg("pattern", type=str)
    sc = args.sub('s', scan_c, help ='Search with context')
    sc.arg('--all', help="Do not limit hits per file", action='store_true')
    sc.arg('-e', nargs=argparse.REMAINDER)
    sc.arg("pattern", type=str, nargs=argparse.REMAINDER)

    pick = args.sub('p', pick_c, help = 'Use peco to quick pick one of the earlier choices')
    pick.arg('choice', type=int, help='Choice number to pick immediately', nargs='?')
    args.sub('co', checkout_c, help = "select and check out a branch")
    args.sub('r', recent_c, help="select and check out a recently used branch")

    args.parse()
Пример #5
0
# scipy.spatial.distance.cdist

# pyclust

import pandas as pd

import args

from c_dbscan import do_dbscan
from c_spectral_clustering import do_spectral_clustering

# parse les arguments de la ligne de commande
args.init()

colonne_id = None


def load_data():
    # Cette fonction se charge de récupérer le fichier demandé
    # et sélectionne par défaut (sinon, TODO) tous les attributs
    # sauf l'id

    global colonne_id

    prefixe = '../../out/'
    filename = '1x_vecteurs_'

    if args.args.filename_in is None:
        filename += str(args.args.number_in) + ".csv"
    else:
        filename = args.args.filename_in
Пример #6
0
    def get_groups(self):
        self.groups = self._normal_loader.read(mkurl(self.url, 'groups'), 'group', True)
    
    def get_recs(self):
        self.recs = self._normal_loader.read(mkurl(self.url, 'recs'), 'rec')

    def get_saying(self):
        self.saying = self._normal_loader.read(mkurl(self.url, 'miniblogs?type=saying'), 'saying')

    #recs, miniblogs, reviews, subjects, online, recs

if __name__ == '__main__':

    args.init([
        ('user', 'user name to backup', ''),
        #('minbs', '最小块大小', 'int'),
        ('item', 'data items to backup, seperated by comma, default \'all\'', 'list'),
        #('stride_count', '条带数目, 用于stride模式,默认为1', 'int optional'),
        #('file', '测试用的文件名字,不提供的话会自动创建', 'optional'),
        ])
    conf = args.parse()
    me = User(conf.user)
    if not me.exists():
        error('user %s not exists' % conf.user)
        sys.exit(-1)
    print "<?xml version='1.0' encoding='UTF-8'?>\n"
    me.get(conf.item)
    print obj2xml(me, 'user')
    sys.exit(0)
Пример #7
0
import socketio
import logger
import logging
import controller
import data
import time
import random
import json
from gevent import monkey

monkey.patch_all()
import gevent

import args

args.init({"port": 8000, "debug": False})
if args.get("debug"):
    logging.basicConfig(level=logging.DEBUG)
else:
    logging.basicConfig(level=logging.INFO)

app = Flask(__name__)
app.debug = args.get("debug")
app.config.update(SECRET_KEY=hashlib.sha1(os.urandom(24)).digest())

eventLogger = logger.EventLogger()
loxoneDevice = controller.LoxoneDevice()
# loxone controller works fine, just have to test registering the listeners and also making sure that sending message through the proxy method works

# singleton controllers
lightController = controller.LightController(loxoneDevice)
Пример #8
0
import socketio
import logger
import logging
import controller
import data
import time
import random
import json
from gevent import monkey

monkey.patch_all()
import gevent

import args

args.init({"port": 8000, "debug": True})
if args.get("debug"):
    logging.basicConfig(level=logging.DEBUG)
else:
    logging.basicConfig(level=logging.INFO)

app = Flask(__name__)
app.debug = args.get("debug")
app.config.update(SECRET_KEY=hashlib.sha1(os.urandom(24)).digest())

eventLogger = logger.EventLogger()
loxoneDevice = controller.LoxoneDevice()
# loxone controller works fine, just have to test registering the listeners and also making sure that sending message through the proxy method works

# singleton controllers
lightController = controller.LightController(loxoneDevice)