diff --git a/cache.py b/cache.py index 4f0126d2..c9f7ab48 100644 --- a/cache.py +++ b/cache.py @@ -303,21 +303,21 @@ def changeStation(matches): if stationID < 0: try: correctName = corrections.systems[systemName] - if correction == DELETED: + if correctName == DELETED: tdenv.DEBUG1("DELETED: {}", systemName) - stationID = correction + stationID = DELETED return - systemName = correction.upper() + systemName = correctName.upper() except KeyError: pass try: key = systemName + "/" + stationName.upper() - correction = corrections.stations[key] - if correction == DELETED: + correctName = corrections.stations[key] + if correctName == DELETED: tdenv.DEBUG1("DELETED: {}", key) - stationID = correction + stationID = DELETED return - stationName = correction.upper() + stationName = correctName.upper() except KeyError: pass facility = systemName + '/' + stationName diff --git a/formatting.py b/formatting.py index ed82acbd..f0b6957d 100644 --- a/formatting.py +++ b/formatting.py @@ -121,7 +121,7 @@ def append(self, column, after=None): if after: for idx, col in enumerate(columns, 1): if col.name == after: - columns.insert(idx, newColumn) + columns.insert(idx, column) return self columns.append(column) return self diff --git a/trade.py b/trade.py index df54e0aa..f711e564 100755 --- a/trade.py +++ b/trade.py @@ -31,7 +31,7 @@ from __future__ import absolute_import, with_statement, print_function, division, unicode_literals import os -import commands +from commands import * import tradedb ###################################################################### diff --git a/tradedb.py b/tradedb.py index 356f5cbd..44e64c05 100644 --- a/tradedb.py +++ b/tradedb.py @@ -485,6 +485,7 @@ def lookupSystemRelaxed(self, key): return place except AmbiguityError as e: # See if the ambiguity resolves down to a single system. + systems = set() for candidate in e.anyMatch: if isinstance(candidate, Station): systems.add(candidate.system)