diff --git a/CHANGES.txt b/CHANGES.txt index cfca07fa..a76fbeae 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,6 +5,10 @@ TradeDangerous, Copyright (C) Oliver "kfsone" Smith, July 2014 v6.18.3 Apr 19 2015 . (kfsone) Added "--shorten" (requires --to) Will show routes with less hops if they produces a better gpt +. (kfsone) "import" maddavo plugin: + - Added sanity checking of timestamps during System.csv import + (there was a new system in mad's data with an apostrophe in the + modified timestamp) + (kfsone) ~310 new systems v6.18.2 Apr 18 2015 diff --git a/plugins/maddavo_plug.py b/plugins/maddavo_plug.py index a5393173..1672647c 100644 --- a/plugins/maddavo_plug.py +++ b/plugins/maddavo_plug.py @@ -274,6 +274,7 @@ def import_systems(self): """ tdb, tdenv = self.tdb, self.tdenv + dateTimeRe = re.compile(r'\s*(\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2})') stream = self.csv_system_rows(SYSTEMS_URL, "Systems") for sysName, system, values in stream: @@ -287,6 +288,13 @@ def import_systems(self): self.modSystems += 1 continue + # Clean up the modified stamp + m = dateTimeRe.match(modified) + if not m: + tdenv.WARN("{} has invalid 'modified': {}", sysName, modified) + continue + modified = m.group(1) + x, y, z = float(values[1]), float(values[2]), float(values[3]) if not system: tdb.addLocalSystem(