Baseball Files

gameday_epg

GameDay XML - EPG.

http://gd2.mlb.com/components/game/mlb/year_####/month_##/day_##/epg.xml

classes:
    GameDayEPG (GameDayXML)
    epgGame (GameDayGameInfo)

functions:
    dispatch(cmd,[args])    - Module Command Dispatch
    main()                  - Default function
    RefreshDates(dts)       - Reload XML files (forceGET=True)
    RefreshMonth(mon,yr)    - Reload Month XML files (forceGET=True)
    RefreshSeason(yr)       - Reload Season XML files (forceGET=True)
    GenerateAllHTML()       - Run XSLT on all XML files

Developer@Sonnack.com
December 2011

function GenerateAllHTML

Generate all HTML. Uses the object's XSLT to process all existing XML files.

function RefreshDates

Refresh database (forced GET, save XML & HTML) given a List of Dates.

function RefreshMonth

Refresh database (forced GET, save XML & HTML) for a given Month (default to this one).

function RefreshSeason

Refresh database (forced GET, save XML & HTML) for a given Season (year).

function dispatch

Dispatch Command.

usage:
    gameday_epg [command] [date=None] [forceGET=False]

commands:
    main            - Default function
    spcl            - Special function
    today           - Get EPG for today
    today1          - Get EPG for yesterday
    today2          - Get EPG for day before yesterday
    today3          - Get EPG for 3 days ago
    today4          - Get EPG for 4 days ago
    today5          - Get EPG for 5 days ago
    RefreshMonth    - Reload all EPG files for the month (thru today)
    RefreshSeason   - Reload all EPG files for the Season
    GenerateAllHTML - Regenerate all HTML from the XML

function main

Get an EPG object for a given date.

type GameDayEPG

GameDay EPG Class.
Get Game listings for a given date.

properties:
    .games                  - array of epgGame objects
    .dt                     - EPG date ('date')
    .updt                   - last update ('last_modified')

methods:
    .find_team(t)           - get a Game[] given a Team code or name
    .list_games()           - print Scoreboards listing
    .list_games_brief()     - print Scoreboards listing (brief)
    .print_header()         - print listing header
    .date_str()             - printable .dt
    .update_str()           - printable .updt
    .filename()             - "epg.xml"
    .save_html()            - generate HTML using XSLT from XML
    len(obj)                - number of scoreboards
    cmp(obj)                - compare date; compare update-date
    iter(obj)               - get scoreboards iterator
    obj[index]              - get a given scoreboard
    str(obj)                - string: Date, Update, # Games
    repr(obj)               - JSON-like string

type epgGame

GameDay EPG XML Game.
An object instance that encapsulates a '<epg><game>' DOM Element.

properties:
    .status         "status"
    .inning         "inning"
    .outs           "outs"
    .flag_top       "top_inning"
    .flag           "ind"
    .awayRuns       "away_team_runs"
    .awayHits       "away_team_runs"
    .awayErrs       "away_team_errors"
    .homeRuns       "home_team_runs"
    .homeHits       "home_team_hits"
    .homeErrs       "home_team_errors"

methods:
    str(obj)        - string
    repr(obj)       - JSON-like string