mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Fix python style issues reported by flake8
Additionally some python2-only "print" statements are now compatible with python3.
This commit is contained in:
parent
73f885e382
commit
7063330e03
17 changed files with 102 additions and 103 deletions
|
@ -236,7 +236,7 @@ class Proxy:
|
|||
'method': self.method,
|
||||
'params': args,
|
||||
'id': self.id,
|
||||
}
|
||||
}
|
||||
request = urllib.request.Request(self.service.url, json.dumps(data).encode())
|
||||
if self.service.username:
|
||||
auth_string = '%s:%s' % (self.service.username, self.service.password)
|
||||
|
|
|
@ -7,11 +7,11 @@ import urllib2
|
|||
import json
|
||||
|
||||
URL = 'https://www.btcguild.com/api.php?api_key='
|
||||
API_KEY = sys.argv[0][(sys.argv[0].rfind('_')+1):]
|
||||
API_KEY = sys.argv[0][(sys.argv[0].rfind('_') + 1):]
|
||||
|
||||
STATS = URL + API_KEY
|
||||
|
||||
print STATS
|
||||
print(STATS)
|
||||
|
||||
command = ''
|
||||
if len(sys.argv) > 1:
|
||||
|
@ -25,16 +25,16 @@ workers = mining_stats['workers']
|
|||
|
||||
|
||||
if command == 'config':
|
||||
print "graph_title BTCGuild Hashrate"
|
||||
print "graph_args --upper-limit 3000 -l 0"
|
||||
print "graph_vlabel MHash/s"
|
||||
print "graph_category htc"
|
||||
print("graph_title BTCGuild Hashrate")
|
||||
print("graph_args --upper-limit 3000 -l 0")
|
||||
print("graph_vlabel MHash/s")
|
||||
print("graph_category htc")
|
||||
for worker in workers:
|
||||
label = workers[worker]['worker_name']
|
||||
print label + ".label " + label
|
||||
print(label + ".label " + label)
|
||||
sys.exit(0)
|
||||
|
||||
for worker in workers:
|
||||
hash_rate = workers[worker]['hash_rate']
|
||||
label = workers[worker]['worker_name']
|
||||
print label + ".value %d" % int(hash_rate)
|
||||
hash_rate = workers[worker]['hash_rate']
|
||||
label = workers[worker]['worker_name']
|
||||
print(label + ".value %d" % int(hash_rate))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue