[CalendarServer-changes] [13480] CalDAVTester/trunk

source_changes at macosforge.org source_changes at macosforge.org
Thu May 15 18:21:47 PDT 2014


Revision: 13480
          http://trac.calendarserver.org//changeset/13480
Author:   cdaboo at apple.com
Date:     2014-05-15 18:21:47 -0700 (Thu, 15 May 2014)
Log Message:
-----------
Use .format() for serverinfo-template.

Modified Paths:
--------------
    CalDAVTester/trunk/odsetup.py
    CalDAVTester/trunk/scripts/server/serverinfo-template.xml

Modified: CalDAVTester/trunk/odsetup.py
===================================================================
--- CalDAVTester/trunk/odsetup.py	2014-05-16 01:04:44 UTC (rev 13479)
+++ CalDAVTester/trunk/odsetup.py	2014-05-16 01:21:47 UTC (rev 13480)
@@ -395,13 +395,14 @@
     for x, y in subs:
         subs_str += subs_template % (x, y,)
 
-    data = data % {
-        "hostname"       : hostname,
-        "nonsslport"     : str(nonsslport),
-        "sslport"        : str(sslport),
-        "authtype"       : authtype,
-        "overrides"      : subs_str,
-    }
+    data = data.format(
+        hostname=hostname,
+        nonsslport=str(nonsslport),
+        sslport=str(sslport),
+        authtype=authtype,
+        overrides=subs_str,
+        DAV="{DAV:}",
+    )
 
     fd = open(serverinfo_default, "w")
     try:

Modified: CalDAVTester/trunk/scripts/server/serverinfo-template.xml
===================================================================
--- CalDAVTester/trunk/scripts/server/serverinfo-template.xml	2014-05-16 01:04:44 UTC (rev 13479)
+++ CalDAVTester/trunk/scripts/server/serverinfo-template.xml	2014-05-16 01:21:47 UTC (rev 13480)
@@ -19,10 +19,10 @@
  -->
 
 <serverinfo>
-	<host>%(hostname)s</host>
-	<nonsslport>%(nonsslport)s</nonsslport>
-	<sslport>%(sslport)s</sslport>
-	<authtype>%(authtype)s</authtype>
+	<host>{hostname}</host>
+	<nonsslport>{nonsslport}</nonsslport>
+	<sslport>{sslport}</sslport>
+	<authtype>{authtype}</authtype>
 
 	<waitcount>120</waitcount>
 	<waitdelay>0.25</waitdelay>
@@ -73,7 +73,7 @@
 		<feature>attachments-collection</feature>		<!-- Server uses a collection in same WebDAV tree to store attachments -->
 		<feature>auto-accept</feature>					<!-- Auto-accept for rooms & locations -->
 		<feature>auto-accept-modes</feature>			<!-- Auto-accept modes -->
-		<!-- <feature>dropbox</feature> -->				<!-- dropbox extension -->
+		<!--<feature>dropbox</feature> -->				<!-- dropbox extension -->
 		<feature>default-alarms</feature>				<!-- default alarms extension -->
 		<feature>EMAIL parameter</feature>				<!-- Server normalizes cuaddress and adds EMAIL parameter -->
 		<feature>extended-freebusy</feature>	      	<!-- Extended freebusy response -->
@@ -109,7 +109,7 @@
 		<!-- CardDAV specific extension -->
 		<feature>carddav</feature> 						<!-- Basic CardDAV feature enabler -->
 		<feature>default-addressbook</feature> 			<!-- Default address book behavior -->
-		<!-- <feature>shared-addressbooks</feature> --> <!-- Shared address books extension -->
+		<feature>shared-addressbooks</feature>			<!-- Shared address books extension -->
 		<!-- <feature>directory-gateway</feature> -->	<!-- Directory gateway extension -->
 
 	</features>
@@ -410,138 +410,139 @@
 		<repeat count="40">
 			<!-- user id -->
 			<substitution>
