2
0
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:
Lars Kruse 2018-03-27 04:21:46 +02:00
parent 34840ad9db
commit e216f1be01

View File

@ -22,32 +22,25 @@ re_C = re.compile('Temperature:.*\((-?\d+\.?\d?) C\)')
re_DewC = re.compile('Dew.*\((-?\d+\.?\d?) C\)') re_DewC = re.compile('Dew.*\((-?\d+\.?\d?) C\)')
code = sys.argv[0][(sys.argv[0].rfind('_')+1):] 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": elif len(sys.argv) == 2 and sys.argv[1] == "config":
print('graph_title Temperature and Dew Point at code %s' % code)
print 'graph_title Temperature and Dew Point at code %s' % code print('graph_vlabel Temperature and Dew Point in C')
print 'graph_vlabel Temperature and Dew Point in C' print('graph_category sensors')
print 'graph_category sensors' print('temperature.label Temperature')
print('dewpoint.label Dew Point')
print 'temperature.label Temperature' print('graph_args --base 1000 -l 0')
print 'dewpoint.label Dew Point'
print 'graph_args --base 1000 -l 0'
else: else:
u = urllib.urlopen(url % code) u = urllib.urlopen(url % code)
txt = u.read() txt = u.read()
u.close() u.close()
C = re_C.findall(txt)[0] C = re_C.findall(txt)[0]
DewC = re_DewC.findall(txt)[0] DewC = re_DewC.findall(txt)[0]
print('temperature.value %s' % C)
print 'temperature.value %s' % C print('dewpoint.value %s' % DewC)
print 'dewpoint.value %s' % DewC