aboutsummaryrefslogtreecommitdiffstats
path: root/server/object.py
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2011-05-04 01:07:58 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2011-05-04 01:07:58 -0400
commite85fffabbb61ca964f35561e00c382a180166f64 (patch)
treeef6ced333ad2bac6c78567d9247fc07c249dfb03 /server/object.py
parent312583b52777046637c942f840ae77e9bd4175ad (diff)
downloadalias-e85fffabbb61ca964f35561e00c382a180166f64.tar.gz
Registration should be fully functional now.
this fixes #7
Diffstat (limited to 'server/object.py')
-rw-r--r--server/object.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/server/object.py b/server/object.py
index 91ec3c7..d3bdf87 100644
--- a/server/object.py
+++ b/server/object.py
@@ -90,9 +90,7 @@ class ObjectReader(Object):
k, v = line.split()
content[k] = v
- #return content, key
- return content
-
+ return content, key
class ObjectWriter(ObjectReader):
@@ -134,11 +132,15 @@ class ObjectWriter(ObjectReader):
for k, v in content.iteritems():
file.write('{} {}\n'.format(k,v))
#give all the permissions to the user
+ ALLPERM = READ + MODIFY + APPEND + LIST
with open(os.path.join(self.object_path, 'permissions'), "a") as file:
- file.write('{} 15 xxxxxx\n'.format(user,v))
+ file.write('{} {} xxxxxx\n'.format(user,ALLPERM))
if __name__ == '__main__':
- pass
+ jid = 'thrasibule@alias.im'
+ hash = hashlib.sha1(jid).hexdigest()
+ config.root = '/var/lib/alias'
+ print ObjectReader(hash).get_content(jid)