示例#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!"
示例#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)
示例#4
0
文件: grokit.py 项目: wguan17/grokit
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)
示例#5
0
文件: grokit.py 项目: nsrinath/grokit
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)