update the languages and the preference map to match the new properties names
Don't use the default daysBetweenResponse for the vacation ignore list test Monotone-Parent: 9631e91f39d72591553f51f05b43536b1438e553 Monotone-Revision: 8c3a2531198e8b97572bbc89525885693d00a39b Monotone-Author: jraby@inverse.ca Monotone-Date: 2012-02-15T20:27:00 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
a6bf194813
commit
8f1307e13d
|
@ -6,10 +6,15 @@ import simplejson
|
||||||
|
|
||||||
import sogoLogin
|
import sogoLogin
|
||||||
|
|
||||||
SOGoSupportedLanguages = [ "Catalan", "Czech", "Welsh", "English", "SpanishSpain", "SpanishArgentina",
|
|
||||||
"French", "German", "Icelandic", "Italian", "Hungarian", "Danish",
|
|
||||||
"Dutch", "BrazilianPortuguese", "NorwegianBokmal",
|
# must be kept in sync with SoObjects/SOGo/SOGoDefaults.plist
|
||||||
"NorwegianNynorsk", "Polish", "Russian", "Ukrainian", "Swedish" ]
|
# this should probably be fetched magically...
|
||||||
|
SOGoSupportedLanguages = [ "Catalan", "Czech", "Dutch", "Danish", "Welsh", "English",
|
||||||
|
"SpanishSpain", "SpanishArgentina", "French", "German",
|
||||||
|
"Icelandic", "Italian", "Hungarian", "BrazilianPortuguese",
|
||||||
|
"NorwegianBokmal", "NorwegianNynorsk", "Polish", "Russian",
|
||||||
|
"Ukrainian", "Swedish" ];
|
||||||
daysBetweenResponseList=[1,2,3,5,7,14,21,30]
|
daysBetweenResponseList=[1,2,3,5,7,14,21,30]
|
||||||
|
|
||||||
class HTTPPreferencesPOST (webdavlib.HTTPPOST):
|
class HTTPPreferencesPOST (webdavlib.HTTPPOST):
|
||||||
|
@ -44,22 +49,24 @@ class preferences:
|
||||||
authCookie = sogoLogin.getAuthCookie(hostname, port, username, password)
|
authCookie = sogoLogin.getAuthCookie(hostname, port, username, password)
|
||||||
self.cookie = authCookie
|
self.cookie = authCookie
|
||||||
|
|
||||||
|
# map between preferences/jsonDefaults and the webUI names
|
||||||
|
# should probably be unified...
|
||||||
self.preferencesMap = {
|
self.preferencesMap = {
|
||||||
"SOGoLanguage": "2.1.0.3.0.1.4.3.1.3.1.1.2",
|
"SOGoLanguage": "language",
|
||||||
"SOGoSieveFilters": "sieveFilters",
|
"SOGoSieveFilters": "sieveFilters",
|
||||||
|
|
||||||
# Vacation stuff
|
# Vacation stuff
|
||||||
"Vacation": "enableVacation", # to disable, don't specify it
|
"Vacation": "enableVacation", # to disable, don't specify it
|
||||||
"autoReplyText": "autoReplyText", # string
|
"autoReplyText": "autoReplyText", # string
|
||||||
"autoReplyEmailAddresses": "autoReplyEmailAddresses", # LIST
|
"autoReplyEmailAddresses": "autoReplyEmailAddresses", # LIST
|
||||||
"daysBetweenResponse": "2.1.0.3.0.1.4.3.1.3.7.1.5.1.1.3.7.2", # see daysBetweenResponseList
|
"daysBetweenResponse": "daysBetweenResponsesList",
|
||||||
"ignoreLists": "ignoreLists", #bool
|
"ignoreLists": "ignoreLists", #bool
|
||||||
|
|
||||||
# forward stuff
|
# forward stuff
|
||||||
"Forward": "enableForward", # to disable, don't specify it
|
"Forward": "enableForward", # to disable, don't specify it
|
||||||
"forwardAddress": "forwardAddress",
|
"forwardAddress": "forwardAddress",
|
||||||
"keepCopy": "forwardKeepCopy",
|
"keepCopy": "forwardKeepCopy",
|
||||||
}
|
}
|
||||||
|
|
||||||
def set(self, preference, value=None):
|
def set(self, preference, value=None):
|
||||||
# if preference is a dict, set all prefs found in the dict
|
# if preference is a dict, set all prefs found in the dict
|
||||||
|
@ -102,5 +109,6 @@ class preferences:
|
||||||
# Simple main to test this class
|
# Simple main to test this class
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
p = preferences ()
|
p = preferences ()
|
||||||
|
print p.get ("SOGoLanguage")
|
||||||
p.set ("SOGoLanguage", SOGoSupportedLanguages.index("French"))
|
p.set ("SOGoLanguage", SOGoSupportedLanguages.index("French"))
|
||||||
print p.get ("SOGoLanguage")
|
print p.get ("SOGoLanguage")
|
||||||
|
|
|
@ -87,7 +87,7 @@ class sieveTest(unittest.TestCase):
|
||||||
def testSieveVacationIgnoreLists(self):
|
def testSieveVacationIgnoreLists(self):
|
||||||
""" enable vacation script - ignore lists"""
|
""" enable vacation script - ignore lists"""
|
||||||
vacation_msg="vacation test - ignore list"
|
vacation_msg="vacation test - ignore list"
|
||||||
daysSelect=4
|
daysSelect=2
|
||||||
|
|
||||||
sieveScript = sieve_vacation_ignoreLists % { "mailaddr": self.user_email,
|
sieveScript = sieve_vacation_ignoreLists % { "mailaddr": self.user_email,
|
||||||
"vacation_msg": vacation_msg,
|
"vacation_msg": vacation_msg,
|
||||||
|
|
Loading…
Reference in a new issue