Ejemplo n.º 1
0
 def __init__(self, *args, **kwargs):
     # maybe the answer for nexdef for basic subscribers
     self.use_wired_web = kwargs.get('use_wired_web')
     ymd_tuple = kwargs.get('ymd_tuple')
     time_shift = kwargs.get('time_shift')
     self.international = kwargs.get('international')
     self.cfg = kwargs.get('cfg')
     # Default to today
     if not ymd_tuple:
         now = datetime.datetime.now()
         dif = datetime.timedelta(1)
         # Now, we want the day to go until, say, 9 am the next
         # morning. This needs to be worked out, still...
         if now.hour < 9:
             now = now - dif
         ymd_tuple = (now.year, now.month, now.day)
     self.year = ymd_tuple[0]
     self.month = ymd_tuple[1]
     self.day = ymd_tuple[2]
     self.shift = time_shift
     self.http = MLBHttp(accept_gzip=True)
     self.grid = "http://gdx.mlb.com/components/game/mlb/year_"\
         + padstr(self.year)\
         + "/month_" + padstr(self.month)\
         + "/day_" + padstr(self.day) + "/grid.xml"
     self.multiangle = "http://gdx.mlb.com/components/game/mlb/year_"\
         + padstr(self.year)\
         + "/month_" + padstr(self.month)\
         + "/day_" + padstr(self.day) + "/multi_angle_epg.xml"
     self.log = MLBLog(LOGFILE)
     self.data = []
     self.error_str = "Something went wrong.  A more descriptive error should be here."
Ejemplo n.º 2
0
 def __init__(self, gameid):
     self.gameid = gameid
     self.gameid = self.gameid.replace('/', '_')
     self.gameid = self.gameid.replace('-', '_')
     (year, month, day) = self.gameid.split('_')[:3]
     league = self.gameid.split('_')[4][-3:]
     self.error_str = "Could not retrieve master_scoreboard.xml file"
     self.http = MLBHttp(accept_gzip=True)
Ejemplo n.º 3
0
 def __init__(self):
     self.data = []
     self.last_update = ""
     self.xml = ""
     self.date = datetime.datetime.now()
     self.url = 'https://erikberg.com/mlb/standings.xml'
     self.jUrl = 'http://mlb.mlb.com/lookup/json/named.standings_schedule_date.bam?&sit_code=%27h0%27&league_id=103&league_id=104&all_star_sw=%27N%27&version=2'
     self.http = MLBHttp(accept_gzip=True)
Ejemplo n.º 4
0
 def __init__(self, gameid):
     self.gameid = gameid
     self.gameid = self.gameid.replace('/', '_')
     self.gameid = self.gameid.replace('-', '_')
     (year, month, day) = self.gameid.split('_')[:3]
     league = self.gameid.split('_')[4][-3:]
     self.boxUrl = 'http://gdx.mlb.com/components/game/%s/year_%s/month_%s/day_%s/gid_%s/boxscore.xml' % (
         league, year, month, day, self.gameid)
     self.boxscore = None
     self.http = MLBHttp(accept_gzip=True)
Ejemplo n.º 5
0
 def __init__(self, myscr, mycfg):
     self.myscr = myscr
     self.mycfg = mycfg
     self.statuswin = curses.newwin(1, curses.COLS - 1, curses.LINES - 1, 0)
     self.titlewin = curses.newwin(2, curses.COLS - 1, 0, 0)
     self.rssUrl = 'http://mlb.mlb.com/partnerxml/gen/news/rss/mlb.xml'
     self.milbRssUrl = 'http://www.milb.com/partnerxml/gen/news/rss/milb.xml'
     self.data = []
     self.records = []
     self.current_cursor = 0
     self.record_cursor = 0
     self.game_cursor = 0
     self.htmlParser = HTMLParser()
     self.http = MLBHttp(accept_gzip=True)
Ejemplo n.º 6
0
 def __init__(self, cfg=None):
     self.data = []
     self.mycfg = cfg
     self.last_update = ""
     self.date = datetime.datetime.now()
     self.season = self.date.year
     self.http = MLBHttp(accept_gzip=True)
     if self.mycfg is None:
         self.type = 'pitching'
         self.sort = 'era'
         self.league = 'MLB'
         self.sort_order = 'default'
         self.team = 0
         self.season = self.date.year
         self.player_pool = 'QUALIFIER'
Ejemplo n.º 7
0
 def __init__(self):
     self.games = []
     self.calendar = []
     self.http = MLBHttp(accept_gzip=True)