From 56de87b8bd6fb822d0e5a485c31f696c1a35e5de Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 28 Dec 2014 02:20:31 -0800 Subject: [PATCH] fixes #111 import not rebuilding cache This applies primarily to the non-plugin default behavior. --- CHANGES.txt | 1 + commands/import_cmd.py | 15 +++------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 40dcbd96..e42128d7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,6 +3,7 @@ TradeDangerous, Copyright (C) Oliver "kfsone" Smith, July 2014 ============================================================================== v6.3.1 [wip] +. (kfsone) Fixed #111 import not rebuilding cache . (kfsone) "maddavo" plugin is now much smarter - will try to download a smaller prices file, - will check the first line of the file to see if it's an update diff --git a/commands/import_cmd.py b/commands/import_cmd.py index 394b10d2..71c7af6a 100644 --- a/commands/import_cmd.py +++ b/commands/import_cmd.py @@ -30,12 +30,6 @@ type=str, default=None, ), - ParseArgument('--maddavo', - help='[Deprecated] Import prices from Maddavo\'s site. Use "--plug=madadvo" instead.', - dest='plug', - action='store_const', - const='maddavo', - ), ParseArgument('--plug', help="Use the specified import plugin.", type=str, @@ -79,12 +73,6 @@ # Perform query and populate result set def run(results, cmdenv, tdb): - if cmdenv.maddavo: - raise CommandLineError( - "--maddavo is deprecated: " - "please use --plug=maddavo instead" - ) - # If we're using a plugin, initialize that first. if cmdenv.plug: try: @@ -101,6 +89,9 @@ def run(results, cmdenv, tdb): if not plugin.run(): return None + tdb.reloadCache() + tdb.close() + if re.match("^https?://", cmdenv.filename, re.IGNORECASE): cmdenv.url, cmdenv.filename = cmdenv.filename, None