Skip to content

Commit

Permalink
fixes #111 import not rebuilding cache
Browse files Browse the repository at this point in the history
This applies primarily to the non-plugin default behavior.
  • Loading branch information
kfsone committed Dec 28, 2014
1 parent bcbab76 commit 56de87b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 3 additions & 12 deletions commands/import_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand All @@ -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

Expand Down

0 comments on commit 56de87b

Please sign in to comment.