Example #1
0
def main():
    options = commandLineOptionsParser.parseOptions()
    
    logging.info("Starting bbosPlayerBio!")
    
    league = options.league
    
    try:
        gamedayDirectory = GamedayDirectoryStructure(BBOSConfig.gamedayURL, league)
        
        if options.game:
            gamedayGameURLs = gamedayDirectory.getGameURLsForGame(options.game)    
        elif options.day:
            gamedayGameURLs = gamedayDirectory.getGameURLsForDay(eval(options.day))    
        elif options.all != None:
            gamedayGameURLs = gamedayDirectory.getGameURLsForAllAvailable()
        elif options.year:
            gamedayGameURLs = gamedayDirectory.getGameURLsForYear(options.year)
        else:
            gamedayGameURLs = gamedayDirectory.getGameURLsForLastNumberOfDays(BBOSConfig.gamedayDaysBackToLoad)
            
        logging.info("Distributing" + str(len(gamedayGameURLs)) + "urls to" + str(BBOSConfig.numberOfThreads) + "threads")
        
        threadIt.threadThis(BBOSConfig.numberOfThreads, gamedayGameURLs, LoadGameFactory())
        
        logging.info("")
        logging.info("load complete!")
    except Exception, e:
        logging.error("Died with Exception: ")
        logging.error(e)
        raise e
Example #2
0
def main():
    options = commandLineOptionsParser.parseOptions()

    logging.info("Starting bbos!")

    league = options.league

    try:
        gamedayDirectory = GamedayDirectoryStructure(BBOSConfig.gamedayURL,
                                                     league)

        if options.game:
            gamedayGameURLs = gamedayDirectory.getGameURLsForGame(options.game)
        elif options.day:
            gamedayGameURLs = gamedayDirectory.getGameURLsForDay(
                eval(options.day))
        elif options.year:
            gamedayGameURLs = gamedayDirectory.getGameURLsForYear(options.year)
        elif options.recent:
            gamedayGameURLs = gamedayDirectory.getGameURLsForLastNumberOfDays(
                BBOSConfig.gamedayDaysBackToLoad)
        else:
            gamedayGameURLs = gamedayDirectory.getGameURLsForLastNumberOfDays(
                BBOSConfig.gamedayDaysBackToLoad)

            #        gamedayGameURLs.reverse()

        logging.info("Distributing " + str(len(gamedayGameURLs)) +
                     " urls to " + str(BBOSConfig.numberOfThreads) +
                     " threads")

        threadIt.threadThis(BBOSConfig.numberOfThreads, gamedayGameURLs,
                            LoadGameFactory())

        logging.info("")
        logging.info("load complete!")
    except:
        logging.error("Died with Exception: ")
        import StringIO
        output = StringIO.StringIO()
        import traceback
        traceback.print_exc(file=output)
        logging.error(output.getvalue())
        raise
Example #3
0
def main():
    options = commandLineOptionsParser.parseOptions()
    
    logging.info("Starting bbos!")
    
    league = options.league
    
    try:
        gamedayDirectory = GamedayDirectoryStructure(BBOSConfig.gamedayURL, league)
        
        if options.game:
            gamedayGameURLs = gamedayDirectory.getGameURLsForGame(options.game)    
        elif options.day:
            gamedayGameURLs = gamedayDirectory.getGameURLsForDay(eval(options.day))    
        elif options.year:
            gamedayGameURLs = gamedayDirectory.getGameURLsForYear(options.year)
        elif options.recent:
            gamedayGameURLs = gamedayDirectory.getGameURLsForLastNumberOfDays(BBOSConfig.gamedayDaysBackToLoad)
        else:
            gamedayGameURLs = gamedayDirectory.getGameURLsForLastNumberOfDays(BBOSConfig.gamedayDaysBackToLoad)
            
        gamedayGameURLs.reverse()
        
        logging.info("Distributing " + str(len(gamedayGameURLs)) + " urls to " + str(BBOSConfig.numberOfThreads) + " threads")
        
        threadIt.threadThis(BBOSConfig.numberOfThreads, gamedayGameURLs, LoadGameFactory())
        
        logging.info("")
        logging.info("load complete!")
    except:
        logging.error("Died with Exception: ")
        import StringIO
        output = StringIO.StringIO()
        import traceback
        traceback.print_exc(file=output)
        logging.error(output.getvalue())
        raise
Example #4
0
def main():
    options = commandLineOptionsParser.parseOptions()

    logging.info("Starting bbosPlayerBio!")

    league = options.league

    try:
        gamedayDirectory = GamedayDirectoryStructure(BBOSConfig.gamedayURL,
                                                     league)

        if options.game:
            gamedayGameURLs = gamedayDirectory.getGameURLsForGame(options.game)
        elif options.day:
            gamedayGameURLs = gamedayDirectory.getGameURLsForDay(
                eval(options.day))
        elif options.all != None:
            gamedayGameURLs = gamedayDirectory.getGameURLsForAllAvailable()
        elif options.year:
            gamedayGameURLs = gamedayDirectory.getGameURLsForYear(options.year)
        else:
            gamedayGameURLs = gamedayDirectory.getGameURLsForLastNumberOfDays(
                BBOSConfig.gamedayDaysBackToLoad)

        logging.info("Distributing" + str(len(gamedayGameURLs)) + "urls to" +
                     str(BBOSConfig.numberOfThreads) + "threads")

        threadIt.threadThis(BBOSConfig.numberOfThreads, gamedayGameURLs,
                            LoadGameFactory())

        logging.info("")
        logging.info("load complete!")
    except Exception, e:
        logging.error("Died with Exception: ")
        logging.error(e)
        raise e