Révision 6ff34af5
set U as default
| plugins/currency/zcash/zcash_flypool_hashrate_ | ||
|---|---|---|
| 85 | 85 |
# manage codec and error handling lookup process |
| 86 | 86 |
reader = codecs.getreader("utf-8")
|
| 87 | 87 |
|
| 88 |
hash_rate = "U" |
|
| 89 |
|
|
| 88 | 90 |
try: |
| 89 | 91 |
mining_stats = json.load(reader(mining_stats_raw)) |
| 90 | 92 |
except ValueError: |
| 91 | 93 |
print("Failed to parse JSON responce.", file=sys.stderr)
|
| 92 |
print("flypool_hs_{}_{}.value U".format(zcash_address, miner))
|
|
| 93 | 94 |
else: |
| 94 | 95 |
try: |
| 95 | 96 |
worker = mining_stats['data'] |
| 96 | 97 |
except (KeyError, TypeError): |
| 97 | 98 |
print("JSON result error!", file=sys.stderr)
|
| 98 |
print("flypool_hs_{}_{}.value U".format(zcash_address, miner))
|
|
| 99 | 99 |
else: |
| 100 | 100 |
try: |
| 101 | 101 |
hash_rate = worker['currentHashrate'] |
| 102 | 102 |
except (KeyError, TypeError): |
| 103 | 103 |
print("No current Hashrate!", file=sys.stderr)
|
| 104 |
print("flypool_hs_{}_{}.value U".format(zcash_address, miner))
|
|
| 105 |
else: |
|
| 106 |
print("flypool_hs_{}_{}.value {}".format(zcash_address, miner, hash_rate))
|
|
| 104 |
|
|
| 105 |
print("flypool_hs_{}_{}.value {}".format(zcash_address, miner, hash_rate))
|
|
Formats disponibles : Unified diff