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/python #!/usr/bin/env python3
# Copyright (C) 2009 Andreas Thienemann <andreas@bawue.net> # Copyright (C) 2009 Andreas Thienemann <andreas@bawue.net>
# #

View File

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/env python3
# Copyright (C) 2009 Andreas Thienemann <andreas@bawue.net> # Copyright (C) 2009 Andreas Thienemann <andreas@bawue.net>
# #

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2010 Christoph Heer (Christoph.Heer@googlemail.com) # Copyright (c) 2010 Christoph Heer (Christoph.Heer@googlemail.com)
# #
# Permission is hereby granted, free of charge, to any person obtaining a # Permission is hereby granted, free of charge, to any person obtaining a

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 # vim: set fileencoding=utf-8
# #
# Munin plugin to show number of documents in Sphinx index # Munin plugin to show number of documents in Sphinx index

View File

@ -1,5 +1,4 @@
#!/usr/bin/python #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Johann Schmitz <johann@j-schmitz.net> # Copyright (C) 2014 Johann Schmitz <johann@j-schmitz.net>
# #

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
""" """
munin US NOAA weather plugin (http://tgftp.nws.noaa.gov) 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 sys
import urllib from urllib.request import urlopen
import re 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'
@ -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_args --base 1000 -l 850 -u 1050 --rigid')
print('graph_scale no') print('graph_scale no')
else: else:
u = urllib.urlopen(url % code) u = urlopen(url % code)
txt = u.read() txt = u.read()
u.close() 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) 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 sys
import urllib from urllib.request import urlopen
import re 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'
@ -36,7 +36,7 @@ elif len(sys.argv) == 2 and sys.argv[1] == "config":
print('dewpoint.label Dew Point') print('dewpoint.label Dew Point')
print('graph_args --base 1000 -l 0') print('graph_args --base 1000 -l 0')
else: else:
u = urllib.urlopen(url % code) u = urlopen(url % code)
txt = u.read() txt = u.read()
u.close() u.close()