From e85fffabbb61ca964f35561e00c382a180166f64 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Wed, 4 May 2011 01:07:58 -0400 Subject: Registration should be fully functional now. this fixes #7 --- server/object.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'server/object.py') 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) -- cgit v1.2.3-70-g09d2