impoved argument and exception handling in scripts/get_market_pairs.py
This commit is contained in:
parent
93ebf163cb
commit
902ffa6853
@ -1,5 +1,6 @@
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
sys.path.append(root + '/python')
|
||||
@ -49,6 +50,11 @@ def print_supported_exchanges():
|
||||
|
||||
try:
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
dump("Usage: python " + sys.argv[0], green('id'))
|
||||
print_supported_exchanges()
|
||||
sys.exit(1)
|
||||
|
||||
id = sys.argv[1] # get exchange id from command line arguments
|
||||
|
||||
# check if the exchange is supported by ccxt
|
||||
@ -87,5 +93,7 @@ try:
|
||||
|
||||
except Exception as e:
|
||||
dump('[' + type(e).__name__ + ']', str(e))
|
||||
dump(traceback.format_exc())
|
||||
dump("Usage: python " + sys.argv[0], green('id'))
|
||||
print_supported_exchanges()
|
||||
sys.exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user