Skip to content

Commit

Permalink
Added '-csvs' option to maddavo's plugin to import all the csvs at once
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Smith committed Mar 3, 2015
1 parent 7d66fbf commit 12c1877
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ TradeDangerous, Copyright (C) Oliver "kfsone" Smith, July 2014
v6.12.5 Mar 03 2015
. (kfsone) Added "--opt=shipvendors" to the maddavo plugin,
. (kfsone) Added "--opt=csvonly" to maddavo plugin (stop after csv imports),
. (kfsone) Added "--opt=csvs" to maddavo plugin (import all the .csvs),
equivalent to "--opt=systems --opt=stations --opt=shipvendor"
. (kfsone) Changed "market" command, "-B" and "-S" are now optional. Default
behavior is equivalent to --buy --sell

Expand Down
1 change: 1 addition & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ IMPORT sub-command:
systems: Merge maddavo's System data into local db,
stations: Merge maddavo's Station data into local db,
shipvendors: Merge maddavo's ShipVendor data into local db,
csvs: Merge all of the above
exportcsv: Regenerate System and Station .csv files after
merging System/Station data.
csvonly: Stop after importing CSV files, no prices,
Expand Down
12 changes: 9 additions & 3 deletions plugins/maddavo_plug.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ class ImportPlugin(plugins.ImportPluginBase):
dateRe = re.compile(r"(\d\d\d\d-\d\d-\d\d)[ T](\d\d:\d\d:\d\d)")

pluginOptions = {
'systems': "Merge maddavo's System data into local db.",
'stations': "Merge maddavo's Station data into local db.",
'shipvendors': "Merge maddavo's ShipVendor data into local db.",
'csvs': "Merge System, Station and ShipVendor data into "
"the local db.",
'systems': "Merge System data into local db.",
'stations': "Merge Station data into local db.",
'shipvendors': "Merge ShipVendor data into local db.",
'exportcsv': "Regenerate System and Station .csv files after "
"merging System/Station data.",
'csvonly': "Stop after csv work, don't import prices",
Expand Down Expand Up @@ -446,6 +448,10 @@ def run(self):

skipDownload = self.getOption("skipdl")
forceParse = self.getOption("force") or skipDownload
if self.getOption("csvs"):
self.options["systems"] = True
self.options["stations"] = True
self.options["shipvendors"] = True

# Ensure the cache is built and reloaded.
tdb.reloadCache()
Expand Down
2 changes: 1 addition & 1 deletion scripts/trade.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rem --== Set default values above to prevent being asked each run ==--
set /P update=Update database from maddavo? (Y\N):
if /I not "%update%"=="Y" goto menu
:update
..\trade.py import --plug=maddavo --option=stations --option=systems --opt=usefull -v
..\trade.py import --plug=maddavo --opt=stations --opt=usefull -v
..\trade.py import --plug=maddavo --opt=use2d -v
..\trade.py import --plug=maddavo --opt=use3h -v
echo Update Complete
Expand Down
2 changes: 1 addition & 1 deletion scripts/tradebrute.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If %update% ==y (goto :update) else (goto :Setup)


:update
%python%\python.exe trade.py import --plug=maddavo --opt=systems --opt=stations
%python%\python.exe trade.py import --plug=maddavo --opt=csvs
goto :Setup


Expand Down

0 comments on commit 12c1877

Please sign in to comment.