aboutsummaryrefslogtreecommitdiffstats
path: root/user.py
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2010-11-10 02:03:04 +0100
committerThibaut Horel <thibaut.horel@gmail.com>2010-11-10 02:03:04 +0100
commit1081ae523c47a94bcb1f7c53901114710949d188 (patch)
tree68c95827de25310364ee2600ebcb5eecc31a08e5 /user.py
parent4c2ce53c512d2de70b050146ba1e8c509de8bb26 (diff)
downloadalias-1081ae523c47a94bcb1f7c53901114710949d188.tar.gz
Make user class a userhandler class (relative to a user root directory)
Add proper user registration to server component
Diffstat (limited to 'user.py')
-rw-r--r--user.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/user.py b/user.py
index 184a880..1cf0ec8 100644
--- a/user.py
+++ b/user.py
@@ -1,14 +1,16 @@
import os
import os.path
-class User :
- def __init__(self,jid):
- self.jid = jid
+class UserHandler :
+ def __init__(self,root):
+ self.root = root
- @staticmethod
- def createDirectory(jid):
- os.mkdir(jid)
-
- @staticmethod
- def subscribed(name):
- return os.path.exists(name) \ No newline at end of file
+ def register(self,name):
+ if not os.path.exists(name) :
+ os.mkdir(self.root+'/'+name)
+
+ def registered(self,name):
+ return os.path.exists(self.root+'/'+name)
+
+ def getUserList(self):
+ return os.listdir(self.root) \ No newline at end of file