Skip to content
Permalink
Browse files

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).
  • Loading branch information...
sumpfralle committed Aug 13, 2019
1 parent e5abdee commit ebdbf1a92c5079d393754199044c60a88d576d31
Showing with 6 additions and 6 deletions.
  1. +3 −3 plugins/weather/weather_
  2. +1 −1 plugins/weather/weather_press_
  3. +2 −2 plugins/weather/weather_temp_
@@ -7,9 +7,9 @@ import urllib

url = 'http://www.weather.com/weather/today/%s'

re_tmp = re.compile('realTemp: "(\d+)"')
re_hum = re.compile('relativeHumidity: "(\d+)"')
re_loc = re.compile('locName: "([\w ]+)"')
re_tmp = re.compile(r'realTemp: "(\d+)"')
re_hum = re.compile(r'relativeHumidity: "(\d+)"')
re_loc = re.compile(r'locName: "([\w ]+)"')

# code = sys.argv[0][(sys.argv[0].rfind('_') + 1):]
code = os.environ.get('code', sys.argv[0][(sys.argv[0].rfind('_') + 1):])
@@ -18,7 +18,7 @@ import re

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):]
@@ -18,8 +18,8 @@ import re

url = 'http://tgftp.nws.noaa.gov/data/observations/metar/decoded/%s.TXT'

re_C = re.compile('Temperature:.*\((-?\d+\.?\d?) C\)')
re_DewC = re.compile('Dew.*\((-?\d+\.?\d?) C\)')
re_C = re.compile(r'Temperature:.*\((-?\d+\.?\d?) C\)')
re_DewC = re.compile(r'Dew.*\((-?\d+\.?\d?) C\)')

code = sys.argv[0][(sys.argv[0].rfind('_')+1):]

0 comments on commit ebdbf1a

Please sign in to comment.
You can’t perform that action at this time.