-				<key>$userid%%d:</key>
-				<value>user%%02d</value>
+				<key>$userid%d:</key>
+				<value>user%02d</value>
 			</substitution>
 			<!-- user guid -->
 			<substitution>
-				<key>$userguid%%d:</key>
+				<key>$userguid%d:</key>
 				<value>10000000-0000-0000-0000-000000000%03d</value>
 			</substitution>
 			<!-- user name -->
 			<substitution>
-				<key>$username%%d:</key>
-				<value>User %%02d</value>
+				<key>$username%d:</key>
+				<value>User %02d</value>
 			</substitution>
 			<!-- user name URI encoded -->
 			<substitution>
-				<key>$username-encoded%%d:</key>
-				<value>User%%%%20%%02d</value>
+				<key>$username-encoded%d:</key>
+				<value>User%%20%02d</value>
 			</substitution>
 			<!-- first name -->
 			<substitution>
-				<key>$firstname%%d:</key>
+				<key>$firstname%d:</key>
 				<value>User</value>
 			</substitution>
 			<!-- last name -->
 			<substitution>
-				<key>$lastname%%d:</key>
-				<value>%%02d</value>
+				<key>$lastname%d:</key>
+				<value>%02d</value>
 			</substitution>
 			<!-- password -->
 			<substitution>
-				<key>$pswd%%d:</key>
-				<value>user%%02d</value>
+				<key>$pswd%d:</key>
+				<value>user%02d</value>
 			</substitution>
 			<!-- relative path to user principal resource-->
 			<substitution>
-				<key>$principal%%d:</key>
-				<value>$principals_users:$userid%%d:/</value>
+				<key>$principal%d:</key>
+				<value>$principals_users:$userid%d:/</value>
 			</substitution>
 			<substitution>
-				<key>$principaluri%%d:</key>
-				<value>$principals_uids:$userguid%%d:/</value>
+				<key>$principaluri%d:</key>
+				<value>$principals_uids:$userguid%d:/</value>
 			</substitution>
 			<substitution>
-				<key>$principal%%dnoslash:</key>
-				<value>$principals_users:$userid%%d:</value>
+				<key>$principal%dnoslash:</key>
+				<value>$principals_users:$userid%d:</value>
 			</substitution>
+
 			<!-- relative path to user calendar home-->
 			<substitution>
-				<key>$calendarhome%%d:</key>
-				<value>$calendars_uids:$userguid%%d:</value>
+				<key>$calendarhome%d:</key>
+				<value>$calendars_uids:$userguid%d:</value>
 			</substitution>
 			<!-- relative path to user alternate calendar home-->
 			<substitution>
-				<key>$calendarhomealt%%d:</key>
-				<value>$calendars_users:$userid%%d:</value>
+				<key>$calendarhomealt%d:</key>
+				<value>$calendars_users:$userid%d:</value>
 			</substitution>
 			<!-- relative path to user calendar-->
 			<substitution>
-				<key>$calendarpath%%d:</key>
-				<value>$calendarhome%%d:/$calendar:</value>
+				<key>$calendarpath%d:</key>
+				<value>$calendarhome%d:/$calendar:</value>
 			</substitution>
 			<!-- relative path to user alternate calendar-->
 			<substitution>
-				<key>$calendarpathalt%%d:</key>
-				<value>$calendarhomealt%%d:/$calendar:</value>
+				<key>$calendarpathalt%d:</key>
+				<value>$calendarhomealt%d:/$calendar:</value>
 			</substitution>
 			<!-- relative path to user tasks calendar-->
 			<substitution>
-				<key>$taskspath%%d:</key>
-				<value>$calendarhome%%d:/$tasks:</value>
+				<key>$taskspath%d:</key>
+				<value>$calendarhome%d:/$tasks:</value>
 			</substitution>
 			<!-- relative path to user polls calendar-->
 			<substitution>
