move to python 3

This commit is contained in:
2019-12-16 12:04:13 -05:00
parent 1dde8df0a7
commit 5a095090a0
+5 -5
View File
@@ -1,12 +1,12 @@
#!/usr/bin/python
import sys
import httplib, urllib
import http.client, urllib.request, urllib.parse, urllib.error
def pushover(msg):
conn = httplib.HTTPSConnection("api.pushover.net:443")
conn = http.client.HTTPSConnection("api.pushover.net:443")
conn.request("POST", "/1/messages.json",
urllib.urlencode({
urllib.parse.urlencode({
"token": "ac7NLX2rPjXFareeDgLpXNoDf4iFmf",
"user": "uDhH33UjQQDYtNzJb1ThRiWb9ingGK",
"message": msg,
@@ -18,6 +18,6 @@ def pushover(msg):
v=" ".join(sys.argv[1:])
if pushover(v):
print "delivered"
print("delivered")
else:
print "NOT delivered"
print("NOT delivered")