From 753e5ad951cc66c222b9bd2b39e2d724c23a0202 Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Sat, 6 Jun 2015 01:08:04 +0100 Subject: [PATCH] Re-allow commodities in "salvage" category. --- companion.py | 3 +-- eddn.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/companion.py b/companion.py index 6cf415ce..71a6e54b 100644 --- a/companion.py +++ b/companion.py @@ -23,8 +23,7 @@ holdoff = 120 # be nice categorymap = { 'Narcotics': 'Legal Drugs', 'Slaves': 'Slavery', - 'NonMarketable': False, - 'Salvage': False, } + 'NonMarketable': False, } commoditymap= { 'Agricultural Medicines': 'Agri-Medicines', 'Atmospheric Extractors': 'Atmospheric Processors', diff --git a/eddn.py b/eddn.py index abe12441..8bdd2f21 100644 --- a/eddn.py +++ b/eddn.py @@ -24,7 +24,7 @@ def export(data, callback): 'uploaderID': data['commander']['name'].strip() } systemName = data['lastSystem']['name'].strip() stationName = data['lastStarport']['name'].strip() - timestamp = time.strftime('%Y-%m-%dT%H:%M:%S', time.gmtime(querytime)) + timestamp = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime(querytime)) # route all requests through a session in the hope of using keep-alive session = requests.Session() @@ -43,9 +43,9 @@ def export(data, callback): 'stationName': stationName, 'itemName': commoditymap.get(commodity['name'].strip(), commodity['name'].strip()), 'buyPrice': int(commodity.get('buyPrice', 0)), - 'stationStock': commodity.get('stockBracket') and int(commodity.get('stock', 0)), + 'stationStock': commodity.get('stockBracket') and int(commodity.get('stock', 0)) or 0, 'sellPrice': int(commodity.get('sellPrice', 0)), - 'demand': commodity.get('demandBracket') and int(commodity.get('demand', 0)), + 'demand': commodity.get('demandBracket') and int(commodity.get('demand', 0)) or 0, 'timestamp': timestamp, } }