1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

Plugins weather_*: specify regular expressions as raw strings

New versions of flake8 already complain about the non-raw nature of the
strings (respectively the improper escaping in the regular expression).
This commit is contained in:
Lars Kruse 2019-08-13 23:03:07 +02:00
parent e5abdeeb12
commit ebdbf1a92c
3 changed files with 6 additions and 6 deletions

View file

@ -7,9 +7,9 @@ import urllib
url = 'http://www.weather.com/weather/today/%s' url = 'http://www.weather.com/weather/today/%s'
re_tmp = re.compile('realTemp: "(\d+)"') re_tmp = re.compile(r'realTemp: "(\d+)"')
re_hum = re.compile('relativeHumidity: "(\d+)"') re_hum = re.compile(r'relativeHumidity: "(\d+)"')
re_loc = re.compile('locName: "([\w ]+)"') re_loc = re.compile(r'locName: "([\w ]+)"')
# code = sys.argv[0][(sys.argv[0].rfind('_') + 1):] # code = sys.argv[0][(sys.argv[0].rfind('_') + 1):]
code = os.environ.get('code', sys.argv[0][(sys.argv[0].rfind('_') + 1):]) code = os.environ.get('code', sys.argv[0][(sys.argv[0].rfind('_') + 1):])

View file

@ -18,7 +18,7 @@ import re
url = 'http://tgftp.nws.noaa.gov/data/observations/metar/decoded/%s.TXT' url = 'http://tgftp.nws.noaa.gov/data/observations/metar/decoded/%s.TXT'
re_hpa = re.compile('Pressure.*\((\d+) hPa\)') re_hpa = re.compile(r'Pressure.*\((\d+) hPa\)')
code = sys.argv[0][(sys.argv[0].rfind('_')+1):] code = sys.argv[0][(sys.argv[0].rfind('_')+1):]

View file

@ -18,8 +18,8 @@ import re
url = 'http://tgftp.nws.noaa.gov/data/observations/metar/decoded/%s.TXT' url = 'http://tgftp.nws.noaa.gov/data/observations/metar/decoded/%s.TXT'
re_C = re.compile('Temperature:.*\((-?\d+\.?\d?) C\)') re_C = re.compile(r'Temperature:.*\((-?\d+\.?\d?) C\)')
re_DewC = re.compile('Dew.*\((-?\d+\.?\d?) C\)') re_DewC = re.compile(r'Dew.*\((-?\d+\.?\d?) C\)')
code = sys.argv[0][(sys.argv[0].rfind('_')+1):] code = sys.argv[0][(sys.argv[0].rfind('_')+1):]