-				<key>$pollspath%%d:</key>
-				<value>$calendarhome%%d:/$polls:</value>
+				<key>$pollspath%d:</key>
+				<value>$calendarhome%d:/$polls:</value>
 			</substitution>
 			<!-- relative path to user inbox-->
 			<substitution>
-				<key>$inboxpath%%d:</key>
-				<value>$calendarhome%%d:/$inbox:</value>
+				<key>$inboxpath%d:</key>
+				<value>$calendarhome%d:/$inbox:</value>
 			</substitution>
 			<!-- relative path to user outbox-->
 			<substitution>
-				<key>$outboxpath%%d:</key>
-				<value>$calendarhome%%d:/$outbox:</value>
+				<key>$outboxpath%d:</key>
+				<value>$calendarhome%d:/$outbox:</value>
 			</substitution>
 			<!-- relative path to user dropbox-->
 			<substitution>
-				<key>$dropboxpath%%d:</key>
-				<value>$calendarhome%%d:/$dropbox:</value>
+				<key>$dropboxpath%d:</key>
+				<value>$calendarhome%d:/$dropbox:</value>
 			</substitution>
 			<!-- relative path to user notification-->
 			<substitution>
-				<key>$notificationpath%%d:</key>
-				<value>$calendarhome%%d:/$notification:</value>
+				<key>$notificationpath%d:</key>
+				<value>$calendarhome%d:/$notification:</value>
 			</substitution>
 			<!-- relative path to user freebusy-->
 			<substitution>
-				<key>$freebusypath%%d:</key>
-				<value>$calendarhome%%d:/$freebusy:</value>
+				<key>$freebusypath%d:</key>
+				<value>$calendarhome%d:/$freebusy:</value>
 			</substitution>
 			<substitution>
-				<key>$email%%d:</key>
-				<value>$userid%%d:@example.com</value>
+				<key>$email%d:</key>
+				<value>$userid%d:@example.com</value>
 			</substitution>
 			<!-- calendar user address of user-->
 			<substitution>
-				<key>$cuaddr%%d:</key>
-				<value>mailto:$email%%d:</value>
+				<key>$cuaddr%d:</key>
+				<value>mailto:$email%d:</value>
 			</substitution>
 			<substitution>
-				<key>$cuaddralt%%d:</key>
-				<value>$cuaddr%%d:</value>
+				<key>$cuaddralt%d:</key>
+				<value>$cuaddr%d:</value>
 			</substitution>
 			<substitution>
-				<key>$cuaddraltnoslash%%d:</key>
-				<value>$cuaddr%%d:</value>
+				<key>$cuaddraltnoslash%d:</key>
+				<value>$cuaddr%d:</value>
 			</substitution>
 			<substitution>
-				<key>$cuaddrurn%%d:</key>
-				<value>urn:x-uid:$userguid%%d:</value>
+				<key>$cuaddrurn%d:</key>
+				<value>urn:x-uid:$userguid%d:</value>
 			</substitution>
 
 			<!-- relative path to user addressbook home-->
 			<substitution>
-				<key>$addressbookhome%%d:</key>
-				<value>$addressbooks_uids:$userguid%%d:</value>
+				<key>$addressbookhome%d:</key>
+				<value>$addressbooks_uids:$userguid%d:</value>
 			</substitution>
 			<!-- relative path to user addressbook-->
 			<substitution>
-				<key>$addressbookpath%%d:</key>
-				<value>$addressbookhome%%d:/$addressbook:</value>
+				<key>$addressbookpath%d:</key>
+				<value>$addressbookhome%d:/$addressbook:</value>
 			</substitution>
 		</repeat>
 
@@ -549,169 +550,169 @@
 		<repeat count="10">
 			<!-- user id -->
 			<substitution>
-				<key>$publicuserid%%d:</key>
-				<value>public%%02d</value>
+				<key>$publicuserid%d:</key>
+				<value>public%02d</value>
 			</substitution>
 			<!-- user guid -->
 			<substitution>
