def setUp(self): self.games = games self.sample = sample #self.filename = LOGDIR_EXTRACT + '2011-01-30_MIA@OKC_pbp_espn' ##self.cleanobj = pbp_espn.Clean(self.filename) self.cleanobjs = [pbp_espn.Clean(f) for f in self.sample]
def go(game_ids): game_ids = [250] games = chooseGames(game_ids) for g in games: files_in_extract = [ f for f in os.listdir(LOGDIR_EXTRACT) if g['abbrev'] in f and 'espn' in f ] print files_in_extract if files_in_extract: f = files_in_extract[0] print "+++ Cleaning data in %s" % f pbpvars = { 'filename': f, 'home_team': g['home_team'], 'away_team': g['away_team'], 'game_name': g['abbrev'], 'game_id': g['id'] } pbp_espn.Clean(**pbpvars).cleanAll() print "Done cleaning play by play data"
def func_playbyplay_espn(game, filename, dbobj): pbpvars = { 'filename': filename, 'gamedata': game, 'dbobj' : dbobj } pbp_espn.Clean(**pbpvars).cleanAll()