Skip to content

Commit

Permalink
v6.14.3 eddb v3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Mar 18, 2015
1 parent d08eb86 commit 99d9015
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
TradeDangerous, Copyright (C) Oliver "kfsone" Smith, July 2014
==============================================================================

v6.14.3 Mar 17 2015
. (kfsone) Windows improvements to misc/madupload.py,
. (kfsone) EDDB v3 support,

v6.14.2 Mar 15 2015
. (kfsone) Minor tweaks
. (kfsone) Removed the "tradingWith" cache because its hit rate was so low
Expand Down
8 changes: 1 addition & 7 deletions misc/eddb.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import sys
import transfers

BASE_URL = "http://eddb.io/archive/v2/"
BASE_URL = "http://eddb.io/archive/v3/"
COMMODITIES_JSON = BASE_URL + "commodities.json"
SYSTEMS_JSON = BASE_URL + "systems.json"
STATIONS_EXT_JSON = BASE_URL + "stations.json"
Expand Down Expand Up @@ -71,12 +71,6 @@ class StationsQuery(EDDBQuery):
"""
url = STATIONS_LITE_JSON

# EDDB black market is null (unknown), 0 (No) or 1 (Yes)
marketConversion = {None:'?', 0:'N', 1:'Y'}

# EDDB pad size is null (unknown), 10 (small), 20 (medium) or 30 (large)
padConversion = {None:'?', 10:'S', 20:'M', 30:'L'}

class StationsExtQuery(StationsQuery):
"""
Streams extended Station data from EDDB with trade data.
Expand Down
6 changes: 3 additions & 3 deletions misc/importeddbstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ def matching_stations():
updateStation = tdb.updateLocalStation

bool_trans = { None: '?', 0: 'N', 1: 'Y' }
pad_trans = { None: '?', 10: 'S', 20: 'M', 30: 'L' }

updates = 0
for tdStn, eddbStn in matching_stations():
mps = eddbStn['max_landing_pad_size'] or '?'
if updateStation(
station=tdStn,
lsFromStar=eddbStn['distance_to_star'],
maxPadSize=pad_trans[eddbStn['max_landing_pad_size']],
maxPadSize=mps,
market=bool_trans[eddbStn['has_commodities']],
blackMarket=bool_trans[eddbStn['has_blackmarket']],
shipyard=bool_trans[eddbStn['has_shipyard']],
Expand All @@ -50,4 +50,4 @@ def matching_stations():
if updates:
tdb.getDB().commit()
csvexport.exportTableToFile(tdb, tdb.tdenv, "Station")
print("Updated Station.csv: {} updates".format(updates))
print("Updated Station.csv: {} updates".format(updates))

0 comments on commit 99d9015

Please sign in to comment.