From c494741c09f03268d950b8da27952917518db446 Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Wed, 17 Nov 2010 03:52:54 +0100 Subject: Example of alias query handling. The request must be of the form : where xxx is the base64 encoding of the buddy's jabber id whom profile you are requesting. Also tried to make some files more pep8 compliant (coding style) --- user.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'user.py') diff --git a/user.py b/user.py index bb4e262..c1d8188 100644 --- a/user.py +++ b/user.py @@ -1,6 +1,8 @@ import os import os.path import shutil +import object +import hashlib class UserHandler : def __init__(self,root): @@ -10,6 +12,8 @@ class UserHandler : userDir = self.root+'/'+name if not os.path.exists(userDir) : os.mkdir(userDir) + handler = object.ObjectHandler(name) + handler.createHomeNode() def registered(self,name): return os.path.exists(self.root+'/'+name) @@ -18,4 +22,10 @@ class UserHandler : shutil.rmtree(self.root+'/'+name) def getUserList(self): - return os.listdir(self.root) \ No newline at end of file + return os.listdir(self.root) + +class User : + def __init__(self, name) : + self.name = name + self.rootObject = hashlib.sha1( name ).hexdigest() + \ No newline at end of file -- cgit v1.2.3-70-g09d2