mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Plugin: weather_temp_: fix style issues
This commit is contained in:
parent
34840ad9db
commit
e216f1be01
@ -22,32 +22,25 @@ re_C = re.compile('Temperature:.*\((-?\d+\.?\d?) C\)')
|
||||
re_DewC = re.compile('Dew.*\((-?\d+\.?\d?) C\)')
|
||||
|
||||
code = sys.argv[0][(sys.argv[0].rfind('_')+1):]
|
||||
if code == None: sys.exit(1)
|
||||
|
||||
if len(sys.argv) == 2 and sys.argv[1] == "autoconf":
|
||||
|
||||
print "yes"
|
||||
|
||||
if not code:
|
||||
sys.exit(1)
|
||||
elif len(sys.argv) == 2 and sys.argv[1] == "autoconf":
|
||||
print("yes")
|
||||
elif len(sys.argv) == 2 and sys.argv[1] == "config":
|
||||
|
||||
print 'graph_title Temperature and Dew Point at code %s' % code
|
||||
print 'graph_vlabel Temperature and Dew Point in C'
|
||||
print 'graph_category sensors'
|
||||
|
||||
print 'temperature.label Temperature'
|
||||
print 'dewpoint.label Dew Point'
|
||||
|
||||
print 'graph_args --base 1000 -l 0'
|
||||
|
||||
print('graph_title Temperature and Dew Point at code %s' % code)
|
||||
print('graph_vlabel Temperature and Dew Point in C')
|
||||
print('graph_category sensors')
|
||||
print('temperature.label Temperature')
|
||||
print('dewpoint.label Dew Point')
|
||||
print('graph_args --base 1000 -l 0')
|
||||
else:
|
||||
|
||||
u = urllib.urlopen(url % code)
|
||||
txt = u.read()
|
||||
u.close()
|
||||
|
||||
C = re_C.findall(txt)[0]
|
||||
DewC = re_DewC.findall(txt)[0]
|
||||
|
||||
print 'temperature.value %s' % C
|
||||
print 'dewpoint.value %s' % DewC
|
||||
|
||||
print('temperature.value %s' % C)
|
||||
print('dewpoint.value %s' % DewC)
|
||||
|
Loading…
Reference in New Issue
Block a user