mirror of
https://github.com/EDCD/EDDN.git
synced 2025-06-15 23:02:05 +03:00
Merge pull request #112 from alewando/python_example_fix
Python 3 example: Use correct property names for commodity stock and demand
This commit is contained in:
commit
dafbb07f56
0
examples/Python 3.4/Client_Complete.bat
Normal file → Executable file
0
examples/Python 3.4/Client_Complete.bat
Normal file → Executable file
8
examples/Python 3.4/Client_Complete.py
Normal file → Executable file
8
examples/Python 3.4/Client_Complete.py
Normal file → Executable file
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import zlib
|
import zlib
|
||||||
import zmq
|
import zmq
|
||||||
import simplejson
|
import simplejson
|
||||||
@ -200,12 +202,12 @@ def main():
|
|||||||
for __commodity in __json['message']['commodities']:
|
for __commodity in __json['message']['commodities']:
|
||||||
echoLog(' - Name: ' + __commodity['name'])
|
echoLog(' - Name: ' + __commodity['name'])
|
||||||
echoLog(' - Buy Price: ' + str(__commodity['buyPrice']))
|
echoLog(' - Buy Price: ' + str(__commodity['buyPrice']))
|
||||||
echoLog(' - Supply: ' + str(__commodity['supply'])
|
echoLog(' - Supply: ' + str(__commodity['stock'])
|
||||||
+ ((' (' + __commodity['supplyLevel'] + ')') if 'supplyLevel' in __commodity else '')
|
+ ((' (' + str(__commodity['stockBracket']) + ')') if 'stockBracket' in __commodity else '')
|
||||||
)
|
)
|
||||||
echoLog(' - Sell Price: ' + str(__commodity['sellPrice']))
|
echoLog(' - Sell Price: ' + str(__commodity['sellPrice']))
|
||||||
echoLog(' - Demand: ' + str(__commodity['demand'])
|
echoLog(' - Demand: ' + str(__commodity['demand'])
|
||||||
+ ((' (' + __commodity['demandLevel'] + ')') if 'demandLevel' in __commodity else '')
|
+ ((' (' + str(__commodity['demandBracket']) + ')') if 'demandBracket' in __commodity else '')
|
||||||
)
|
)
|
||||||
# End example
|
# End example
|
||||||
|
|
||||||
|
0
examples/Python 3.4/Client_Simple.bat
Normal file → Executable file
0
examples/Python 3.4/Client_Simple.bat
Normal file → Executable file
0
examples/Python 3.4/Client_Simple.py
Normal file → Executable file
0
examples/Python 3.4/Client_Simple.py
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user