X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FMain.hs;fp=src%2FMain.hs;h=cb4bdffbe5e61f4ff8045e701310693944ff9dd2;hb=fe55e0de738d00b94ad1269bafe32beb83860387;hp=0fe6096e867631e4ea0ddae439324d891fd037f2;hpb=b161327d65e3f8922168e6ddd1665f9d06fee22c;p=dead%2Fhtsn-import.git diff --git a/src/Main.hs b/src/Main.hs index 0fe6096..cb4bdff 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -65,7 +65,11 @@ import qualified TSN.XML.ScheduleChanges as ScheduleChanges ( pickle_message ) import qualified TSN.XML.Scores as Scores ( dtd, pickle_message ) import qualified TSN.XML.SportInfo as SportInfo ( dtds, parse_xml ) -import qualified TSN.XML.Weather as Weather ( dtd, is_type1, pickle_message ) +import qualified TSN.XML.Weather as Weather ( + dtd, + is_type1, + pickle_message, + teams_are_normal ) import Xml ( DtdName(..), parse_opts ) @@ -204,11 +208,17 @@ import_file cfg path = do -- SportInfo and GameInfo appear last in the guards | dtd == Weather.dtd = + -- Some of the weatherxml docs are busted in predictable ways. + -- We want them to "succeed" so that they're deleted. + -- We already know we can't parse them. if Weather.is_type1 xml - then go Weather.pickle_message + then if Weather.teams_are_normal xml + then go Weather.pickle_message + else do + let msg = "Teams in reverse order in weatherxml.dtd" ++ + " (" ++ path ++ ")" + return $ ImportUnsupported msg else do - -- We want these to "succeed" so that they're deleted. - -- We already know we can't parse them. let msg = "Unsupported weatherxml.dtd type (" ++ path ++ ")" return $ ImportUnsupported msg