-				<key>$publicuserguid%%d:</key>
+				<key>$publicuserguid%d:</key>
 				<value>50000000-0000-0000-0000-0000000000%02d</value>
 			</substitution>
 			<!-- user name -->
 			<substitution>
-				<key>$publicusername%%d:</key>
-				<value>Public %%02d</value>
+				<key>$publicusername%d:</key>
+				<value>Public %02d</value>
 			</substitution>
 			<!-- password -->
 			<substitution>
-				<key>$publicpswd%%d:</key>
-				<value>public%%02d</value>
+				<key>$publicpswd%d:</key>
+				<value>public%02d</value>
 			</substitution>
 			<!-- relative path to user principal resource-->
 			<substitution>
-				<key>$publicprincipal%%d:</key>
-				<value>$principals_users:$publicuserid%%d:/</value>
+				<key>$publicprincipal%d:</key>
+				<value>$principals_users:$publicuserid%d:/</value>
 			</substitution>
 			<substitution>
-				<key>$publicprincipaluri%%d:</key>
-				<value>$principals_uids:$publicuserguid%%d:/</value>
+				<key>$publicprincipaluri%d:</key>
+				<value>$principals_uids:$publicuserguid%d:/</value>
 			</substitution>
 			<!-- relative path to user calendar home-->
 			<substitution>
-				<key>$publiccalendarhome%%d:</key>
-				<value>$calendars_uids:$publicuserguid%%d:</value>
+				<key>$publiccalendarhome%d:</key>
+				<value>$calendars_uids:$publicuserguid%d:</value>
 			</substitution>
 			<!-- relative path to user calendar-->
 			<substitution>
-				<key>$publiccalendarpath%%d:</key>
-				<value>$calendars_uids:$publicuserguid%%d:/$calendar:</value>
+				<key>$publiccalendarpath%d:</key>
+				<value>$calendars_uids:$publicuserguid%d:/$calendar:</value>
 			</substitution>
 			<substitution>
-				<key>$publicemail%%d:</key>
-				<value>$publicuserid%%d:@example.com</value>
+				<key>$publicemail%d:</key>
+				<value>$publicuserid%d:@example.com</value>
 			</substitution>
 			<!-- calendar user address of user-->
 			<substitution>
-				<key>$publiccuaddr%%d:</key>
-				<value>mailto:$publicemail%%d:</value>
+				<key>$publiccuaddr%d:</key>
+				<value>mailto:$publicemail%d:</value>
 			</substitution>
 			<substitution>
-				<key>$publiccuaddralt%%d:</key>
-				<value>$publiccuaddr%%d:</value>
+				<key>$publiccuaddralt%d:</key>
+				<value>$publiccuaddr%d:</value>
 			</substitution>
 			<substitution>
-				<key>$publiccuaddrurn%%d:</key>
-				<value>urn:x-uid:$publicuserguidi%%d:</value>
+				<key>$publiccuaddrurn%d:</key>
+				<value>urn:x-uid:$publicuserguid%d:</value>
 			</substitution>
 		</repeat>
 
 		<!--  Twenty resource accounts -->
 		<repeat count="20">
 			<substitution>
-				<key>$resourceid%%d:</key>
-				<value>resource%%02d</value>
+				<key>$resourceid%d:</key>
+				<value>resource%02d</value>
 			</substitution>
 			<!-- resource guid-->
 			<substitution>
-				<key>$resourceguid%%d:</key>
+				<key>$resourceguid%d:</key>
 				<value>40000000-0000-0000-0000-000000000%03d</value>
 			</substitution>
 			<!-- resource name-->
 			<substitution>
-				<key>$resourcename%%d:</key>
-				<value>Resource %%02d</value>
+				<key>$resourcename%d:</key>
+				<value>Resource %02d</value>
 			</substitution>
 			<!-- relative path to first resource calendar home-->
 			<substitution>
