aboutsummaryrefslogtreecommitdiffstats
path: root/user.py
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2010-11-17 03:52:54 +0100
committerThibaut Horel <thibaut.horel@gmail.com>2010-11-17 03:52:54 +0100
commitc494741c09f03268d950b8da27952917518db446 (patch)
tree1fbbd798240db8b996fe9aa5b015930a7dd00b7c /user.py
parentb8106bd66fad5bafdec50da344e6a23f2dc78c00 (diff)
downloadalias-c494741c09f03268d950b8da27952917518db446.tar.gz
Example of alias query handling.
The request must be of the form : <iq to='xxx@object.alias.fr.nf'> <query xmlns='alias:query' type='items'/> </iq> 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)
Diffstat (limited to 'user.py')
-rw-r--r--user.py12
1 files changed, 11 insertions, 1 deletions
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