From fc1ae2bee4b1120ba835fe07e1231228b466eaff Mon Sep 17 00:00:00 2001 From: Andreas Gocht Date: Fri, 11 Nov 2016 16:22:05 +0100 Subject: [PATCH] Fix a bug in edshipyard.py When refreshing data at a station, I got an error that the global variable querytime was not defined. It looks like querytime should be defined a few lines further down than it actually was, because where it was it didn't do anything. Everything worked fine after this fix. --- edshipyard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/edshipyard.py b/edshipyard.py index 713a2176..3a576c66 100644 --- a/edshipyard.py +++ b/edshipyard.py @@ -48,8 +48,6 @@ def description(data): p = props[-1] to[p] = data[p] - querytime = config.getint('querytime') or int(time.time()) - # subset of "ship" that's not noisy ship = {} for props in [ @@ -92,6 +90,8 @@ def export(data, filename=None): if h.read() == string: return # same as last time - don't write + querytime = config.getint('querytime') or int(time.time()) + # Write filename = join(config.get('outdir'), '%s.%s.txt' % (ship, time.strftime('%Y-%m-%dT%H.%M.%S', time.localtime(querytime)))) with open(filename, 'wt') as h: