1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-24 18:07:20 +00:00

Port some python2 plugins to python3

This commit is contained in:
Lars Kruse 2019-12-18 00:27:02 +01:00
parent 7063330e03
commit 86bee01637
7 changed files with 11 additions and 14 deletions

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""
munin US NOAA weather plugin (http://tgftp.nws.noaa.gov)
@ -13,7 +13,7 @@ Linux users might need to adjust the shebang.
"""
import sys
import urllib
from urllib.request import urlopen
import re
url = 'http://tgftp.nws.noaa.gov/data/observations/metar/decoded/%s.TXT'
@ -36,7 +36,7 @@ elif len(sys.argv) == 2 and sys.argv[1] == "config":
print('graph_args --base 1000 -l 850 -u 1050 --rigid')
print('graph_scale no')
else:
u = urllib.urlopen(url % code)
u = urlopen(url % code)
txt = u.read()
u.close()

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""
munin US NOAA weather plugin (http://tgftp.nws.noaa.gov)
@ -13,7 +13,7 @@ Linux users might need to adjust the shebang.
"""
import sys
import urllib
from urllib.request import urlopen
import re
url = 'http://tgftp.nws.noaa.gov/data/observations/metar/decoded/%s.TXT'
@ -36,7 +36,7 @@ elif len(sys.argv) == 2 and sys.argv[1] == "config":
print('dewpoint.label Dew Point')
print('graph_args --base 1000 -l 0')
else:
u = urllib.urlopen(url % code)
u = urlopen(url % code)
txt = u.read()
u.close()