move to python 3
This commit is contained in:
+5
-5
@@ -1,12 +1,12 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import httplib, urllib
|
import http.client, urllib.request, urllib.parse, urllib.error
|
||||||
|
|
||||||
def pushover(msg):
|
def pushover(msg):
|
||||||
conn = httplib.HTTPSConnection("api.pushover.net:443")
|
conn = http.client.HTTPSConnection("api.pushover.net:443")
|
||||||
conn.request("POST", "/1/messages.json",
|
conn.request("POST", "/1/messages.json",
|
||||||
urllib.urlencode({
|
urllib.parse.urlencode({
|
||||||
"token": "ac7NLX2rPjXFareeDgLpXNoDf4iFmf",
|
"token": "ac7NLX2rPjXFareeDgLpXNoDf4iFmf",
|
||||||
"user": "uDhH33UjQQDYtNzJb1ThRiWb9ingGK",
|
"user": "uDhH33UjQQDYtNzJb1ThRiWb9ingGK",
|
||||||
"message": msg,
|
"message": msg,
|
||||||
@@ -18,6 +18,6 @@ def pushover(msg):
|
|||||||
|
|
||||||
v=" ".join(sys.argv[1:])
|
v=" ".join(sys.argv[1:])
|
||||||
if pushover(v):
|
if pushover(v):
|
||||||
print "delivered"
|
print("delivered")
|
||||||
else:
|
else:
|
||||||
print "NOT delivered"
|
print("NOT delivered")
|
||||||
|
|||||||
Reference in New Issue
Block a user