[CalendarServer-changes] [3369] CalendarServer/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Tue Nov 11 13:38:43 PST 2008
Revision: 3369
http://trac.macosforge.org/projects/calendarserver/changeset/3369
Author: wsanchez at apple.com
Date: 2008-11-11 13:38:42 -0800 (Tue, 11 Nov 2008)
Log Message:
-----------
Use newly available config dotted notation.
Modified Paths:
--------------
CalendarServer/trunk/calendarserver/tools/export.py
CalendarServer/trunk/twistedcaldav/cluster.py
CalendarServer/trunk/twistedcaldav/directory/calendar.py
CalendarServer/trunk/twistedcaldav/directory/wiki.py
CalendarServer/trunk/twistedcaldav/freebusyurl.py
CalendarServer/trunk/twistedcaldav/localization.py
CalendarServer/trunk/twistedcaldav/mail.py
CalendarServer/trunk/twistedcaldav/method/put_common.py
CalendarServer/trunk/twistedcaldav/notify.py
CalendarServer/trunk/twistedcaldav/resource.py
CalendarServer/trunk/twistedcaldav/root.py
CalendarServer/trunk/twistedcaldav/schedule.py
CalendarServer/trunk/twistedcaldav/scheduling/itip.py
CalendarServer/trunk/twistedcaldav/scheduling/scheduler.py
CalendarServer/trunk/twistedcaldav/static.py
CalendarServer/trunk/twistedcaldav/tap.py
CalendarServer/trunk/twistedcaldav/test/test_config.py
CalendarServer/trunk/twistedcaldav/test/test_options.py
Modified: CalendarServer/trunk/calendarserver/tools/export.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/export.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/calendarserver/tools/export.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -247,7 +247,7 @@
def getDirectory(config):
global _directory
if _directory is None:
- BaseDirectoryService = namedClass(config.DirectoryService["type"])
+ BaseDirectoryService = namedClass(config.DirectoryService.type)
class MyDirectoryService (BaseDirectoryService):
def principalCollection(self):
@@ -272,7 +272,7 @@
return principal.calendarHome()
return None
- _directory = MyDirectoryService(**config.DirectoryService["params"])
+ _directory = MyDirectoryService(**config.DirectoryService.params)
return _directory
Modified: CalendarServer/trunk/twistedcaldav/cluster.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/cluster.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/cluster.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -85,15 +85,15 @@
if config.GroupName:
args.extend(("-g", config.GroupName))
- if config.Profiling["Enabled"]:
+ if config.Profiling.Enabled:
args.append(
"--profile=%s/%s.pstats"
- % (config.Profiling["BaseDirectory"], self.getName())
+ % (config.Profiling.BaseDirectory, self.getName())
)
args.extend(("--savestats", "--nothotshot"))
args.extend([
- "--reactor=%s" % (config.Twisted["reactor"],),
+ "--reactor=%s" % (config.Twisted.reactor,),
"-n", self.tapname,
"-f", self.configFile,
"-o", "ProcessType=Slave",
@@ -101,10 +101,10 @@
"-o", "PIDFile=None",
"-o", "ErrorLogFile=None",
"-o", "MultiProcess/ProcessCount=%d"
- % (config.MultiProcess["ProcessCount"],)
+ % (config.MultiProcess.ProcessCount,)
])
- if config.Memcached["ServerEnabled"]:
+ if config.Memcached.ServerEnabled:
args.extend(["-o", "Memcached/ClientEnabled=True"])
if self.ports:
@@ -147,8 +147,8 @@
delay = 0
- if config.MultiProcess["StaggeredStartup"]["Enabled"]:
- delay_interval = config.MultiProcess["StaggeredStartup"]["Interval"]
+ if config.MultiProcess.StaggeredStartup.Enabled:
+ delay_interval = config.MultiProcess.StaggeredStartup.Interval
else:
delay_interval = 0
@@ -219,7 +219,7 @@
#
# Attempt to calculate the number of processes to use 1 per processor
#
- if config.MultiProcess["ProcessCount"] == 0:
+ if config.MultiProcess.ProcessCount == 0:
try:
cpuCount = getNCPU()
except NotImplementedError, e:
@@ -240,16 +240,16 @@
log.err("Assuming one CPU, configuring one process.")
cpuCount = 1
- config.MultiProcess["ProcessCount"] = cpuCount
+ config.MultiProcess.ProcessCount = cpuCount
- if config.MultiProcess["ProcessCount"] > 1:
+ if config.MultiProcess.ProcessCount > 1:
if config.BindHTTPPorts:
port = [list(reversed(config.BindHTTPPorts))[0]]
if config.BindSSLPorts:
sslPort = [list(reversed(config.BindSSLPorts))[0]]
- elif config.MultiProcess["ProcessCount"] == 1:
+ elif config.MultiProcess.ProcessCount == 1:
if config.BindHTTPPorts:
port = config.BindHTTPPorts
@@ -266,13 +266,13 @@
# We listen directly on the interfaces.
if (
- not config.MultiProcess["LoadBalancer"]["Enabled"] or
- config.MultiProcess["ProcessCount"] == 1
+ not config.MultiProcess.LoadBalancer.Enabled or
+ config.MultiProcess.ProcessCount == 1
):
bindAddress = config.BindAddresses
- for p in xrange(0, config.MultiProcess["ProcessCount"]):
- if config.MultiProcess["ProcessCount"] > 1:
+ for p in xrange(0, config.MultiProcess.ProcessCount):
+ if config.MultiProcess.ProcessCount > 1:
if port is not None:
port = [port[0] + 1]
@@ -280,7 +280,7 @@
sslPort = [sslPort[0] + 1]
process = TwistdSlaveProcess(
- config.Twisted["twistd"],
+ config.Twisted.twistd,
self.tapname,
options["config"],
bindAddress,
@@ -303,8 +303,8 @@
#
# Set up pydirector config file.
#
- if (config.MultiProcess["LoadBalancer"]["Enabled"] and
- config.MultiProcess["ProcessCount"] > 1):
+ if (config.MultiProcess.LoadBalancer.Enabled and
+ config.MultiProcess.ProcessCount > 1):
services = []
if not config.BindAddresses:
@@ -342,7 +342,7 @@
}
)
- scheduler = config.MultiProcess["LoadBalancer"]["Scheduler"]
+ scheduler = config.MultiProcess.LoadBalancer.Scheduler
if httpPorts:
services.append(
@@ -368,7 +368,7 @@
pdconfig = configTemplate % {
"services": "\n".join(services),
- "controlSocket": config.PythonDirector["ControlSocket"],
+ "controlSocket": config.PythonDirector.ControlSocket,
}
fd, fname = tempfile.mkstemp(prefix="pydir")
@@ -379,52 +379,52 @@
monitor.addProcess(
"pydir",
- [sys.executable, config.PythonDirector["pydir"], fname],
+ [sys.executable, config.PythonDirector.pydir, fname],
env=parentEnv,
)
- if config.Memcached["ServerEnabled"]:
+ if config.Memcached.ServerEnabled:
log.msg("Adding memcached service")
memcachedArgv = [
- config.Memcached["memcached"],
- "-p", str(config.Memcached["Port"]),
- "-l", config.Memcached["BindAddress"],
+ config.Memcached.memcached,
+ "-p", str(config.Memcached.Port),
+ "-l", config.Memcached.BindAddress,
]
- if config.Memcached["MaxMemory"] is not 0:
- memcachedArgv.extend(["-m", str(config.Memcached["MaxMemory"])])
+ if config.Memcached.MaxMemory is not 0:
+ memcachedArgv.extend(["-m", str(config.Memcached.MaxMemory)])
if config.UserName:
memcachedArgv.extend(["-u", config.UserName])
- memcachedArgv.extend(config.Memcached["Options"])
+ memcachedArgv.extend(config.Memcached.Options)
monitor.addProcess("memcached", memcachedArgv, env=parentEnv)
if (
- config.Notifications["Enabled"] and
- config.Notifications["InternalNotificationHost"] == "localhost"
+ config.Notifications.Enabled and
+ config.Notifications.InternalNotificationHost == "localhost"
):
log.msg("Adding notification service")
notificationsArgv = [
sys.executable,
- config.Twisted["twistd"],
+ config.Twisted.twistd,
"-n", "caldav_notifier",
"-f", options["config"],
]
monitor.addProcess("notifications", notificationsArgv, env=parentEnv)
if (
- config.Scheduling["iMIP"]["Enabled"] and
- config.Scheduling["iMIP"]["MailGatewayServer"] == "localhost"
+ config.Scheduling.iMIP.Enabled and
+ config.Scheduling.iMIP.MailGatewayServer == "localhost"
):
log.msg("Adding mail gateway service")
mailGatewayArgv = [
sys.executable,
- config.Twisted["twistd"],
+ config.Twisted.twistd,
"-n", "caldav_mailgateway",
"-f", options["config"],
]
@@ -447,14 +447,14 @@
parentEnv = {"PYTHONPATH": os.environ.get("PYTHONPATH", "")}
log.msg("Adding pydirector service with configuration: %s"
- % (config.PythonDirector["ConfigFile"],))
+ % (config.PythonDirector.ConfigFile,))
service.addProcess(
"pydir",
[
sys.executable,
- config.PythonDirector["pydir"],
- config.PythonDirector["ConfigFile"]
+ config.PythonDirector.pydir,
+ config.PythonDirector.ConfigFile
],
env=parentEnv
)
Modified: CalendarServer/trunk/twistedcaldav/directory/calendar.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/calendar.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/directory/calendar.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -273,7 +273,7 @@
childlist += (
("dropbox", DropBoxHomeResource),
)
- if config.FreeBusyURL["Enabled"]:
+ if config.FreeBusyURL.Enabled:
childlist += (
("freebusy", FreeBusyURLResource),
)
@@ -303,7 +303,7 @@
inbox.processFreeBusyCalendar(childURL, True)
# Default calendar may need to be marked as the default for scheduling
- if config.Scheduling["CalDAV"]["DefaultCalendarProvisioned"]:
+ if config.Scheduling.CalDAV.DefaultCalendarProvisioned:
inbox.writeDeadProperty(caldavxml.ScheduleDefaultCalendarURL(davxml.HRef(childURL)))
return self
Modified: CalendarServer/trunk/twistedcaldav/directory/wiki.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/wiki.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/directory/wiki.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -148,7 +148,7 @@
if hasattr(request, 'wikiACL'):
returnValue(request.wikiACL)
- wikiConfig = config.Authentication["Wiki"]
+ wikiConfig = config.Authentication.Wiki
userID = "unauthenticated"
wikiID = resource.record.shortName
Modified: CalendarServer/trunk/twistedcaldav/freebusyurl.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/freebusyurl.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/freebusyurl.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -71,7 +71,7 @@
davxml.Privilege(davxml.Read()),
davxml.Privilege(caldavxml.ScheduleDeliver()),
)
- if config.Scheduling["CalDAV"]["OldDraftCompatibility"]:
+ if config.Scheduling.CalDAV.OldDraftCompatibility:
privs += (davxml.Privilege(caldavxml.Schedule()),)
aces = (
@@ -82,7 +82,7 @@
davxml.Protected(),
),
)
- if config.FreeBusyURL["AnonymousAccess"]:
+ if config.FreeBusyURL.AnonymousAccess:
aces += (
# DAV:Read, for unauthenticated principals
davxml.ACE(
@@ -190,7 +190,7 @@
if self.duration:
self.end = self.start + self.duration
if self.end is None:
- self.end = self.start + datetime.timedelta(days=config.FreeBusyURL["TimePeriod"])
+ self.end = self.start + datetime.timedelta(days=config.FreeBusyURL.TimePeriod)
# End > start
if self.end <= self.start:
Modified: CalendarServer/trunk/twistedcaldav/localization.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/localization.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/localization.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -98,7 +98,7 @@
def __init__(self, lang, domain='calendarserver', localeDir=None):
if localeDir is None:
- localeDir = config.Localization["LocalesDirectory"]
+ localeDir = config.Localization.LocalesDirectory
# Cache gettext translation objects in class.translations
key = (lang, domain, localeDir)
Modified: CalendarServer/trunk/twistedcaldav/mail.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/mail.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/mail.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -176,7 +176,7 @@
davxml.Privilege(davxml.Read()),
davxml.Privilege(caldavxml.ScheduleDeliver()),
)
- if config.Scheduling["CalDAV"]["OldDraftCompatibility"]:
+ if config.Scheduling.CalDAV.OldDraftCompatibility:
privs += (davxml.Privilege(caldavxml.Schedule()),)
return davxml.ACL(
# DAV:Read, CalDAV:schedule-deliver for all principals (includes anonymous)
@@ -503,7 +503,7 @@
# Compute token, add to db, generate email and send it
calendar = ical.Component.fromString(request.content.read())
headers = request.getAllHeaders()
- language = config.Localization["Language"]
+ language = config.Localization.Language
self.mailer.outbound(headers['originator'], headers['recipient'],
calendar, language=language)
@@ -777,7 +777,7 @@
details = self.getEventDetails(calendar, language=language)
- iconDir = config.Scheduling["iMIP"]["MailIconsDirectory"].rstrip("/")
+ iconDir = config.Scheduling.iMIP.MailIconsDirectory.rstrip("/")
iconName = "cal-icon-%02d-%02d.png" % (details['month'],
details['day'])
iconPath = os.path.join(iconDir, language, iconName)
@@ -888,7 +888,7 @@
details['iconName'] = iconName
- templateDir = config.Scheduling["iMIP"]["MailTemplatesDirectory"].rstrip("/")
+ templateDir = config.Scheduling.iMIP.MailTemplatesDirectory.rstrip("/")
templateName = "cancel.html" if canceled else "invite.html"
templatePath = os.path.join(templateDir, templateName)
Modified: CalendarServer/trunk/twistedcaldav/method/put_common.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/method/put_common.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/method/put_common.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -392,7 +392,7 @@
raise HTTPError(responsecode.PRECONDITION_FAILED)
self.schedule_tag_match = True
- elif config.Scheduling["CalDAV"]["ScheduleTagCompatibility"]:
+ elif config.Scheduling.CalDAV.ScheduleTagCompatibility:
# Compatibility with old clients. Policy:
#
# 1. If If-Match header is not present, never do smart merge.
@@ -623,7 +623,7 @@
# NB Do this before implicit scheduling as we don't want old clients to trigger scheduling when
# the X- property is missing.
new_has_private_comments = False
- if config.Scheduling["CalDAV"].get("EnablePrivateComments", True) and self.calendar is not None:
+ if config.Scheduling.CalDAV.get("EnablePrivateComments", True) and self.calendar is not None:
old_has_private_comments = self.destination.exists() and self.destinationcal and self.destination.hasDeadProperty(TwistedCalendarHasPrivateCommentsProperty)
new_has_private_comments = self.calendar.hasPropertyInAnyComponent((
"X-CALENDARSERVER-PRIVATE-COMMENT",
@@ -946,7 +946,7 @@
response.headers.setHeader("Schedule-Tag", self.scheduletag)
# Handle weak etag compatibility
- if config.Scheduling["CalDAV"]["ScheduleTagCompatibility"]:
+ if config.Scheduling.CalDAV.ScheduleTagCompatibility:
if change_scheduletag:
# Schedule-Tag change => weak ETag behavior must not happen
etags = ()
@@ -967,7 +967,7 @@
self.destination.removeDeadProperty(TwistedScheduleMatchETags)
# Check for existence of private comments and write property
- if config.Scheduling["CalDAV"].get("EnablePrivateComments", True):
+ if config.Scheduling.CalDAV.get("EnablePrivateComments", True):
if new_has_private_comments:
self.destination.writeDeadProperty(TwistedCalendarHasPrivateCommentsProperty())
elif not self.destinationcal:
Modified: CalendarServer/trunk/twistedcaldav/notify.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/notify.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/notify.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -107,7 +107,7 @@
def notify(self, op="update"):
url = self._resource.url()
- if self.config.Notifications["Enabled"]:
+ if self.config.Notifications.Enabled:
if self._notify:
self.log_debug("Notifications are enabled: %s %s" % (op, url))
return getNotificationClient().send(op, url)
@@ -1151,7 +1151,7 @@
results = { 'enabled' : False }
# return the first enabled xmpp service settings in the config file
- for key, settings in config.Notifications["Services"].iteritems():
+ for key, settings in config.Notifications.Services.iteritems():
if (settings["Service"] == "twistedcaldav.notify.XMPPNotifierService"
and settings["Enabled"]):
results['enabled'] = True
@@ -1280,27 +1280,27 @@
#
# Configure Memcached Client Pool
#
- if config.Memcached["ClientEnabled"]:
+ if config.Memcached.ClientEnabled:
memcachepool.installPool(
IPv4Address(
'TCP',
- config.Memcached["BindAddress"],
- config.Memcached["Port"]),
- config.Memcached["MaxClients"])
+ config.Memcached.BindAddress,
+ config.Memcached.Port),
+ config.Memcached.MaxClients)
multiService = service.MultiService()
notifiers = []
- for key, settings in config.Notifications["Services"].iteritems():
+ for key, settings in config.Notifications.Services.iteritems():
if settings["Enabled"]:
notifier = namedClass(settings["Service"])(settings)
notifier.setServiceParent(multiService)
notifiers.append(notifier)
internet.TCPServer(
- config.Notifications["InternalNotificationPort"],
+ config.Notifications.InternalNotificationPort,
InternalNotificationFactory(notifiers,
- delaySeconds=config.Notifications["CoalesceSeconds"])
+ delaySeconds=config.Notifications.CoalesceSeconds)
).setServiceParent(multiService)
return multiService
Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/resource.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -70,7 +70,7 @@
class CalDAVComplianceMixIn(object):
def davComplianceClasses(self):
- if config.Scheduling["CalDAV"]["OldDraftCompatibility"]:
+ if config.Scheduling.CalDAV.OldDraftCompatibility:
extra_compliance = caldavxml.caldav_full_compliance
else:
extra_compliance = caldavxml.caldav_implicit_compliance
@@ -78,7 +78,7 @@
extra_compliance += customxml.calendarserver_proxy_compliance
if config.EnablePrivateEvents:
extra_compliance += customxml.calendarserver_private_events_compliance
- if config.Scheduling["CalDAV"].get("EnablePrivateComments", True):
+ if config.Scheduling.CalDAV.get("EnablePrivateComments", True):
extra_compliance += customxml.calendarserver_private_comments_compliance
extra_compliance += customxml.calendarserver_principal_property_search
return tuple(super(CalDAVComplianceMixIn, self).davComplianceClasses()) + extra_compliance
Modified: CalendarServer/trunk/twistedcaldav/root.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/root.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/root.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -191,7 +191,7 @@
"Your sessionID was rejected by the authenticating wiki server."
))
- wikiConfig = config.Authentication["Wiki"]
+ wikiConfig = config.Authentication.Wiki
cookies = request.headers.getHeader('cookie')
if wikiConfig["Enabled"] and cookies is not None:
for cookie in cookies:
Modified: CalendarServer/trunk/twistedcaldav/schedule.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/schedule.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/schedule.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -96,7 +96,7 @@
privs = (
davxml.Privilege(caldavxml.ScheduleDeliver()),
)
- if config.Scheduling["CalDAV"]["OldDraftCompatibility"]:
+ if config.Scheduling.CalDAV.OldDraftCompatibility:
privs += (davxml.Privilege(caldavxml.Schedule()),)
return davxml.ACL(
@@ -203,7 +203,7 @@
privs = (
davxml.Privilege(caldavxml.ScheduleSend()),
)
- if config.Scheduling["CalDAV"]["OldDraftCompatibility"]:
+ if config.Scheduling.CalDAV.OldDraftCompatibility:
privs += (davxml.Privilege(caldavxml.Schedule()),)
return davxml.ACL(
@@ -262,7 +262,7 @@
davxml.Privilege(davxml.Read()),
davxml.Privilege(caldavxml.ScheduleDeliver()),
)
- if config.Scheduling["CalDAV"]["OldDraftCompatibility"]:
+ if config.Scheduling.CalDAV.OldDraftCompatibility:
privs += (davxml.Privilege(caldavxml.Schedule()),)
return davxml.ACL(
Modified: CalendarServer/trunk/twistedcaldav/scheduling/itip.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/itip.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/scheduling/itip.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -67,7 +67,7 @@
if method:
calendar.removeProperty(method)
- if config.Scheduling["CalDAV"]["OldDraftCompatibility"] and recipient and not autoprocessing:
+ if config.Scheduling.CalDAV.OldDraftCompatibility and recipient and not autoprocessing:
iTipProcessing.fixForiCal3(calendar.subcomponents(), recipient)
return calendar
@@ -135,7 +135,7 @@
component = component.duplicate()
iTipProcessing.transferItems(calendar, master_valarms, private_comments, component, remove_matched=True)
calendar.addComponent(component)
- if config.Scheduling["CalDAV"]["OldDraftCompatibility"] and recipient and not autoprocessing:
+ if config.Scheduling.CalDAV.OldDraftCompatibility and recipient and not autoprocessing:
iTipProcessing.fixForiCal3((component,), recipient)
# Write back the modified object
@@ -317,7 +317,7 @@
partstat_changed = (oldpartstat != partstat)
# Handle attendee comments
- if config.Scheduling["CalDAV"].get("EnablePrivateComments", True):
+ if config.Scheduling.CalDAV.get("EnablePrivateComments", True):
# Look for X-CALENDARSERVER-PRIVATE-COMMENT property in iTIP component (State 1 in spec)
attendee_comment = tuple(from_component.properties("X-CALENDARSERVER-PRIVATE-COMMENT"))
attendee_comment = attendee_comment[0] if len(attendee_comment) else None
Modified: CalendarServer/trunk/twistedcaldav/scheduling/scheduler.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/scheduler.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/scheduling/scheduler.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -534,7 +534,7 @@
# Anything else is not allowed. However, for compatIbility we will optionally
# return a success response for all attendees.
- if config.Scheduling["CalDAV"]["OldDraftCompatibility"]:
+ if config.Scheduling.CalDAV.OldDraftCompatibility:
self.fakeTheResult = True
else:
raise HTTPError(StatusResponse(responsecode.BAD_REQUEST, "Invalid iTIP message for implicit scheduling"))
Modified: CalendarServer/trunk/twistedcaldav/static.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/static.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/static.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -100,7 +100,7 @@
for compatibility with old clients using If-Match.
"""
- if config.Scheduling["CalDAV"]["ScheduleTagCompatibility"]:
+ if config.Scheduling.CalDAV.ScheduleTagCompatibility:
if self.exists() and self.hasDeadProperty(TwistedScheduleMatchETags):
etags = self.readDeadProperty(TwistedScheduleMatchETags).children
@@ -675,7 +675,7 @@
else:
DropBoxHomeFileClass = None
- if config.FreeBusyURL["Enabled"]:
+ if config.FreeBusyURL.Enabled:
FreeBusyURLFileClass = FreeBusyURLFile
else:
FreeBusyURLFileClass = None
@@ -1079,7 +1079,7 @@
davxml.Description("schedule privileges for current principal", **{"xml:lang": "en"}),
),
)
- if config.Scheduling["CalDAV"]["OldDraftCompatibility"]:
+ if config.Scheduling.CalDAV.OldDraftCompatibility:
all_supported_privileges.append(
davxml.SupportedPrivilege(
davxml.Privilege(caldavxml.Schedule()),
Modified: CalendarServer/trunk/twistedcaldav/tap.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/tap.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/tap.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -389,12 +389,12 @@
#
directories = []
- directoryClass = namedClass(config.DirectoryService["type"])
+ directoryClass = namedClass(config.DirectoryService.type)
log.info("Configuring directory service of type: %s"
- % (config.DirectoryService["type"],))
+ % (config.DirectoryService.type,))
- baseDirectory = directoryClass(**config.DirectoryService["params"])
+ baseDirectory = directoryClass(**config.DirectoryService.params)
directories.append(baseDirectory)
@@ -416,7 +416,7 @@
#
# Add wiki directory service
#
- if config.Authentication["Wiki"]["Enabled"]:
+ if config.Authentication.Wiki.Enabled:
wikiDirectory = WikiDirectoryService()
wikiDirectory.realmName = baseDirectory.realmName
directories.append(wikiDirectory)
@@ -430,23 +430,23 @@
#
# Configure Memcached Client Pool
#
- if config.Memcached["ClientEnabled"]:
+ if config.Memcached.ClientEnabled:
memcachepool.installPool(
IPv4Address(
"TCP",
- config.Memcached["BindAddress"],
- config.Memcached["Port"],
+ config.Memcached.BindAddress,
+ config.Memcached.Port,
),
- config.Memcached["MaxClients"],
+ config.Memcached.MaxClients,
)
#
# Configure NotificationClient
#
- if config.Notifications["Enabled"]:
+ if config.Notifications.Enabled:
installNotificationClient(
- config.Notifications["InternalNotificationHost"],
- config.Notifications["InternalNotificationPort"],
+ config.Notifications.InternalNotificationHost,
+ config.Notifications.InternalNotificationPort,
)
#
@@ -492,7 +492,7 @@
root.putChild("timezones", timezoneService)
# iSchedule service is optional
- if config.Scheduling["iSchedule"]["Enabled"]:
+ if config.Scheduling.iSchedule.Enabled:
log.info("Setting up iSchedule inbox resource: %r"
% (self.iScheduleResourceClass,))
@@ -599,12 +599,12 @@
if config.ProcessType == "Slave":
if (
- config.MultiProcess["ProcessCount"] > 1 and
- config.MultiProcess["LoadBalancer"]["Enabled"]
+ config.MultiProcess.ProcessCount > 1 and
+ config.MultiProcess.LoadBalancer.Enabled
):
realRoot = pdmonster.PDClientAddressWrapper(
logWrapper,
- config.PythonDirector["ControlSocket"],
+ config.PythonDirector.ControlSocket,
directory,
)
else:
@@ -747,7 +747,7 @@
# the config object instead of doing things here.
#log.info("Suggesting new max clients for memcache.")
#memcachepool.getCachePool().suggestMaxClients(
- # config.Memcached["MaxClients"]
+ # config.Memcached.MaxClients
#)
signal.signal(signal.SIGHUP, sighup_handler)
Modified: CalendarServer/trunk/twistedcaldav/test/test_config.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_config.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/test/test_config.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -57,7 +57,7 @@
def setUp(self):
config.update(defaultConfig)
self.testConfig = self.mktemp()
- open(self.testConfig, 'w').write(testConfig)
+ open(self.testConfig, "w").write(testConfig)
def tearDown(self):
config.setDefaults(defaultConfig)
@@ -104,7 +104,7 @@
self.assertEquals(config.HTTPPort, 8008)
- config.update({'HTTPPort': 80})
+ config.update({"HTTPPort": 80})
self.assertEquals(config.HTTPPort, 80)
@@ -113,60 +113,60 @@
self.assertEquals(config.HTTPPort, 8008)
def testSetAttr(self):
- self.assertNotIn('BindAddresses', config.__dict__)
+ self.assertNotIn("BindAddresses", config.__dict__)
- config.BindAddresses = ['127.0.0.1']
+ config.BindAddresses = ["127.0.0.1"]
- self.assertNotIn('BindAddresses', config.__dict__)
+ self.assertNotIn("BindAddresses", config.__dict__)
- self.assertEquals(config.BindAddresses, ['127.0.0.1'])
+ self.assertEquals(config.BindAddresses, ["127.0.0.1"])
def testUpdating(self):
self.assertEquals(config.SSLPort, 0)
- config.update({'SSLPort': 8443})
+ config.update({"SSLPort": 8443})
self.assertEquals(config.SSLPort, 8443)
def testMerge(self):
- self.assertEquals(config.MultiProcess["LoadBalancer"]["Enabled"], True)
+ self.assertEquals(config.MultiProcess.LoadBalancer.Enabled, True)
- config.update({'MultiProcess': {}})
+ config.update({"MultiProcess": {}})
- self.assertEquals(config.MultiProcess["LoadBalancer"]["Enabled"], True)
+ self.assertEquals(config.MultiProcess.LoadBalancer.Enabled, True)
def testDirectoryService_noChange(self):
- self.assertEquals(config.DirectoryService["type"], "twistedcaldav.directory.xmlfile.XMLDirectoryService")
- self.assertEquals(config.DirectoryService["params"]["xmlFile"], "/etc/caldavd/accounts.xml")
+ self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
+ self.assertEquals(config.DirectoryService.params.xmlFile, "/etc/caldavd/accounts.xml")
config.update({"DirectoryService": {}})
- self.assertEquals(config.DirectoryService["type"], "twistedcaldav.directory.xmlfile.XMLDirectoryService")
- self.assertEquals(config.DirectoryService["params"]["xmlFile"], "/etc/caldavd/accounts.xml")
+ self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
+ self.assertEquals(config.DirectoryService.params.xmlFile, "/etc/caldavd/accounts.xml")
def testDirectoryService_sameType(self):
- self.assertEquals(config.DirectoryService["type"], "twistedcaldav.directory.xmlfile.XMLDirectoryService")
- self.assertEquals(config.DirectoryService["params"]["xmlFile"], "/etc/caldavd/accounts.xml")
+ self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
+ self.assertEquals(config.DirectoryService.params.xmlFile, "/etc/caldavd/accounts.xml")
config.update({"DirectoryService": {"type": "twistedcaldav.directory.xmlfile.XMLDirectoryService"}})
- self.assertEquals(config.DirectoryService["type"], "twistedcaldav.directory.xmlfile.XMLDirectoryService")
- self.assertEquals(config.DirectoryService["params"]["xmlFile"], "/etc/caldavd/accounts.xml")
+ self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
+ self.assertEquals(config.DirectoryService.params.xmlFile, "/etc/caldavd/accounts.xml")
def testDirectoryService_newType(self):
- self.assertEquals(config.DirectoryService["type"], "twistedcaldav.directory.xmlfile.XMLDirectoryService")
- self.assertEquals(config.DirectoryService["params"]["xmlFile"], "/etc/caldavd/accounts.xml")
+ self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
+ self.assertEquals(config.DirectoryService.params.xmlFile, "/etc/caldavd/accounts.xml")
config.update({"DirectoryService": {"type": "twistedcaldav.directory.appleopendirectory.OpenDirectoryService"}})
- self.assertEquals(config.DirectoryService["type"], "twistedcaldav.directory.appleopendirectory.OpenDirectoryService")
- self.assertNotIn("xmlFile", config.DirectoryService["params"])
- self.assertEquals(config.DirectoryService["params"]["node"], "/Search")
- self.assertEquals(config.DirectoryService["params"]["restrictEnabledRecords"], False)
+ self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.appleopendirectory.OpenDirectoryService")
+ self.assertNotIn("xmlFile", config.DirectoryService.params)
+ self.assertEquals(config.DirectoryService.params.node, "/Search")
+ self.assertEquals(config.DirectoryService.params.restrictEnabledRecords, False)
def testDirectoryService_newParam(self):
- self.assertEquals(config.DirectoryService["type"], "twistedcaldav.directory.xmlfile.XMLDirectoryService")
- self.assertEquals(config.DirectoryService["params"]["xmlFile"], "/etc/caldavd/accounts.xml")
+ self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
+ self.assertEquals(config.DirectoryService.params.xmlFile, "/etc/caldavd/accounts.xml")
config.update({"DirectoryService": {"type": "twistedcaldav.directory.appleopendirectory.OpenDirectoryService"}})
config.update({"DirectoryService": {"params": {
@@ -174,25 +174,25 @@
"restrictToGroup": "12345",
}}})
- self.assertEquals(config.DirectoryService["type"], "twistedcaldav.directory.appleopendirectory.OpenDirectoryService")
- self.assertEquals(config.DirectoryService["params"]["node"], "/Search")
- self.assertEquals(config.DirectoryService["params"]["restrictEnabledRecords"], True)
- self.assertEquals(config.DirectoryService["params"]["restrictToGroup"], "12345")
+ self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.appleopendirectory.OpenDirectoryService")
+ self.assertEquals(config.DirectoryService.params.node, "/Search")
+ self.assertEquals(config.DirectoryService.params.restrictEnabledRecords, True)
+ self.assertEquals(config.DirectoryService.params.restrictToGroup, "12345")
def testDirectoryService_badParam(self):
- self.assertEquals(config.DirectoryService["type"], "twistedcaldav.directory.xmlfile.XMLDirectoryService")
- self.assertEquals(config.DirectoryService["params"]["xmlFile"], "/etc/caldavd/accounts.xml")
+ self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
+ self.assertEquals(config.DirectoryService.params.xmlFile, "/etc/caldavd/accounts.xml")
self.assertRaises(ConfigurationError, config.update, {"DirectoryService": {"params": {"restrictEnabledRecords": False}}})
def testDirectoryService_unknownType(self):
- self.assertEquals(config.DirectoryService["type"], "twistedcaldav.directory.xmlfile.XMLDirectoryService")
- self.assertEquals(config.DirectoryService["params"]["xmlFile"], "/etc/caldavd/accounts.xml")
+ self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
+ self.assertEquals(config.DirectoryService.params.xmlFile, "/etc/caldavd/accounts.xml")
config.update({"DirectoryService": {"type": "twistedcaldav.test.test_config.SuperDuperAwesomeService"}})
#self.assertEquals(
- # config.DirectoryService["params"],
+ # config.DirectoryService.params,
# SuperDuperAwesomeService.defaultParameters
#)
@@ -203,7 +203,7 @@
config.loadConfig(self.testConfig)
- config.updateDefaults({'SSLPort': 8009})
+ config.updateDefaults({"SSLPort": 8009})
self.assertEquals(config.SSLPort, 8009)
@@ -211,15 +211,15 @@
self.assertEquals(config.SSLPort, 8009)
- config.updateDefaults({'SSLPort': 0})
+ config.updateDefaults({"SSLPort": 0})
def testMergeDefaults(self):
- config.updateDefaults({'MultiProcess': {}})
+ config.updateDefaults({"MultiProcess": {}})
self.assertEquals(config._defaults["MultiProcess"]["LoadBalancer"]["Enabled"], True)
def testSetDefaults(self):
- config.updateDefaults({'SSLPort': 8443})
+ config.updateDefaults({"SSLPort": 8443})
config.setDefaults(defaultConfig)
@@ -228,9 +228,9 @@
self.assertEquals(config.SSLPort, 0)
def testCopiesDefaults(self):
- config.updateDefaults({'Foo': 'bar'})
+ config.updateDefaults({"Foo": "bar"})
- self.assertNotIn('Foo', defaultConfig)
+ self.assertNotIn("Foo", defaultConfig)
def testComplianceClasses(self):
resource = CalDAVFile("/")
Modified: CalendarServer/trunk/twistedcaldav/test/test_options.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_options.py 2008-11-11 21:37:38 UTC (rev 3368)
+++ CalendarServer/trunk/twistedcaldav/test/test_options.py 2008-11-11 21:38:42 UTC (rev 3369)
@@ -40,7 +40,7 @@
self.assertIn("calendar-auto-schedule", dav, "no DAV calendar-auto-schedule header")
self.assertIn("calendar-availability", dav, "no DAV calendar-availability header")
- config.Scheduling["CalDAV"]["OldDraftCompatibility"] = True
+ config.Scheduling.CalDAV.OldDraftCompatibility = True
request = SimpleRequest(self.site, "OPTIONS", "/")
return self.send(request, do_test)
@@ -60,7 +60,7 @@
self.assertIn("calendar-auto-schedule", dav, "no DAV calendar-auto-schedule header")
self.assertIn("calendar-availability", dav, "no DAV calendar-availability header")
- config.Scheduling["CalDAV"]["OldDraftCompatibility"] = False
+ config.Scheduling.CalDAV.OldDraftCompatibility = False
request = SimpleRequest(self.site, "OPTIONS", "/")
return self.send(request, do_test)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20081111/952b9056/attachment-0001.html>
More information about the calendarserver-changes
mailing list