From 5bf131f29462342730b98d540d36f1c8aabc8e30 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 21 Dec 2014 22:06:17 -0800 Subject: [PATCH] Black market indicator in local command --- CHANGES.txt | 11 +++++++++-- commands/local_cmd.py | 12 +++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index bdfd8c42..7b7f3796 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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: diff --git a/commands/local_cmd.py b/commands/local_cmd.py index 845ee881..fc011c93 100644 --- a/commands/local_cmd.py +++ b/commands/local_cmd.py @@ -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) @@ -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,