Monotone-Parent: 281488f5ccd9072f8845d50a816057f4a181d5b9

Monotone-Revision: 84c6073079fd585b26505ef43bd7c3cd478b2255

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-11-26T21:14:56
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2009-11-26 21:14:56 +00:00
parent e77aba5bd6
commit 0fdae36278
2 changed files with 4 additions and 6 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
setup
-----
(you need "python-xml", "python-vobject" and "python-m2crypto" in order to run
the scripts on Debian)
(you need "python-simplejson", "python-xml", "python-vobject" and "python-m2crypto"
in order to run the scripts on Debian)
1) copy config.py.in to config.py (make sure to never EVER add it to monotone)
2) edit config.py to suit your environment
+2 -4
View File
@@ -2,6 +2,7 @@ from config import hostname, port, username, password
import webdavlib
import urllib
import base64
import simplejson
class HTTPPreferencesPOST (webdavlib.HTTPPOST):
@@ -22,8 +23,6 @@ class HTTPPreferencesGET (webdavlib.HTTPGET):
headers["Cookie"] = self.cookie
return headers
class preferences:
login = username
passw = password
@@ -64,7 +63,7 @@ class preferences:
get = HTTPPreferencesGET (url)
get.cookie = self.cookie
self.client.execute (get)
content = eval (get.response['body'])
content = simplejson.loads(get.response['body'])
result = None
try:
result = content[preference]
@@ -72,7 +71,6 @@ class preferences:
pass
return result
# Simple main to test this class
if __name__ == "__main__":
p = preferences ()