Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

        def main():
    parser = OptionParser(version=b3.getB3versionString())
    parser.add_option('-c', '--config', dest='config', default=None,
                      help='B3 config file. Example: -c b3.xml')
    parser.add_option('-r', '--restart',
                      action='store_true', dest='restart', default=False,
                      help='Auto-restart B3 on crash')
    parser.add_option('-s', '--setup',
                      action='store_true', dest='setup', default=False,
                      help='Setup main b3.xml config file')
    parser.add_option('-u', '--update',
                      action='store_true', dest='update', default=False,
                      help='Update B3 database to latest version')
    parser.add_option('-n', '--nosetup',
                      action="store_true", dest='nosetup', default=False,
                      help='Do not enter setup mode when config is missing')


    (options, args) = parser.parse_args()

    if not options.config and len(args) == 1:
        options.config = args[0]

    if options.setup:
        run_setup(config=options.config)

    if options.update:
        run_update(config=options.config)

    if options.restart:
        if options.config:
            run_autorestart(['--config', options.config] + args)
        else:
            run_autorestart([])
    else:
        try:
            run(config=options.config, nosetup=options.nosetup)
        except SystemExit, msg:
            # This needs some work, is ugly a.t.m. but works... kinda
            if main_is_frozen():
                if sys.stdout != sys.__stdout__:
                    # make sure we are not writing to the log:
                    sys.stdout = sys.__stdout__
                    sys.stderr = sys.__stderr__
                print msg
                raw_input("Press the [ENTER] key")
            raise
        except:
            if sys.stdout != sys.__stdout__:
                # make sure we are not writing to the log:
                sys.stdout = sys.__stdout__
                sys.stderr = sys.__stderr__
            traceback.print_exc()
        if main_is_frozen():
            # which happens when running from the py2exe build
            # we wait for keyboad keypress to give a chance to the 
            # user to see the error message
            if sys.stdout != sys.__stdout__:
                # make sure we are not writing to the log:
                sys.stdout = sys.__stdout__
                sys.stderr = sys.__stderr__
            raw_input("Press the [ENTER] key")
        


src/b/3/b3-1.9.2/b3_run.py   b3(Download)
def main():
    b3.run.main()
 
if __name__ == '__main__':
    main()

src/b/3/b3-1.9.2/b3_debug.py   b3(Download)
def main():
    b3.run.main()
 
if __name__ == '__main__':
    result = parse_cmdline_args() # we parse here for special debug switchs, if there are none, the program will continue normally

src/b/i/big-brother-bot-HEAD/b3_run.py   big-brother-bot(Download)
def main():
    b3.run.main()
 
if __name__ == '__main__':
    main()

src/b/i/big-brother-bot-HEAD/b3_debug.py   big-brother-bot(Download)
def main():
    b3.run.main()
 
if __name__ == '__main__':
    result = parse_cmdline_args() # we parse here for special debug switchs, if there are none, the program will continue normally