-				<key>$rcalendarhome%%d:</key>
-				<value>$calendars_uids:$resourceguid%%d:</value>
+				<key>$rcalendarhome%d:</key>
+				<value>$calendars_uids:$resourceguid%d:</value>
 			</substitution>
 			<!-- relative path to first resource calendar home-->
 			<substitution>
-				<key>$rcalendarpath%%d:</key>
-				<value>$calendars_uids:$resourceguid%%d:/$calendar:</value>
+				<key>$rcalendarpath%d:</key>
+				<value>$calendars_uids:$resourceguid%d:/$calendar:</value>
 			</substitution>
 			<!-- relative path to first resource inbox-->
 			<substitution>
-				<key>$rinboxpath%%d:</key>
-				<value>$calendars_uids:$resourceguid%%d:/$inbox:</value>
+				<key>$rinboxpath%d:</key>
+				<value>$calendars_uids:$resourceguid%d:/$inbox:</value>
 			</substitution>
 			<!-- relative path to first resource outbox-->
 			<substitution>
-				<key>$routboxpath%%d:</key>
-				<value>$calendars_uids:$resourceguid%%d:/$outbox:</value>
+				<key>$routboxpath%d:</key>
+				<value>$calendars_uids:$resourceguid%d:/$outbox:</value>
 			</substitution>
 			<!-- relative path to first resource principal resource-->
 			<substitution>
-				<key>$rprincipal%%d:</key>
-				<value>$principals_resources:$resourceid%%d:/</value>
+				<key>$rprincipal%d:</key>
+				<value>$principals_resources:$resourceid%d:/</value>
 			</substitution>
 			<substitution>
-				<key>$rprincipaluri%%d:</key>
-				<value>$principals_uids:$resourceguid%%d:/</value>
+				<key>$rprincipaluri%d:</key>
+				<value>$principals_uids:$resourceguid%d:/</value>
 			</substitution>
 			<substitution>
-				<key>$rcuaddralt%%d:</key>
-				<value>$rcuaddrurn%%d:</value>
+				<key>$rcuaddralt%d:</key>
+				<value>$rcuaddrurn%d:</value>
 			</substitution>
 			<substitution>
-				<key>$rcuaddrurn%%d:</key>
-				<value>urn:x-uid:$resourceguid%%d:</value>
+				<key>$rcuaddrurn%d:</key>
+				<value>urn:x-uid:$resourceguid%d:</value>
 			</substitution>
 		</repeat>
 
 		<!--  Ten Location accounts -->
 		<repeat count="10">
 			<substitution>
-				<key>$locationid%%d:</key>
-				<value>location%%02d</value>
+				<key>$locationid%d:</key>
+				<value>location%02d</value>
 			</substitution>
 			<!-- location guid-->
 			<substitution>
-				<key>$locationguid%%d:</key>
+				<key>$locationguid%d:</key>
 				<value>30000000-0000-0000-0000-000000000%03d</value>
 			</substitution>
 			<!-- location name-->
 			<substitution>
-				<key>$locationname%%d:</key>
-				<value>Location %%02d</value>
+				<key>$locationname%d:</key>
+				<value>Location %02d</value>
 			</substitution>
 			<!-- relative path to first location calendar home-->
 			<substitution>
-				<key>$lcalendarhome%%d:</key>
-				<value>$calendars_uids:$locationguid%%d:</value>
+				<key>$lcalendarhome%d:</key>
+				<value>$calendars_uids:$locationguid%d:</value>
 			</substitution>
 			<!-- relative path to first location calendar home-->
 			<substitution>
-				<key>$lcalendarpath%%d:</key>
-				<value>$calendars_uids:$locationguid%%d:/$calendar:</value>
+				<key>$lcalendarpath%d:</key>
+				<value>$calendars_uids:$locationguid%d:/$calendar:</value>
 			</substitution>
 			<!-- relative path to first location inbox-->
 			<substitution>
