Exemplo n.º 1
0
def setup(envs, opts):
    if opts.action == 'start' or opts.action == 'stop':
        start_stop_server(envs, opts.action)
    elif opts.action == 'setup':
        envs['ppath'] = ospath(os.path.expanduser(opts.ppath).rstrip("/").rstrip("\\"))
        if (index_for_project(envs, "setup") == True):
            print "Setup completed successfully"
        else:
            print "Setup failed to complete!"
    elif opts.action == 'reindex':
        envs['ppath'] = ospath(os.path.expanduser(opts.ppath).rstrip("/").rstrip("\\"))
        if (index_for_project(envs, "reindex") == True):
            print "Reindex completed successfully"
        else:
            print "Reindex failed to complete!"
def setup(envs, opts):
    if opts.action == 'start' or opts.action == 'stop':
        start_stop_server(envs, opts.action)
    elif opts.action == 'setup':
        envs['ppath'] = ospath(
            os.path.expanduser(opts.ppath).rstrip("/").rstrip("\\"))
        if (index_for_project(envs, "setup") == True):
            print "Setup completed successfully"
        else:
            print "Setup failed to complete!"
    elif opts.action == 'reindex':
        envs['ppath'] = ospath(
            os.path.expanduser(opts.ppath).rstrip("/").rstrip("\\"))
        if (index_for_project(envs, "reindex") == True):
            print "Reindex completed successfully"
        else:
            print "Reindex failed to complete!"
Exemplo n.º 3
0
def main(sysargv):
    envs = {'tpath': '', 'ppath': '', 'cpath':''}
    envs['ppath'] = ''
    envs['cpath'] = ospath(os.path.dirname(os.path.realpath(__file__)))
    envs['tpath'] = ospath(envs['cpath']+"/grokit_files")
    parser = MyParser(epilog=desc)
    parser.add_option('--ppath', help=dedent(ppath_help), dest='ppath', action='store')
    parser.add_option('--action', help=dedent(action_help), dest='action', action='store')

    (opts, args) = parser.parse_args()
    if opts.action not in ['start', 'stop', 'setup', 'reindex']:
        print "Should provide one of (setup|start|stop|reindex) for action"
        return
    if opts.action in ['setup'] and opts.ppath == None:
        print "--ppath is mandatory when --action=setup"
        return

    setup(envs, opts)
Exemplo n.º 4
0
def setup(envs, opts):
    if opts.action == 'start' or opts.action == 'stop':
        start_stop_server(envs, opts.action)
    elif opts.action == 'setup':
        envs['ppath'] = ospath(os.path.expanduser(opts.ppath).rstrip("/").rstrip("\\"))
        if validate_path(envs) == False:
            print "Not a valid source path"
            return False
        if check_and_copy_tools(envs) == True:
            setup_index_for_project(envs)
Exemplo n.º 5
0
def setup(envs, opts):
    if opts.action == 'start' or opts.action == 'stop':
        start_stop_server(envs, opts.action)
    elif opts.action == 'setup':
        envs['ppath'] = ospath(
            os.path.expanduser(opts.ppath).rstrip("/").rstrip("\\"))
        if validate_path(envs) == False:
            print "Not a valid source path"
            return False
        if check_and_copy_tools(envs) == True:
            setup_index_for_project(envs)
def main(sysargv):
    envs = {'tpath': '', 'ppath': '', 'cpath': ''}
    envs['ppath'] = ''
    envs['cpath'] = ospath(os.path.dirname(os.path.realpath(__file__)))
    envs['tpath'] = ospath(envs['cpath'] + "/grokit_files")
    parser = MyParser(epilog=desc)
    parser.add_option('--ppath',
                      help=dedent(ppath_help),
                      dest='ppath',
                      action='store')
    parser.add_option('--action',
                      help=dedent(action_help),
                      dest='action',
                      action='store')

    (opts, args) = parser.parse_args()
    if opts.action not in ['start', 'stop', 'setup', 'reindex']:
        print "Should provide one of (setup|start|stop|reindex) for action"
        return
    if opts.action in ['setup'] and opts.ppath == None:
        print "--ppath is mandatory when --action=setup"
        return

    setup(envs, opts)