<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[12062] CalendarServer/trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/12062">12062</a></dd>
<dt>Author</dt> <dd>wsanchez@apple.com</dd>
<dt>Date</dt> <dd>2013-12-12 16:35:58 -0800 (Thu, 12 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Nix twext.python.plistlib.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkbinproxyclean">CalendarServer/trunk/bin/proxyclean</a></li>
<li><a href="#CalendarServertrunkcalendarservertaptesttest_caldavpy">CalendarServer/trunk/calendarserver/tap/test/test_caldav.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsagentpy">CalendarServer/trunk/calendarserver/tools/agent.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsanonymizepy">CalendarServer/trunk/calendarserver/tools/anonymize.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsconfigpy">CalendarServer/trunk/calendarserver/tools/config.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolsgatewaypy">CalendarServer/trunk/calendarserver/tools/gateway.py</a></li>
<li><a href="#CalendarServertrunkcalendarservertoolstesttest_gatewaypy">CalendarServer/trunk/calendarserver/tools/test/test_gateway.py</a></li>
<li><a href="#CalendarServertrunktwextapplication__init__py">CalendarServer/trunk/twext/application/__init__.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavbackuppy">CalendarServer/trunk/twistedcaldav/backup.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavstdconfigpy">CalendarServer/trunk/twistedcaldav/stdconfig.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_configpy">CalendarServer/trunk/twistedcaldav/test/test_config.py</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#CalendarServertrunktwextpython_plistlibpy">CalendarServer/trunk/twext/python/_plistlib.py</a></li>
<li><a href="#CalendarServertrunktwextpythonplistlibpy">CalendarServer/trunk/twext/python/plistlib.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkbinproxyclean"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/bin/proxyclean (12061 => 12062)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/bin/proxyclean        2013-12-13 00:20:12 UTC (rev 12061)
+++ CalendarServer/trunk/bin/proxyclean        2013-12-13 00:35:58 UTC (rev 12062)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> except ImportError:
</span><span class="cx">     sys.exc_clear()
</span><span class="cx"> 
</span><del>-from twext.python.plistlib import readPlist
</del><ins>+from plistlib import readPlist
</ins><span class="cx"> 
</span><span class="cx"> try:
</span><span class="cx">     import opendirectory
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertaptesttest_caldavpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tap/test/test_caldav.py (12061 => 12062)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tap/test/test_caldav.py        2013-12-13 00:20:12 UTC (rev 12061)
+++ CalendarServer/trunk/calendarserver/tap/test/test_caldav.py        2013-12-13 00:35:58 UTC (rev 12062)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> 
</span><span class="cx"> from twext.python.log import Logger
</span><span class="cx"> from twext.python.filepath import CachingFilePath as FilePath
</span><del>-from twext.python.plistlib import writePlist #@UnresolvedImport
</del><ins>+from plistlib import writePlist #@UnresolvedImport
</ins><span class="cx"> from twext.web2.dav import auth
</span><span class="cx"> from twext.web2.log import LogWrapperResource
</span><span class="cx"> from twext.internet.tcp import MaxAcceptTCPServer, MaxAcceptSSLServer
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsagentpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/agent.py (12061 => 12062)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/agent.py        2013-12-13 00:20:12 UTC (rev 12061)
+++ CalendarServer/trunk/calendarserver/tools/agent.py        2013-12-13 00:35:58 UTC (rev 12062)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> import socket
</span><span class="cx"> 
</span><span class="cx"> from calendarserver.tap.util import getRootResource
</span><del>-from twext.python.plistlib import readPlistFromString, writePlistToString
</del><ins>+from plistlib import readPlistFromString, writePlistToString
</ins><span class="cx"> from twisted.application.internet import StreamServerEndpointService
</span><span class="cx"> from twisted.cred.checkers import ICredentialsChecker
</span><span class="cx"> from twisted.cred.credentials import IUsernameHashedPassword
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsanonymizepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/anonymize.py (12061 => 12062)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/anonymize.py        2013-12-13 00:20:12 UTC (rev 12061)
+++ CalendarServer/trunk/calendarserver/tools/anonymize.py        2013-12-13 00:35:58 UTC (rev 12062)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> import xattr
</span><span class="cx"> import zlib
</span><span class="cx"> 
</span><del>-from twext.python.plistlib import readPlistFromString
</del><ins>+from plistlib import readPlistFromString
</ins><span class="cx"> 
</span><span class="cx"> from pycalendar.icalendar.calendar import Calendar
</span><span class="cx"> from pycalendar.parameter import Parameter
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/config.py (12061 => 12062)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/config.py        2013-12-13 00:20:12 UTC (rev 12061)
+++ CalendarServer/trunk/calendarserver/tools/config.py        2013-12-13 00:35:58 UTC (rev 12062)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> import sys
</span><span class="cx"> import xml
</span><span class="cx"> 
</span><del>-from twext.python.plistlib import readPlistFromString, writePlistToString
</del><ins>+from plistlib import readPlistFromString, writePlistToString
</ins><span class="cx"> from twistedcaldav.config import config, ConfigDict, ConfigurationError, mergeData
</span><span class="cx"> from twistedcaldav.stdconfig import DEFAULT_CONFIG_FILE
</span><span class="cx"> WRITABLE_CONFIG_KEYS = [
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolsgatewaypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/gateway.py (12061 => 12062)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/gateway.py        2013-12-13 00:20:12 UTC (rev 12061)
+++ CalendarServer/trunk/calendarserver/tools/gateway.py        2013-12-13 00:35:58 UTC (rev 12062)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> import sys
</span><span class="cx"> import xml
</span><span class="cx"> 
</span><del>-from twext.python.plistlib import readPlistFromString, writePlistToString
</del><ins>+from plistlib import readPlistFromString, writePlistToString
</ins><span class="cx"> 
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, succeed
</span><span class="cx"> from twistedcaldav.directory.directory import DirectoryError
</span></span></pre></div>
<a id="CalendarServertrunkcalendarservertoolstesttest_gatewaypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/test/test_gateway.py (12061 => 12062)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/test/test_gateway.py        2013-12-13 00:20:12 UTC (rev 12061)
+++ CalendarServer/trunk/calendarserver/tools/test/test_gateway.py        2013-12-13 00:35:58 UTC (rev 12062)
</span><span class="lines">@@ -17,7 +17,7 @@
</span><span class="cx"> 
</span><span class="cx"> import os
</span><span class="cx"> import sys
</span><del>-from twext.python.plistlib import readPlistFromString
</del><ins>+from plistlib import readPlistFromString
</ins><span class="cx"> import xml
</span><span class="cx"> 
</span><span class="cx"> from twext.python.filepath import CachingFilePath as FilePath
</span></span></pre></div>
<a id="CalendarServertrunktwextapplication__init__py"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twext/application/__init__.py (12061 => 12062)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twext/application/__init__.py        2013-12-13 00:20:12 UTC (rev 12061)
+++ CalendarServer/trunk/twext/application/__init__.py        2013-12-13 00:35:58 UTC (rev 12062)
</span><span class="lines">@@ -15,5 +15,5 @@
</span><span class="cx"> ##
</span><span class="cx"> 
</span><span class="cx"> &quot;&quot;&quot;
</span><del>-TAP files
</del><ins>+Extensions to twisted.application.
</ins><span class="cx"> &quot;&quot;&quot;
</span></span></pre></div>
<a id="CalendarServertrunktwextpython_plistlibpy"></a>
<div class="delfile"><h4>Deleted: CalendarServer/trunk/twext/python/_plistlib.py (12061 => 12062)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twext/python/_plistlib.py        2013-12-13 00:20:12 UTC (rev 12061)
+++ CalendarServer/trunk/twext/python/_plistlib.py        2013-12-13 00:35:58 UTC (rev 12062)
</span><span class="lines">@@ -1,473 +0,0 @@
</span><del>-#
-# Added to standard library in Python 2.6 (Mac only in prior versions)
-#
-from __future__ import print_function
-
-&quot;&quot;&quot;plistlib.py -- a tool to generate and parse MacOSX .plist files.
-
-The PropertList (.plist) file format is a simple XML pickle supporting
-basic object types, like dictionaries, lists, numbers and strings.
-Usually the top level object is a dictionary.
-
-To write out a plist file, use the writePlist(rootObject, pathOrFile)
-function. 'rootObject' is the top level object, 'pathOrFile' is a
-filename or a (writable) file object.
-
-To parse a plist from a file, use the readPlist(pathOrFile) function,
-with a file name or a (readable) file object as the only argument. It
-returns the top level object (again, usually a dictionary).
-
-To work with plist data in strings, you can use readPlistFromString()
-and writePlistToString().
-
-Values can be strings, integers, floats, booleans, tuples, lists,
-dictionaries, Data or datetime.datetime objects. String values (including
-dictionary keys) may be unicode strings -- they will be written out as
-UTF-8.
-
-The &lt;data&gt; plist type is supported through the Data class. This is a
-thin wrapper around a Python string.
-
-Generate Plist example::
-
-    pl = dict(
-        aString=&quot;Doodah&quot;,
-        aList=[&quot;A&quot;, &quot;B&quot;, 12, 32.1, [1, 2, 3]],
-        aFloat = 0.1,
-        anInt = 728,
-        aDict=dict(
-            anotherString=&quot;&lt;hello &amp; hi there!&gt;&quot;,
-            aUnicodeValue=u'M\xe4ssig, Ma\xdf',
-            aTrueValue=True,
-            aFalseValue=False,
-        ),
-        someData = Data(&quot;&lt;binary gunk&gt;&quot;),
-        someMoreData = Data(&quot;&lt;lots of binary gunk&gt;&quot; * 10),
-        aDate = datetime.datetime.fromtimestamp(time.mktime(time.gmtime())),
-    )
-    # unicode keys are possible, but a little awkward to use:
-    pl[u'\xc5benraa'] = &quot;That was a unicode key.&quot;
-    writePlist(pl, fileName)
-
-Parse Plist example::
-
-    pl = readPlist(pathOrFile)
-    print(pl[&quot;aKey&quot;])
-&quot;&quot;&quot;
-
-
-__all__ = [
-    &quot;readPlist&quot;, &quot;writePlist&quot;, &quot;readPlistFromString&quot;, &quot;writePlistToString&quot;,
-    &quot;readPlistFromResource&quot;, &quot;writePlistToResource&quot;,
-    &quot;Plist&quot;, &quot;Data&quot;, &quot;Dict&quot;
-]
-# Note: the Plist and Dict classes have been deprecated.
-
-import binascii
-import datetime
-from cStringIO import StringIO
-import re
-
-
-def readPlist(pathOrFile):
-    &quot;&quot;&quot;Read a .plist file. 'pathOrFile' may either be a file name or a
-    (readable) file object. Return the unpacked root object (which
-    usually is a dictionary).
-    &quot;&quot;&quot;
-    didOpen = 0
-    if isinstance(pathOrFile, (str, unicode)):
-        pathOrFile = open(pathOrFile)
-        didOpen = 1
-    p = PlistParser()
-    rootObject = p.parse(pathOrFile)
-    if didOpen:
-        pathOrFile.close()
-    return rootObject
-
-
-def writePlist(rootObject, pathOrFile):
-    &quot;&quot;&quot;Write 'rootObject' to a .plist file. 'pathOrFile' may either be a
-    file name or a (writable) file object.
-    &quot;&quot;&quot;
-    didOpen = 0
-    if isinstance(pathOrFile, (str, unicode)):
-        pathOrFile = open(pathOrFile, &quot;w&quot;)
-        didOpen = 1
-    writer = PlistWriter(pathOrFile)
-    writer.writeln(&quot;&lt;plist version=\&quot;1.0\&quot;&gt;&quot;)
-    writer.writeValue(rootObject)
-    writer.writeln(&quot;&lt;/plist&gt;&quot;)
-    if didOpen:
-        pathOrFile.close()
-
-
-def readPlistFromString(data):
-    &quot;&quot;&quot;Read a plist data from a string. Return the root object.
-    &quot;&quot;&quot;
-    return readPlist(StringIO(data))
-
-
-def writePlistToString(rootObject):
-    &quot;&quot;&quot;Return 'rootObject' as a plist-formatted string.
-    &quot;&quot;&quot;
-    f = StringIO()
-    writePlist(rootObject, f)
-    return f.getvalue()
-
-
-def readPlistFromResource(path, restype='plst', resid=0):
-    &quot;&quot;&quot;Read plst resource from the resource fork of path.
-    &quot;&quot;&quot;
-    from Carbon.File import FSRef, FSGetResourceForkName
-    from Carbon.Files import fsRdPerm
-    from Carbon import Res
-    fsRef = FSRef(path)
-    resNum = Res.FSOpenResourceFile(fsRef, FSGetResourceForkName(), fsRdPerm)
-    Res.UseResFile(resNum)
-    plistData = Res.Get1Resource(restype, resid).data
-    Res.CloseResFile(resNum)
-    return readPlistFromString(plistData)
-
-
-def writePlistToResource(rootObject, path, restype='plst', resid=0):
-    &quot;&quot;&quot;Write 'rootObject' as a plst resource to the resource fork of path.
-    &quot;&quot;&quot;
-    from Carbon.File import FSRef, FSGetResourceForkName
-    from Carbon.Files import fsRdWrPerm
-    from Carbon import Res
-    plistData = writePlistToString(rootObject)
-    fsRef = FSRef(path)
-    resNum = Res.FSOpenResourceFile(fsRef, FSGetResourceForkName(), fsRdWrPerm)
-    Res.UseResFile(resNum)
-    try:
-        Res.Get1Resource(restype, resid).RemoveResource()
-    except Res.Error:
-        pass
-    res = Res.Resource(plistData)
-    res.AddResource(restype, resid, '')
-    res.WriteResource()
-    Res.CloseResFile(resNum)
-
-
-class DumbXMLWriter:
-
-    def __init__(self, file, indentLevel=0, indent=&quot;\t&quot;):
-        self.file = file
-        self.stack = []
-        self.indentLevel = indentLevel
-        self.indent = indent
-
-    def beginElement(self, element):
-        self.stack.append(element)
-        self.writeln(&quot;&lt;%s&gt;&quot; % element)
-        self.indentLevel += 1
-
-    def endElement(self, element):
-        assert self.indentLevel &gt; 0
-        assert self.stack.pop() == element
-        self.indentLevel -= 1
-        self.writeln(&quot;&lt;/%s&gt;&quot; % element)
-
-    def simpleElement(self, element, value=None):
-        if value is not None:
-            value = _escapeAndEncode(value)
-            self.writeln(&quot;&lt;%s&gt;%s&lt;/%s&gt;&quot; % (element, value, element))
-        else:
-            self.writeln(&quot;&lt;%s/&gt;&quot; % element)
-
-    def writeln(self, line):
-        if line:
-            self.file.write(self.indentLevel * self.indent + line + &quot;\n&quot;)
-        else:
-            self.file.write(&quot;\n&quot;)
-
-
-# Contents should conform to a subset of ISO 8601
-# (in particular, YYYY '-' MM '-' DD 'T' HH ':' MM ':' SS 'Z'.  Smaller units may be omitted with
-#  a loss of precision)
-_dateParser = re.compile(r&quot;(?P&lt;year&gt;\d\d\d\d)(?:-(?P&lt;month&gt;\d\d)(?:-(?P&lt;day&gt;\d\d)(?:T(?P&lt;hour&gt;\d\d)(?::(?P&lt;minute&gt;\d\d)(?::(?P&lt;second&gt;\d\d))?)?)?)?)?Z&quot;)
-
-def _dateFromString(s):
-    order = ('year', 'month', 'day', 'hour', 'minute', 'second')
-    gd = _dateParser.match(s).groupdict()
-    lst = []
-    for key in order:
-        val = gd[key]
-        if val is None:
-            break
-        lst.append(int(val))
-    return datetime.datetime(*lst)
-
-def _dateToString(d):
-    return '%04d-%02d-%02dT%02d:%02d:%02dZ' % (
-        d.year, d.month, d.day,
-        d.hour, d.minute, d.second
-    )
-
-
-# Regex to find any control chars, except for \t \n and \r
-_controlCharPat = re.compile(
-    r&quot;[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f&quot;
-    r&quot;\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]&quot;)
-
-def _escapeAndEncode(text):
-    m = _controlCharPat.search(text)
-    if m is not None:
-        raise ValueError(&quot;strings can't contains control characters; &quot;
-                         &quot;use plistlib.Data instead&quot;)
-    text = text.replace(&quot;\r\n&quot;, &quot;\n&quot;)       # convert DOS line endings
-    text = text.replace(&quot;\r&quot;, &quot;\n&quot;)         # convert Mac line endings
-    text = text.replace(&quot;&amp;&quot;, &quot;&amp;amp;&quot;)       # escape '&amp;'
-    text = text.replace(&quot;&lt;&quot;, &quot;&amp;lt;&quot;)        # escape '&lt;'
-    text = text.replace(&quot;&gt;&quot;, &quot;&amp;gt;&quot;)        # escape '&gt;'
-    return text.encode(&quot;utf-8&quot;)             # encode as UTF-8
-
-
-PLISTHEADER = &quot;&quot;&quot;\
-&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
-&lt;!DOCTYPE plist PUBLIC &quot;-//Apple Computer//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
-&quot;&quot;&quot;
-
-class PlistWriter(DumbXMLWriter):
-
-    def __init__(self, file, indentLevel=0, indent=&quot;\t&quot;, writeHeader=1):
-        if writeHeader:
-            file.write(PLISTHEADER)
-        DumbXMLWriter.__init__(self, file, indentLevel, indent)
-
-    def writeValue(self, value):
-        if isinstance(value, (str, unicode)):
-            self.simpleElement(&quot;string&quot;, value)
-        elif isinstance(value, bool):
-            # must switch for bool before int, as bool is a
-            # subclass of int...
-            if value:
-                self.simpleElement(&quot;true&quot;)
-            else:
-                self.simpleElement(&quot;false&quot;)
-        elif isinstance(value, int):
-            self.simpleElement(&quot;integer&quot;, str(value))
-        elif isinstance(value, float):
-            self.simpleElement(&quot;real&quot;, repr(value))
-        elif isinstance(value, dict):
-            self.writeDict(value)
-        elif isinstance(value, Data):
-            self.writeData(value)
-        elif isinstance(value, datetime.datetime):
-            self.simpleElement(&quot;date&quot;, _dateToString(value))
-        elif isinstance(value, (tuple, list)):
-            self.writeArray(value)
-        else:
-            raise TypeError(&quot;unsuported type: %s&quot; % type(value))
-
-    def writeData(self, data):
-        self.beginElement(&quot;data&quot;)
-        self.indentLevel -= 1
-        maxlinelength = 76 - len(self.indent.replace(&quot;\t&quot;, &quot; &quot; * 8) *
-                                 self.indentLevel)
-        for line in data.asBase64(maxlinelength).split(&quot;\n&quot;):
-            if line:
-                self.writeln(line)
-        self.indentLevel += 1
-        self.endElement(&quot;data&quot;)
-
-    def writeDict(self, d):
-        self.beginElement(&quot;dict&quot;)
-        for key, value in sorted(d.items()):
-            if not isinstance(key, (str, unicode)):
-                raise TypeError(&quot;keys must be strings&quot;)
-            self.simpleElement(&quot;key&quot;, key)
-            self.writeValue(value)
-        self.endElement(&quot;dict&quot;)
-
-    def writeArray(self, array):
-        self.beginElement(&quot;array&quot;)
-        for value in array:
-            self.writeValue(value)
-        self.endElement(&quot;array&quot;)
-
-
-class _InternalDict(dict):
-
-    # This class is needed while Dict is scheduled for deprecation:
-    # we only need to warn when a *user* instantiates Dict or when
-    # the &quot;attribute notation for dict keys&quot; is used.
-
-    def __getattr__(self, attr):
-        try:
-            value = self[attr]
-        except KeyError:
-            raise AttributeError, attr
-        from warnings import warn
-        warn(&quot;Attribute access from plist dicts is deprecated, use d[key] &quot;
-             &quot;notation instead&quot;, PendingDeprecationWarning)
-        return value
-
-    def __setattr__(self, attr, value):
-        from warnings import warn
-        warn(&quot;Attribute access from plist dicts is deprecated, use d[key] &quot;
-             &quot;notation instead&quot;, PendingDeprecationWarning)
-        self[attr] = value
-
-    def __delattr__(self, attr):
-        try:
-            del self[attr]
-        except KeyError:
-            raise AttributeError, attr
-        from warnings import warn
-        warn(&quot;Attribute access from plist dicts is deprecated, use d[key] &quot;
-             &quot;notation instead&quot;, PendingDeprecationWarning)
-
-class Dict(_InternalDict):
-
-    def __init__(self, **kwargs):
-        from warnings import warn
-        warn(&quot;The plistlib.Dict class is deprecated, use builtin dict instead&quot;,
-             PendingDeprecationWarning)
-        super(Dict, self).__init__(**kwargs)
-
-
-class Plist(_InternalDict):
-
-    &quot;&quot;&quot;This class has been deprecated. Use readPlist() and writePlist()
-    functions instead, together with regular dict objects.
-    &quot;&quot;&quot;
-
-    def __init__(self, **kwargs):
-        from warnings import warn
-        warn(&quot;The Plist class is deprecated, use the readPlist() and &quot;
-             &quot;writePlist() functions instead&quot;, PendingDeprecationWarning)
-        super(Plist, self).__init__(**kwargs)
-
-    def fromFile(cls, pathOrFile):
-        &quot;&quot;&quot;Deprecated. Use the readPlist() function instead.&quot;&quot;&quot;
-        rootObject = readPlist(pathOrFile)
-        plist = cls()
-        plist.update(rootObject)
-        return plist
-    fromFile = classmethod(fromFile)
-
-    def write(self, pathOrFile):
-        &quot;&quot;&quot;Deprecated. Use the writePlist() function instead.&quot;&quot;&quot;
-        writePlist(self, pathOrFile)
-
-
-def _encodeBase64(s, maxlinelength=76):
-    # copied from base64.encodestring(), with added maxlinelength argument
-    maxbinsize = (maxlinelength//4)*3
-    pieces = []
-    for i in xrange(0, len(s), maxbinsize):
-        chunk = s[i : i + maxbinsize]
-        pieces.append(binascii.b2a_base64(chunk))
-    return &quot;&quot;.join(pieces)
-
-class Data:
-
-    &quot;&quot;&quot;Wrapper for binary data.&quot;&quot;&quot;
-
-    def __init__(self, data):
-        self.data = data
-
-    def fromBase64(cls, data):
-        # base64.decodestring just calls binascii.a2b_base64;
-        # it seems overkill to use both base64 and binascii.
-        return cls(binascii.a2b_base64(data))
-    fromBase64 = classmethod(fromBase64)
-
-    def asBase64(self, maxlinelength=76):
-        return _encodeBase64(self.data, maxlinelength)
-
-    def __cmp__(self, other):
-        if isinstance(other, self.__class__):
-            return cmp(self.data, other.data)
-        elif isinstance(other, str):
-            return cmp(self.data, other)
-        else:
-            return cmp(id(self), id(other))
-
-    def __repr__(self):
-        return &quot;%s(%s)&quot; % (self.__class__.__name__, repr(self.data))
-
-
-class PlistParser:
-
-    def __init__(self):
-        self.stack = []
-        self.currentKey = None
-        self.root = None
-
-    def parse(self, fileobj):
-        from xml.parsers.expat import ParserCreate
-        parser = ParserCreate()
-        parser.StartElementHandler = self.handleBeginElement
-        parser.EndElementHandler = self.handleEndElement
-        parser.CharacterDataHandler = self.handleData
-        parser.ParseFile(fileobj)
-        return self.root
-
-    def handleBeginElement(self, element, attrs):
-        self.data = []
-        handler = getattr(self, &quot;begin_&quot; + element, None)
-        if handler is not None:
-            handler(attrs)
-
-    def handleEndElement(self, element):
-        handler = getattr(self, &quot;end_&quot; + element, None)
-        if handler is not None:
-            handler()
-
-    def handleData(self, data):
-        self.data.append(data)
-
-    def addObject(self, value):
-        if self.currentKey is not None:
-            self.stack[-1][self.currentKey] = value
-            self.currentKey = None
-        elif not self.stack:
-            # this is the root object
-            self.root = value
-        else:
-            self.stack[-1].append(value)
-
-    def getData(self):
-        data = &quot;&quot;.join(self.data)
-        try:
-            data = data.encode(&quot;ascii&quot;)
-        except UnicodeError:
-            pass
-        self.data = []
-        return data
-
-    # element handlers
-
-    def begin_dict(self, attrs):
-        d = _InternalDict()
-        self.addObject(d)
-        self.stack.append(d)
-    def end_dict(self):
-        self.stack.pop()
-
-    def end_key(self):
-        self.currentKey = self.getData()
-
-    def begin_array(self, attrs):
-        a = []
-        self.addObject(a)
-        self.stack.append(a)
-    def end_array(self):
-        self.stack.pop()
-
-    def end_true(self):
-        self.addObject(True)
-    def end_false(self):
-        self.addObject(False)
-    def end_integer(self):
-        self.addObject(int(self.getData()))
-    def end_real(self):
-        self.addObject(float(self.getData()))
-    def end_string(self):
-        self.addObject(self.getData())
-    def end_data(self):
-        self.addObject(Data.fromBase64(self.getData()))
-    def end_date(self):
-        self.addObject(_dateFromString(self.getData()))
</del></span></pre></div>
<a id="CalendarServertrunktwextpythonplistlibpy"></a>
<div class="delfile"><h4>Deleted: CalendarServer/trunk/twext/python/plistlib.py (12061 => 12062)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twext/python/plistlib.py        2013-12-13 00:20:12 UTC (rev 12061)
+++ CalendarServer/trunk/twext/python/plistlib.py        2013-12-13 00:35:58 UTC (rev 12062)
</span><span class="lines">@@ -1,23 +0,0 @@
</span><del>-##
-# Copyright (c) 2008-2013 Apple Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##
-
-try:
-    _plistlib = __import__(&quot;plistlib&quot;)
-except ImportError:
-    from twext.python import _plistlib
-
-import sys
-sys.modules[__name__] = _plistlib
</del></span></pre></div>
<a id="CalendarServertrunktwistedcaldavbackuppy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/backup.py (12061 => 12062)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/backup.py        2013-12-13 00:20:12 UTC (rev 12061)
+++ CalendarServer/trunk/twistedcaldav/backup.py        2013-12-13 00:35:58 UTC (rev 12062)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx"> import fnmatch
</span><span class="cx"> import commands
</span><span class="cx"> 
</span><del>-from twext.python.plistlib import readPlist
</del><ins>+from plistlib import readPlist
</ins><span class="cx"> 
</span><span class="cx"> VERBOSE = os.environ.get('VERBOSE', False)
</span><span class="cx"> FUNCLOG = os.environ.get('FUNCLOG', False)
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavstdconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py (12061 => 12062)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/stdconfig.py        2013-12-13 00:20:12 UTC (rev 12061)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py        2013-12-13 00:35:58 UTC (rev 12062)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> 
</span><span class="cx"> from twisted.python.runtime import platform
</span><span class="cx"> 
</span><del>-from twext.python.plistlib import PlistParser #@UnresolvedImport
</del><ins>+from plistlib import PlistParser #@UnresolvedImport
</ins><span class="cx"> from twext.python.log import Logger, InvalidLogLevelError, LogLevel
</span><span class="cx"> from twext.web2.dav.resource import TwistedACLInheritable
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_configpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_config.py (12061 => 12062)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_config.py        2013-12-13 00:20:12 UTC (rev 12061)
+++ CalendarServer/trunk/twistedcaldav/test/test_config.py        2013-12-13 00:35:58 UTC (rev 12062)
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx"> 
</span><span class="cx"> import socket
</span><span class="cx"> 
</span><del>-from twext.python.plistlib import writePlist #@UnresolvedImport
</del><ins>+from plistlib import writePlist #@UnresolvedImport
</ins><span class="cx"> from twext.python.log import LogLevel
</span><span class="cx"> from twext.python.test.test_log import defaultLogLevel, logLevelForNamespace
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>