-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathme.py
More file actions
32 lines (24 loc) · 669 Bytes
/
Copy pathme.py
File metadata and controls
32 lines (24 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import json, HTMLParser, sys, utils
def commands():
commands = ['details','personId']
return commands
def details():
urlString = "me/"
return urlString
def personId():
urlString = details()
jsonObject = utils.startConnection(urlString)
return jsonObject['personid']
def takeCare():
try:
requestedCommand = sys.argv[2]
except Exception:
requestedCommand = raw_input("Command ?\n")
if requestedCommand == "details":
urlString = details()
elif requestedCommand == "current":
urlString = current()
else:
print "Invalid command"
sys.exit(1)
return urlString