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.sogomaint-2.0.2
parent
a6bf194813
commit
8f1307e13d
|
@ -6,10 +6,15 @@ import simplejson
|
|||
|
||||
import sogoLogin
|
||||
|
||||
SOGoSupportedLanguages = [ "Catalan", "Czech", "Welsh", "English", "SpanishSpain", "SpanishArgentina",
|
||||
"French", "German", "Icelandic", "Italian", "Hungarian", "Danish",
|
||||
"Dutch", "BrazilianPortuguese", "NorwegianBokmal",
|
||||
"NorwegianNynorsk", "Polish", "Russian", "Ukrainian", "Swedish" ]
|
||||
|
||||
|
||||
# must be kept in sync with SoObjects/SOGo/SOGoDefaults.plist
|
||||
# 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]
|
||||
|
||||
class HTTPPreferencesPOST (webdavlib.HTTPPOST):
|
||||
|
@ -44,22 +49,24 @@ class preferences:
|
|||
authCookie = sogoLogin.getAuthCookie(hostname, port, username, password)
|
||||
self.cookie = authCookie
|
||||
|
||||
# map between preferences/jsonDefaults and the webUI names
|
||||
# should probably be unified...
|
||||
self.preferencesMap = {
|
||||
"SOGoLanguage": "2.1.0.3.0.1.4.3.1.3.1.1.2",
|
||||
"SOGoSieveFilters": "sieveFilters",
|
||||
"SOGoLanguage": "language",
|
||||
"SOGoSieveFilters": "sieveFilters",
|
||||
|
||||
# Vacation stuff
|
||||
"Vacation": "enableVacation", # to disable, don't specify it
|
||||
"autoReplyText": "autoReplyText", # string
|
||||
"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
|
||||
|
||||
# forward stuff
|
||||
"Forward": "enableForward", # to disable, don't specify it
|
||||
"forwardAddress": "forwardAddress",
|
||||
"keepCopy": "forwardKeepCopy",
|
||||
}
|
||||
"Forward": "enableForward", # to disable, don't specify it
|
||||
"forwardAddress": "forwardAddress",
|
||||
"keepCopy": "forwardKeepCopy",
|
||||
}
|
||||
|
||||
def set(self, preference, value=None):
|
||||
# if preference is a dict, set all prefs found in the dict
|
||||
|
@ -102,5 +109,6 @@ class preferences:
|
|||
# Simple main to test this class
|
||||
if __name__ == "__main__":
|
||||
p = preferences ()
|
||||
print p.get ("SOGoLanguage")
|
||||
p.set ("SOGoLanguage", SOGoSupportedLanguages.index("French"))
|
||||
print p.get ("SOGoLanguage")
|
||||
|
|
|
@ -87,7 +87,7 @@ class sieveTest(unittest.TestCase):
|
|||
def testSieveVacationIgnoreLists(self):
|
||||
""" enable vacation script - ignore lists"""
|
||||
vacation_msg="vacation test - ignore list"
|
||||
daysSelect=4
|
||||
daysSelect=2
|
||||
|
||||
sieveScript = sieve_vacation_ignoreLists % { "mailaddr": self.user_email,
|
||||
"vacation_msg": vacation_msg,
|
||||
|
|
Loading…
Reference in New Issue