-				<key>$linboxpath%%d:</key>
-				<value>$calendars_uids:$locationguid%%d:/$inbox:</value>
+				<key>$linboxpath%d:</key>
+				<value>$calendars_uids:$locationguid%d:/$inbox:</value>
 			</substitution>
 			<!-- relative path to first location outbox-->
 			<substitution>
-				<key>$loutboxpath%%d:</key>
-				<value>$calendars_uids:$locationguid%%d:/$outbox:</value>
+				<key>$loutboxpath%d:</key>
+				<value>$calendars_uids:$locationguid%d:/$outbox:</value>
 			</substitution>
 			<!-- relative path to first location principal resource-->
 			<substitution>
-				<key>$lprincipal%%d:</key>
-				<value>$principals_resources:$locationid%%d:/</value>
+				<key>$lprincipal%d:</key>
+				<value>$principals_resources:$locationid%d:/</value>
 			</substitution>
 			<substitution>
-				<key>$lprincipaluri%%d:</key>
-				<value>$principals_uids:$locationguid%%d:/</value>
+				<key>$lprincipaluri%d:</key>
+				<value>$principals_uids:$locationguid%d:/</value>
 			</substitution>
 			<substitution>
-				<key>$lcuaddralt%%d:</key>
-				<value>$lprincipaluri%%d:</value>
+				<key>$lcuaddralt%d:</key>
+				<value>$lprincipaluri%d:</value>
 			</substitution>
 			<substitution>
-				<key>$lcuaddrurn%%d:</key>
-				<value>urn:x-uid:$locationguid%%d:</value>
+				<key>$lcuaddrurn%d:</key>
+				<value>urn:x-uid:$locationguid%d:</value>
 			</substitution>
 		</repeat>
 
@@ -719,35 +720,35 @@
 		<!--  Ten Group accounts -->
 		<repeat count="10">
 			<substitution>
-				<key>$groupid%%d:</key>
-				<value>group%%02d</value>
+				<key>$groupid%d:</key>
+				<value>group%02d</value>
 			</substitution>
 			<!-- group guid-->
 			<substitution>
-				<key>$groupguid%%d:</key>
+				<key>$groupguid%d:</key>
 				<value>20000000-0000-0000-0000-000000000%03d</value>
 			</substitution>
 			<!-- group name-->
 			<substitution>
-				<key>$groupname%%d:</key>
-				<value>Group %%02d</value>
+				<key>$groupname%d:</key>
+				<value>Group %02d</value>
 			</substitution>
 			<!-- relative path to first group principal resource-->
 			<substitution>
-				<key>$gprincipal%%d:</key>
-				<value>$principals_resources:$groupid%%d:/</value>
+				<key>$gprincipal%d:</key>
+				<value>$principals_resources:$groupid%d:/</value>
 			</substitution>
 			<substitution>
-				<key>$gprincipaluri%%d:</key>
-				<value>$principals_uids:$groupguid%%d:/</value>
+				<key>$gprincipaluri%d:</key>
+				<value>$principals_uids:$groupguid%d:/</value>
 			</substitution>
 			<substitution>
-				<key>$gcuaddralt%%d:</key>
-				<value>$gprincipaluri%%d:</value>
+				<key>$gcuaddralt%d:</key>
+				<value>$gprincipaluri%d:</value>
 			</substitution>
 			<substitution>
-				<key>$gcuaddrurn%%d:</key>
-				<value>urn:x-uid:$groupguid%%d:</value>
+				<key>$gcuaddrurn%d:</key>
+				<value>urn:x-uid:$groupguid%d:</value>
 			</substitution>
 		</repeat>
 
@@ -813,7 +814,7 @@
 			<value>MAILTO:$email2:</value>
 		</substitution>
 
-		%(overrides)s
+		{overrides}
 
 	</substitutions>
 </serverinfo>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140515/db393658/attachment-0001.html>


More information about the calendarserver-changes mailing list