feat(py): added sms feature
This commit is contained in:
parent
3803a5e27d
commit
8899cd33bb
|
@ -99,6 +99,9 @@ while not (command == "quit" or command == "exit" or command == "q"):
|
||||||
elif command[0:5] == "grep ":
|
elif command[0:5] == "grep ":
|
||||||
action = "grep"
|
action = "grep"
|
||||||
command = command[5:]
|
command = command[5:]
|
||||||
|
elif command[0:4] == "sms ":
|
||||||
|
action = "sms"
|
||||||
|
command = command[4:]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
index = int(command)
|
index = int(command)
|
||||||
|
@ -116,6 +119,9 @@ while not (command == "quit" or command == "exit" or command == "q"):
|
||||||
if newname:
|
if newname:
|
||||||
note["title"] = newname
|
note["title"] = newname
|
||||||
savedata()
|
savedata()
|
||||||
|
elif action == "sms":
|
||||||
|
if note and ask("send '" + note["title"] + "' by sms? "):
|
||||||
|
subprocess.call(["curl", "-s", "-X", "POST", "-F", "action=sms", "-F", "password=" + settings["password"], "-F", "data=" + urllib.parse.quote_plus(note["content"]), settings["url"] + "/handler.php"])
|
||||||
elif note and not action == "grep":
|
elif note and not action == "grep":
|
||||||
editnote(note)
|
editnote(note)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue