Skip to content

Commit

Permalink
web: add changeMe/Presence skeletons
Browse files Browse the repository at this point in the history
  • Loading branch information
borisfaure committed Aug 28, 2010
1 parent 4333969 commit 9a04517
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion amsn2/ui/front_ends/web/bend.py
Expand Up @@ -52,7 +52,9 @@ def __init__(self, core):
(re.compile('/sendMsg$'), None, self.post_send_msg),
(re.compile('/closeCW$'), None, self.post_close_cw),
(re.compile('/logout$'), None, self.post_logout),
#TODO: set (nick,psm,status,dp), get (dp, dps),
(re.compile('/changeMe$'), None, self.post_changeme),
(re.compile('/changePresence$'), None, self.post_change_presence),
#TODO: set dp, get (dp, dps),
# add/remove group/contact
)

Expand Down Expand Up @@ -202,3 +204,25 @@ def post_logout(self, w, uri, headers, body = None):
w.close()
return
w._400()

def post_changeme(self, w, uri, headers, body = None):
if (body and 'content-type' in headers
and headers['content-type'].startswith('application/x-www-form-urlencoded')):
args = parse_qs(body)
print "<<< changeMe: %s" %(args,)
print "TODO"
w.write("HTTP/1.1 200 OK\r\n\r\n")
w.close()
return
w._400()

def post_change_presence(self, w, uri, headers, body = None):
if (body and 'content-type' in headers
and headers['content-type'].startswith('application/x-www-form-urlencoded')):
args = parse_qs(body)
print "<<< changePresence: %s" %(args,)
print "TODO"
w.write("HTTP/1.1 200 OK\r\n\r\n")
w.close()
return
w._400()

0 comments on commit 9a04517

Please sign in to comment.