Ejemplo n.º 1
0
def init_argparser(p=None):

    from spatools.lib import dbmgr

    if p is None:
        p = arg_parser('genaf-snp dbgmr')

    return dbmgr.init_argparser(p)
Ejemplo n.º 2
0
def init_argparser( parser=None ):

    if parser is None:
        p = arg_parser('facmd - genaf')
    else:
        p = parser

    p = fatools_init_argparser( p )

    return p
Ejemplo n.º 3
0
def main():
    greet()

    # preparing everything
    p = arg_parser('genaf-base-shell')
    args = p.parse_args(sys.argv[1:])

    settings = setup_settings(args)
    dbh = get_dbhandler(settings)

    from IPython import embed
    import transaction
    embed()
Ejemplo n.º 4
0
def main():
    greet()

    # preparing everything
    p = arg_parser('cmsfix-shell')
    args = p.parse_args(sys.argv[1:])

    settings = setup_settings( args )
    dbh = get_dbhandler(settings)
    set_index_service( IndexService(settings['cmsfix.whoosh.path']) )

    from IPython import embed
    embed()
Ejemplo n.º 5
0
def init_argparser( parser = None ):

    if parser is None:
        #p = argparse.ArgumentParser('dbmgr [genaf]', conflict_handler='resolve')
        p = arg_parser('dbmgr [genaf]')
    else:
        p = parser

    # update our argparser
    p = fatools_init_argparser( db_argparser(p) )

    # provide our entry here
    return p
Ejemplo n.º 6
0
def init_argparser(p=None):

    if p is None:
        p = arg_parser('genaf-base rq-worker')

    return p
Ejemplo n.º 7
0
def init_argparser( parser = None):

    if parser is None:
        p = arg_parser('rbmgr [rhombus]')
    else:
        p = parser

    # commands

    p.add_argument('--initdb', action='store_true', default=False,
        help = 'initialize database')


    # import/export to YAML

    p.add_argument('--importuserclass', default=False,
        help = 'import userclass from YAML file')

    p.add_argument('--exportuserclass', default=False,
        help = 'export userclass to YAML file')
    # exported YAML file need to contain certain field for format recognizition

    p.add_argument('--importgroup', default=False,
        help = 'import group from YAML file')

    p.add_argument('--exportgroup', default=False,
        help = 'export group from YAML file')

    p.add_argument('--importenumkey', default=False,
        help = 'import enumerated key from YAML file')

    p.add_argument('--exportenumkey', default=False,
        help = 'export enumerated key to YAML file')

    # ekeys

    p.add_argument('--listenumkey', default=False, action='store_true')
    p.add_argument('--addenumkey', default=False)
    p.add_argument('--delenumkey', default=False)

    # direct manipulation

    p.add_argument('--adduser', action='store_true', default=False,
        help = 'add a new user')

    p.add_argument('--setcred', action='store_true', default=False,
        help = 'change user credential')


    # specific options

    p.add_argument('--no-create-table', default=False, action='store_true')
    p.add_argument('--no-init-data', default=False, action='store_true')

    p.add_argument('--initial_userclass', default=False)
    p.add_argument('--initial_groups', default=False)

    p.add_argument('--login', default='')
    p.add_argument('--primarygroup', default='')
    p.add_argument('--lastname', default='')
    p.add_argument('--firstname', default='')
    p.add_argument('--userclass', default='')
    p.add_argument('--email', default='')
    p.add_argument('--groups', default='')
    p.add_argument('--credential', default='')

    p.add_argument('--ekeygroup', default=None)

    # general options here

    return db_argparser(p)