From a01314de1a234241d632adf9d110e00d0d0e8c25 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sat, 23 Jun 2018 12:33:59 +0200 Subject: [PATCH] travis: update script --- .travis.yml | 2 +- tools/build_coins.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2de72dd7b..4b606dc25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ install: script: - jsonlint defs/*.json - - cd defs/coins/tools && python build_coins.py + - python tools/build_coins.py --defs notifications: webhooks: diff --git a/tools/build_coins.py b/tools/build_coins.py index cb3053db5..abac8b6d0 100755 --- a/tools/build_coins.py +++ b/tools/build_coins.py @@ -173,6 +173,7 @@ def process_json(fn): print('OK') return j, None + def process(for_device=None): scriptdir = os.path.dirname(os.path.realpath(__file__)) @@ -189,19 +190,20 @@ def process(for_device=None): n = c['coin_name'] c['support'] = {} for s in support_json.keys(): - c['support'][s] = support_json[s][n] if n in support_json[s] else None + c['support'][s] = support_json[s][n] if n in support_json[s] else None # noqa:E501 if support_list is None or n in support_list: coins[n] = c defs[n] = d return (coins, defs) + if __name__ == '__main__': if len(sys.argv) > 1 and not sys.argv[1].startswith('-'): for_device = sys.argv[1] else: for_device = None - + (coins, defs) = process(for_device) json.dump(coins, open('coins.json', 'w'), indent=4, sort_keys=True)