Skip to content

Commit

Permalink
Black market indicator in local command
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Dec 22, 2014
1 parent 19dae79 commit 5bf131f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
11 changes: 9 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@
TradeDangerous, Copyright (C) Oliver "kfsone" Smith, July 2014
==============================================================================

v6.2.4 [wip]
v6.2.4 Dec 21 2014
. (kfsone) Experimental "add-station" command in misc,
. (kfsone) Added "--near" to olddata command,
. (kfsone) Route calculation performance,
. (kfsone) Added "Black Market" flag to station data,
. (kfsone) Added Black Market indicators to "local" command,
. (kfsone) Reorganized Ship and ShipVendor data (prices are ship based now),
. (kfsone) Draft version of "jsonprices",
. (gazelle) Auto-completion for bash users (see scripts/README.txt)
. (gazelle) Nice overhaul of the csv export command
. (kfsone) Fix for UTF-8 decoding error,
. (kfsone) Rebuild cache before .prices file after downloading .csvs
. (maddavo) Combat Stabilisers do exist
+ Systems, Stations, Data: Maddavo, Gazelle
+ Systems, Stations, Data: Maddavo, Gazelle, Kfsone, many others

v6.2.3 Dec 17 2014
. (kfsone) "maddavo" import plugin:
Expand Down
12 changes: 9 additions & 3 deletions commands/local_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def run(results, cmdenv, tdb):
rr = ResultRow(
station=station,
dist=station.lsFromStar,
age=age
age=age,
blackMarket=station.blackMarket,
)
row.stations.append(rr)
results.rows.append(row)
Expand Down Expand Up @@ -127,17 +128,22 @@ def render(results, cmdenv, tdb):
key=lambda row: row.dist)
)

marketStates = { 'Y': 'Yes', 'N': 'No', '?': 'Unk' }
showStations = cmdenv.detail or cmdenv.ages
if showStations:
stnRowFmt = RowFormat(prefix=' + ').append(
ColumnFormat("Station", '<', 32,
key=lambda row: row.station.str())
key=lambda row: row.station.str())
)
if cmdenv.detail:
stnRowFmt.append(
ColumnFormat("Dist", '>', '10',
key=lambda row: '{}ls'.format(row.dist) if row.dist else '')
key=lambda row: '{}ls'.format(row.dist) if row.dist else '')
)
stnRowFmt.append(
ColumnFormat("BMkt", '>', '4',
key=lambda row: marketStates[row.blackMarket]
))
if cmdenv.ages:
stnRowFmt.append(
ColumnFormat("Age/days", '>', 7,
Expand Down

0 comments on commit 5bf131f

Please sign in to comment.