Skip to content

Commit

Permalink
Refresh .prices file when removing a station that had items listed
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Mar 28, 2015
1 parent bdb24cb commit c81229e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 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.15.0 Mar 27 2015
. (kfsone) Refresh .prices file after removing a station that had items
. (kfsone) Maddavo Plugin
- Added support for "corrections"
"--opt=corrections" and "--opt=csvs" will read Maddavo's correction data
Expand Down
8 changes: 8 additions & 0 deletions commands/station_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from tradedb import System, Station
from tradedb import TradeDB

import cache
import csvexport
import difflib
import re
Expand Down Expand Up @@ -287,6 +288,7 @@ def removeStation(tdb, cmdenv, station):
db.commit()
cmdenv.NOTE("{} (#{}) removed from {} database.",
station.name(), station.ID, tdb.dbPath)
cmdenv.stationItemCount = station.itemCount
return True


Expand All @@ -300,6 +302,12 @@ def checkResultAndExportStations(tdb, cmdenv, result):

lines, csvPath = csvexport.exportTableToFile(tdb, cmdenv, "Station")
cmdenv.NOTE("{} updated.", csvPath)

if cmdenv.remove:
if cmdenv.stationItemCount:
cmdenv.NOTE("Station had items, regenerating .prices file")
cache.regeneratePricesFile(tdb, cmdenv)

return None


Expand Down

0 comments on commit c81229e

Please sign in to comment.