From dcaa338a8e638ff20890f949fd116fab0228e050 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 20 Apr 2014 18:52:05 -0400 Subject: [PATCH] Add dummy TSN.XML.{Game,Sport}Info modules that only list DTDs for now. --- htsn-import.cabal | 2 + src/Main.hs | 6 ++ src/TSN/XML/GameInfo.hs | 39 +++++++++ src/TSN/XML/SportInfo.hs | 167 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 214 insertions(+) create mode 100644 src/TSN/XML/GameInfo.hs create mode 100644 src/TSN/XML/SportInfo.hs diff --git a/htsn-import.cabal b/htsn-import.cabal index a38aa34..a6f61ad 100644 --- a/htsn-import.cabal +++ b/htsn-import.cabal @@ -113,12 +113,14 @@ executable htsn-import TSN.Picklers TSN.XmlImport TSN.XML.AutoRacingSchedule + TSN.XML.GameInfo TSN.XML.Heartbeat TSN.XML.Injuries TSN.XML.InjuriesDetail TSN.XML.News TSN.XML.Odds TSN.XML.Scores + TSN.XML.SportInfo TSN.XML.Weather Xml diff --git a/src/Main.hs b/src/Main.hs index 648ddae..4669b74 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -48,6 +48,7 @@ import TSN.DbImport ( DbImport(..), ImportResult(..) ) import qualified TSN.XML.AutoRacingSchedule as AutoRacingSchedule ( dtd, pickle_message ) +import qualified TSN.XML.GameInfo as GameInfo ( dtds ) import qualified TSN.XML.Heartbeat as Heartbeat ( dtd, verify ) import qualified TSN.XML.Injuries as Injuries ( dtd, pickle_message ) import qualified TSN.XML.InjuriesDetail as InjuriesDetail ( @@ -56,6 +57,7 @@ import qualified TSN.XML.InjuriesDetail as InjuriesDetail ( import qualified TSN.XML.News as News ( dtd, pickle_message ) import qualified TSN.XML.Odds as Odds ( dtd, pickle_message ) import qualified TSN.XML.Scores as Scores ( dtd, pickle_message ) +import qualified TSN.XML.SportInfo as SportInfo ( dtds ) import qualified TSN.XML.Weather as Weather ( dtd, pickle_message ) import Xml ( DtdName(..), parse_opts ) @@ -188,6 +190,10 @@ import_file cfg path = do let m = unpickleDoc Weather.pickle_message xml maybe (return $ ImportFailed errmsg) migrate_and_import m + | dtd `elem` GameInfo.dtds = undefined + + | dtd `elem` SportInfo.dtds = undefined + | otherwise = do let infomsg = "Unrecognized DTD in " ++ path ++ ": " ++ dtd ++ "." diff --git a/src/TSN/XML/GameInfo.hs b/src/TSN/XML/GameInfo.hs new file mode 100644 index 0000000..b3ac3f6 --- /dev/null +++ b/src/TSN/XML/GameInfo.hs @@ -0,0 +1,39 @@ +-- | GameInfo represents a collection of DTDs that we don't really +-- handle but want to make available. The raw XML gets stored in the +-- database along with the XML_File_ID, but we don't parse any of it. +-- +-- See also: TSN.XML.SportInfo +-- +module TSN.XML.GameInfo ( + dtds ) +where + +-- | The DTDs for everything that we consider "Game Info." +-- +-- TODO: This is the list from the old implementation. We need to +-- make sure that we are really receiving XML for these DTDs +-- (i.e. the names are correct). +-- +dtds :: [String] +dtds = + [ "CBASK_Lineup_XML.dtd", + "cbaskpreviewxml.dtd", + "cflpreviewxml.dtd", + "Matchup_NBA_NHL_XML.dtd", + "mlbpreviewxml.dtd", + "MLB_Gaming_Matchup_XML.dtd", + "MLB.dtd", + "MLB_Lineup_XML.dtd", + "MLB_Matchup_XML.dtd", + "MLS_Preview_XML.dtd", + "NBA_Gaming_Matchup_XML.dtd", + "NBA.dtd", + "NBA_Playoff_Matchup_XML.dtd", + "NBALineupXML.dtd", + "nbapreviewxml.dtd", + "NCAA_FB_Preview_XML.dtd", + "nflpreviewxml.dtd", + "NFL_NCAA_FB_Matchup_XML.dtd", + "nhlpreviewxml.dtd", + "recapxml.dtd", + "WorldBaseballPreviewXML.dtd" ] diff --git a/src/TSN/XML/SportInfo.hs b/src/TSN/XML/SportInfo.hs new file mode 100644 index 0000000..b7e269e --- /dev/null +++ b/src/TSN/XML/SportInfo.hs @@ -0,0 +1,167 @@ +-- | SportInfo represents a collection of DTDs that we don't really +-- handle but want to make available. The raw XML gets stored in the +-- database along with the XML_File_ID, but we don't parse any of it. +-- +-- See also: TSN.XML.GameInfo +-- +module TSN.XML.SportInfo ( + dtds ) +where + +-- | The DTDs for everything that we consider "Sport Info." +-- +-- TODO: This is the list from the old implementation. We need to +-- make sure that we are really receiving XML for these DTDs +-- (i.e. the names are correct). +-- +dtds :: [String] +dtds = + [ "CBASK_3PPctXML.dtd", + "Cbask_All_Tourn_Teams_XML.dtd", + "CBASK_AssistsXML.dtd", + "Cbask_Awards_XML.dtd", + "CBASK_BlocksXML.dtd", + "CBask_BlocksXML.dtd", + "Cbask_Conf_Standings_XML.dtd", + "Cbask_DivII_III_Indv_Stats_XML.dtd", + "Cbask_DivII_Team_Stats_XML.dtd", + "Cbask_DivIII_Team_Stats_XML.dtd", + "CBASK_FGPctXML.dtd", + "CBask_FGPctXML.dtd", + "CBASK_FoulsXML.dtd", + "CBASK_FTPctXML.dtd", + "Cbask_Indv_No_Avg_XML.dtd", + "Cbask_Indv_Scoring_XML.dtd", + "Cbask_Indv_Shooting_XML.dtd", + "CBASK_MinutesXML.dtd", + "Cbask_Polls_XML.dtd", + "CBASK_ReboundsXML.dtd", + "CBASK_ScoringLeadersXML.dtd", + "CBASK_StealsXML.dtd", + "Cbask_Team_Scoring_Rebound_Margin_XML.dtd", + "Cbask_Team_Scoring_XML.dtd", + "Cbask_Team_Shooting_Pct_XML.dtd", + "Cbask_Team_ThreePT_Made_XML.dtd", + "Cbask_Team_ThreePT_PCT_XML.dtd", + "Cbask_Team_Win_Pct_XML.dtd", + "Cbask_Top_Twenty_Five_XML.dtd", + "CBASK_TopTwentyFiveResult_XML.dtd", + "Cbask_Tourn_Awards_XML.dtd", + "Cbask_Tourn_Champs_XML.dtd", + "Cbask_Tourn_Indiv_XML.dtd", + "Cbask_Tourn_Leaders_XML.dtd", + "Cbask_Tourn_MVP_XML.dtd", + "Cbask_Tourn_Records_XML.dtd", + "LeagueScheduleXML.dtd", + "minorscoresxml.dtd", + "Minor_Baseball_League_Leaders_XML.dtd", + "Minor_Baseball_Standings_XML.dtd", + "Minor_Baseball_Transactions_XML.dtd", + "mlbbattingavgxml.dtd", + "mlbdoublesleadersxml.dtd", + "MLBGamesPlayedXML.dtd", + "MLBGIDPXML.dtd", + "MLBHitByPitchXML.dtd", + "mlbhitsleadersxml.dtd", + "mlbhomerunsxml.dtd", + "MLBHRFreqXML.dtd", + "MLBIntWalksXML.dtd", + "MLBKORateXML.dtd", + "mlbonbasepctxml.dtd", + "MLBOPSXML.dtd", + "MLBPlateAppsXML.dtd", + "mlbrbisxml.dtd", + "mlbrunsleadersxml.dtd", + "MLBSacFliesXML.dtd", + "MLBSacrificesXML.dtd", + "MLBSBSuccessXML.dtd", + "mlbsluggingpctxml.dtd", + "mlbstandxml.dtd", + "mlbstandxml_preseason.dtd", + "mlbstolenbasexml.dtd", + "mlbtotalbasesleadersxml.dtd", + "mlbtriplesleadersxml.dtd", + "MLBWalkRateXML.dtd", + "mlbwalksleadersxml.dtd", + "MLBXtraBaseHitsXML.dtd", + "MLB_ERA_Leaders.dtd", + "MLB_Fielding_XML.dtd", + "MLB_Pitching_Appearances_Leaders.dtd", + "MLB_Pitching_Balks_Leaders.dtd", + "MLB_Pitching_CG_Leaders.dtd", + "MLB_Pitching_ER_Allowed_Leaders.dtd", + "MLB_Pitching_Hits_Allowed_Leaders.dtd", + "MLB_Pitching_Hit_Batters_Leaders.dtd", + "MLB_Pitching_HR_Allowed_Leaders.dtd", + "MLB_Pitching_IP_Leaders.dtd", + "MLB_Pitching_Runs_Allowed_Leaders.dtd", + "MLB_Pitching_Saves_Leaders.dtd", + "MLB_Pitching_Shut_Outs_Leaders.dtd", + "MLB_Pitching_Starts_Leaders.dtd", + "MLB_Pitching_Strike_Outs_Leaders.dtd", + "MLB_Pitching_Walks_Leaders.dtd", + "MLB_Pitching_WHIP_Leaders.dtd", + "MLB_Pitching_Wild_Pitches_Leaders.dtd", + "MLB_Pitching_Win_Percentage_Leaders.dtd", + "MLB_Pitching_WL_Leaders.dtd", + "NBA_Team_Stats_XML.dtd", + "NBA3PPctXML.dtd", + "NBAAssistsXML.dtd", + "NBABlocksXML.dtd", + "nbaconfrecxml.dtd", + "nbadaysxml.dtd", + "nbadivisionsxml.dtd", + "NBAFGPctXML.dtd", + "NBAFoulsXML.dtd", + "NBAFTPctXML.dtd", + "NBAMinutesXML.dtd", + "NBAReboundsXML.dtd", + "NBAScorersXML.dtd", + "nbastandxml.dtd", + "NBAStealsXML.dtd", + "nbateamleadersxml.dtd", + "nbatripledoublexml.dtd", + "NBATurnoversXML.dtd", + "NCAA_Conference_Schedule_XML.dtd", + "nflfirstdownxml.dtd", + "NFLFumbleLeaderXML.dtd", + "NFLGiveTakeXML.dtd", + "NFLGrassTurfDomeOutsideXML.dtd", + "NFLInside20XML.dtd", + "NFLInterceptionLeadersXML.dtd", + "NFLKickoffsXML.dtd", + "NFLMondayNightXML.dtd", + "NFLPassingLeadersXML.dtd", + "NFLPassLeadXML.dtd", + "NFLQBStartsXML.dtd", + "NFLReceivingLeadersXML.dtd", + "NFLRushingLeadersXML.dtd", + "NFLSackLeadersXML.dtd", + "nflstandxml.dtd", + "NFLTackleFFLeadersXML.dtd", + "NFLTeamRankingsXML.dtd", + "NFLTopKickoffReturnXML.dtd", + "NFLTopPerformanceXML.dtd", + "NFLTopPuntReturnXML.dtd", + "NFLTotalYardageXML.dtd", + "NFLYardsXML.dtd", + "NFL_KickingLeaders_XML.dtd", + "NFL_NBA_Draft_XML.dtd", + "NFL_PuntingLeaders_XML.dtd", + "NFL_Roster_XML.dtd", + "NFL_Team_Stats_XML.dtd", + "Transactions_XML.dtd", + "Weekly_Sched_XML.dtd", + "WNBA_Team_Leaders_XML.dtd", + "WNBA3PPctXML.dtd", + "WNBAAssistsXML.dtd", + "WNBABlocksXML.dtd", + "WNBAFGPctXML.dtd", + "WNBAFoulsXML.dtd", + "WNBAFTPctXML.dtd", + "WNBAMinutesXML.dtd", + "WNBAReboundsXML.dtd", + "WNBAScorersXML.dtd", + "wnbastandxml.dtd", + "WNBAStealsXML.dtd", + "WNBATurnoversXML.dtd" ] -- 2.44.2