Projet

Général

Profil

Révision 23811e34

ID23811e34905b9990ac88c82ed4a7e797987114b4
Parent 86692d70
Enfant 1e717d89

Ajouté par Lars Kruse il y a plus de 7 ans

Plugin etherscan_balance_: fix style issues; change to python3

Voir les différences:

plugins/currency/ethereum/etherscan_balance_
1
#!/usr/bin/env python
1
#!/usr/bin/env python3
2 2

  
3 3
"""
4 4
=head1 NAME
......
86 86
    print("wei_balance_{}.label ETH".format(eth_address))
87 87
    sys.exit(0)
88 88

  
89
ethercan_balance_api_url = 'https://api.etherscan.io/api?module=account&action=balance&tag=latest&address=' + eth_address
89
ethercan_balance_api_url = ('https://api.etherscan.io/api'
90
                            '?module=account&action=balance&tag=latest&address=' + eth_address)
90 91

  
91 92
etherscan_req = Request(ethercan_balance_api_url)
92 93
# User-Agent to bypass Cloudflare
......
109 110

  
110 111
try:
111 112
    eth = int(etherscan_balance['result'])
112
except:
113
except (KeyError, ValueError) as exc:
113 114
    print("JSON result error!", file=sys.stderr)
114 115
    sys.exit(9)
115 116

  
116
print("wei_balance_{}.value {}".format(eth_address, eth));
117
print("wei_balance_{}.value {}".format(eth_address, eth))

Formats disponibles : Unified diff