From bd375c4758fb8b2ad7a81556b0959d60ddba36c0 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 5 Dec 2014 12:59:45 -0800 Subject: [PATCH 1/5] Fixed bug with corrections in cache.py --- cache.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 From 9ebfbbd906ed58f8b4eae35ac549d36ee6ce396c Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 5 Dec 2014 13:01:28 -0800 Subject: [PATCH 2/5] Fixed typo in formatting.py --- formatting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From cf5d763f6348d4a9e20ce4c305cd7fe667c0d482 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 5 Dec 2014 13:01:57 -0800 Subject: [PATCH 3/5] Fixed missing array decl in tradedb AmbiguityError resolution in lookupPlace wasn't creating the array to store systems in. --- tradedb.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tradedb.py b/tradedb.py index 356f5cbd..e9f3e7e3 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 = [] for candidate in e.anyMatch: if isinstance(candidate, Station): systems.add(candidate.system) From 05b73c42141065b6c4877cf2aa4ae793eefd2abd Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 5 Dec 2014 13:02:09 -0800 Subject: [PATCH 4/5] Import all the commands at the start of trade.py --- trade.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ###################################################################### From 5457f0b0d3b28177d5e9f63a4827a04fb6f041da Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 5 Dec 2014 15:11:00 -0800 Subject: [PATCH 5/5] disambiguation 'systems' should be a set not a list --- tradedb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tradedb.py b/tradedb.py index e9f3e7e3..44e64c05 100644 --- a/tradedb.py +++ b/tradedb.py @@ -485,7 +485,7 @@ def lookupSystemRelaxed(self, key): return place except AmbiguityError as e: # See if the ambiguity resolves down to a single system. - systems = [] + systems = set() for candidate in e.anyMatch: if isinstance(candidate, Station): systems.add(candidate.system)