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

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

        def start(configFile, nosetup=False):
    configFile = getAbsolutePath(configFile)
    clearScreen()

    print 'Starting %s\n' % getB3versionString()

    conf = None
    if os.path.exists(configFile):
        print 'Using config file: %s' % configFile
        global _confDir
        _confDir = os.path.dirname(configFile)
        #print 'Config dir is        : %s' % _confDir
        conf = config.load(configFile)
    else:
        # This happens when a config was entered on the commandline, but it does not exist
        if nosetup:
            raise SystemExit('Could not find config file %s' % configFile)
        else:
            Setup(configFile)


    # Check if a newer version of B3 is available
    update_channel = None
    try:
        update_channel = conf.get('update', 'channel')
    except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
        pass
    _update = checkUpdate(__version__, channel=update_channel, singleLine=False, showErrormsg=True)
    if _update:
        print _update
        time.sleep(5)
    else:
        print "...no update available."
        time.sleep(1)


    try:
        parserType = conf.get('b3', 'parser')
        if not parserType:
            raise SystemExit('You must supply a parser')

        try:
            parser = loadParser(parserType, configFile, nosetup)
        except ImportError, err:
            raise SystemExit("CRITICAL: Cannot find parser '%s'. Check you main config file (b3.xml)\nB3 failed to start.\n%r"% (parserType, err))
    
        extplugins_dir = conf.getpath('plugins', 'external_dir')
        print "Using external plugin directory: %s" % extplugins_dir
        
        global console
        console = parser(conf)

    except ConfigParser.NoOptionError, err:
        raise SystemExit("CRITICAL: option %r not found in section %r. Correct your config file %s" % (err.option, err.section, configFile))


    def termSignalHandler(signum, frame):
        console.bot("TERM signal received. Shutting down")
        console.shutdown()
        raise SystemExit(222)
    try: # necessary if using the functions profiler, because signal.signal cannot be used in threads
        signal.signal(signal.SIGTERM, termSignalHandler)
    except:
        pass

    try:
        console.start()
    except KeyboardInterrupt:
        console.shutdown()
        print 'Goodbye'
        return
    except SystemExit, msg:
        print 'Exiting: %s' % msg
        raise
    except Exception, msg:
        print 'Error: %s' % msg
        traceback.print_exc()
        sys.exit(223)
        


src/b/3/b3-1.9.2/b3/run.py   b3(Download)
            Setup(config)
 
    b3.start(config, nosetup)
 
def run_setup(config=None):

src/b/i/big-brother-bot-HEAD/b3/run.py   big-brother-bot(Download)
            Setup(config)
 
    b3.start(config, nosetup)
 
def run_setup(config=None):