mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-08 05:20:03 +03:00
parent
3caf07d3ce
commit
0ee5b72ac6
4
td.py
4
td.py
@ -26,6 +26,8 @@ def export(data):
|
||||
|
||||
filename = join(config.get('outdir'), '%s.%s.%s.prices' % (data['lastSystem']['name'].strip(), data['lastStarport']['name'].strip(), time.strftime('%Y-%m-%dT%H.%M.%S', time.localtime(querytime))))
|
||||
|
||||
timestamp = time.strftime('%Y-%m-%d %H:%M:%S', time.strptime(data['timestamp'], '%Y-%m-%dT%H:%M:%SZ'))
|
||||
|
||||
# Format described here: https://bitbucket.org/kfsone/tradedangerous/wiki/Price%20Data
|
||||
h = open(filename, 'wt') # codecs can't automatically handle line endings, so encode manually where required
|
||||
h.write(('#! trade.py import -\n# Created by %s %s on %s%s.\n#\n# <item name> <sellCR> <buyCR> <demand> <stock> <timestamp>\n\n@ %s/%s\n' % (applongname, appversion, platform=='darwin' and "Mac OS" or system(), not config.getint('anonymous') and ' for Cmdr '+data['commander']['name'].strip() or '', data['lastSystem']['name'].strip(), data['lastStarport']['name'].strip())).encode('utf-8'))
|
||||
@ -47,6 +49,6 @@ def export(data):
|
||||
demandbracketmap[commodity['demandBracket']],
|
||||
int(commodity['stock']) if commodity['stockBracket'] else '',
|
||||
stockbracketmap[commodity['stockBracket']],
|
||||
data['timestamp']))
|
||||
timestamp))
|
||||
|
||||
h.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user