<!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>[11900] CalendarServer/branches/users/cdaboo/reverse-proxy-pods</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/11900">11900</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2013-11-06 18:00:24 -0800 (Wed, 06 Nov 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge from trunk.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesuserscdabooreverseproxypodsHACKING">CalendarServer/branches/users/cdaboo/reverse-proxy-pods/HACKING</a></li>
<li><a href="#CalendarServerbranchesuserscdabooreverseproxypodstwextwhodirectorypy">CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/directory.py</a></li>
<li><a href="#CalendarServerbranchesuserscdabooreverseproxypodstwextwhoidirectorypy">CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/idirectory.py</a></li>
<li><a href="#CalendarServerbranchesuserscdabooreverseproxypodstwextwhotesttest_aggregatepy">CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_aggregate.py</a></li>
<li><a href="#CalendarServerbranchesuserscdabooreverseproxypodstwextwhotesttest_directorypy">CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_directory.py</a></li>
<li><a href="#CalendarServerbranchesuserscdabooreverseproxypodstwextwhotesttest_utilpy">CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_util.py</a></li>
<li><a href="#CalendarServerbranchesuserscdabooreverseproxypodstwextwhotesttest_xmlpy">CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_xml.py</a></li>
<li><a href="#CalendarServerbranchesuserscdabooreverseproxypodstxdavcommondatastoreupgradesqlupgradescalendar_upgrade_from_3_to_4py">CalendarServer/branches/users/cdaboo/reverse-proxy-pods/txdav/common/datastore/upgrade/sql/upgrades/calendar_upgrade_from_3_to_4.py</a></li>
<li><a href="#CalendarServerbranchesuserscdabooreverseproxypodstxdavcommondatastoreupgradesqlupgradescalendar_upgrade_from_4_to_5py">CalendarServer/branches/users/cdaboo/reverse-proxy-pods/txdav/common/datastore/upgrade/sql/upgrades/calendar_upgrade_from_4_to_5.py</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#CalendarServerbranchesuserscdabooreverseproxypods">CalendarServer/branches/users/cdaboo/reverse-proxy-pods/</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesuserscdabooreverseproxypods"></a>
<div class="propset"><h4>Property changes: CalendarServer/branches/users/cdaboo/reverse-proxy-pods</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4>Modified: svn:mergeinfo</h4></div>
<span class="cx">/CalendarServer/branches/config-separation:4379-4443
</span><span class="cx">/CalendarServer/branches/egg-info-351:4589-4625
</span><span class="cx">/CalendarServer/branches/generic-sqlstore:6167-6191
</span><span class="cx">/CalendarServer/branches/new-store:5594-5934
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile:5911-5935
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile-2:5936-5981
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-4.3-dev:10180-10190,10192
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.1-dev:11846
</span><span class="cx">/CalendarServer/branches/users/cdaboo/batchupload-6699:6700-7198
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cached-subscription-calendars-5692:5693-5702
</span><span class="cx">/CalendarServer/branches/users/cdaboo/component-set-fixes:8130-8346
</span><span class="cx">/CalendarServer/branches/users/cdaboo/directory-cache-on-demand-3627:3628-3644
</span><span class="cx">/CalendarServer/branches/users/cdaboo/fix-no-ischedule:11607-11871
</span><span class="cx">/CalendarServer/branches/users/cdaboo/implicituidrace:8137-8141
</span><span class="cx">/CalendarServer/branches/users/cdaboo/ischedule-dkim:9747-9979
</span><span class="cx">/CalendarServer/branches/users/cdaboo/managed-attachments:9985-10145
</span><span class="cx">/CalendarServer/branches/users/cdaboo/more-sharing-5591:5592-5601
</span><span class="cx">/CalendarServer/branches/users/cdaboo/partition-4464:4465-4957
</span><span class="cx">/CalendarServer/branches/users/cdaboo/performance-tweaks:11824-11836
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pods:7297-7377
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycalendar:7085-7206
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycard:7227-7237
</span><span class="cx">/CalendarServer/branches/users/cdaboo/queued-attendee-refreshes:7740-8287
</span><span class="cx">/CalendarServer/branches/users/cdaboo/relative-config-paths-5070:5071-5105
</span><span class="cx">/CalendarServer/branches/users/cdaboo/shared-calendars-5187:5188-5440
</span><span class="cx">/CalendarServer/branches/users/cdaboo/store-scheduling:10876-11129
</span><span class="cx">/CalendarServer/branches/users/cdaboo/timezones:7443-7699
</span><span class="cx">/CalendarServer/branches/users/cdaboo/txn-debugging:8730-8743
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroups-3:11088-11204
</span><span class="cx">/CalendarServer/branches/users/glyph/always-abort-txn-on-error:9958-9969
</span><span class="cx">/CalendarServer/branches/users/glyph/case-insensitive-uid:8772-8805
</span><span class="cx">/CalendarServer/branches/users/glyph/conn-limit:6574-6577
</span><span class="cx">/CalendarServer/branches/users/glyph/contacts-server-merge:4971-5080
</span><span class="cx">/CalendarServer/branches/users/glyph/dalify:6932-7023
</span><span class="cx">/CalendarServer/branches/users/glyph/db-reconnect:6824-6876
</span><span class="cx">/CalendarServer/branches/users/glyph/deploybuild:7563-7572
</span><span class="cx">/CalendarServer/branches/users/glyph/digest-auth-redux:10624-10635
</span><span class="cx">/CalendarServer/branches/users/glyph/disable-quota:7718-7727
</span><span class="cx">/CalendarServer/branches/users/glyph/dont-start-postgres:6592-6614
</span><span class="cx">/CalendarServer/branches/users/glyph/enforce-max-requests:11640-11643
</span><span class="cx">/CalendarServer/branches/users/glyph/hang-fix:11465-11491
</span><span class="cx">/CalendarServer/branches/users/glyph/imip-and-admin-html:7866-7984
</span><span class="cx">/CalendarServer/branches/users/glyph/ipv6-client:9054-9105
</span><span class="cx">/CalendarServer/branches/users/glyph/launchd-wrapper-bis:11413-11436
</span><span class="cx">/CalendarServer/branches/users/glyph/linux-tests:6893-6900
</span><span class="cx">/CalendarServer/branches/users/glyph/log-cleanups:11691-11731
</span><span class="cx">/CalendarServer/branches/users/glyph/migrate-merge:8690-8713
</span><span class="cx">/CalendarServer/branches/users/glyph/misc-portability-fixes:7365-7374
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-6:6322-6368
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-7:6369-6445
</span><span class="cx">/CalendarServer/branches/users/glyph/multiget-delete:8321-8330
</span><span class="cx">/CalendarServer/branches/users/glyph/new-export:7444-7485
</span><span class="cx">/CalendarServer/branches/users/glyph/one-home-list-api:10048-10073
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle:7106-7155
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle-nulls:7340-7351
</span><span class="cx">/CalendarServer/branches/users/glyph/other-html:8062-8091
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-sim:8240-8251
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade:8376-8400
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade_to_1:8571-8583
</span><span class="cx">/CalendarServer/branches/users/glyph/q:9560-9688
</span><span class="cx">/CalendarServer/branches/users/glyph/queue-locking-and-timing:10204-10289
</span><span class="cx">/CalendarServer/branches/users/glyph/quota:7604-7637
</span><span class="cx">/CalendarServer/branches/users/glyph/sendfdport:5388-5424
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-fixes:8436-8443
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-take2:8155-8174
</span><span class="cx">/CalendarServer/branches/users/glyph/sharedpool:6490-6550
</span><span class="cx">/CalendarServer/branches/users/glyph/sharing-api:9192-9205
</span><span class="cx">/CalendarServer/branches/users/glyph/skip-lonely-vtimezones:8524-8535
</span><span class="cx">/CalendarServer/branches/users/glyph/sql-store:5929-6073
</span><span class="cx">/CalendarServer/branches/users/glyph/start-service-start-loop:11060-11065
</span><span class="cx">/CalendarServer/branches/users/glyph/subtransactions:7248-7258
</span><span class="cx">/CalendarServer/branches/users/glyph/table-alias:8651-8664
</span><span class="cx">/CalendarServer/branches/users/glyph/uidexport:7673-7676
</span><span class="cx">/CalendarServer/branches/users/glyph/unshare-when-access-revoked:10562-10595
</span><span class="cx">/CalendarServer/branches/users/glyph/use-system-twisted:5084-5149
</span><span class="cx">/CalendarServer/branches/users/glyph/uuid-normalize:9268-9296
</span><span class="cx">/CalendarServer/branches/users/glyph/warning-cleanups:11347-11357
</span><span class="cx">/CalendarServer/branches/users/glyph/xattrs-from-files:7757-7769
</span><span class="cx">/CalendarServer/branches/users/sagen/applepush:8126-8184
</span><span class="cx">/CalendarServer/branches/users/sagen/inboxitems:7380-7381
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources:5032-5051
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources-2:5052-5061
</span><span class="cx">/CalendarServer/branches/users/sagen/purge_old_events:6735-6746
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4038:4040-4067
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4066:4068-4075
</span><span class="cx">/CalendarServer/branches/users/sagen/resources-2:5084-5093
</span><span class="cx">/CalendarServer/branches/users/sagen/testing:10827-10851,10853-10855
</span><span class="cx">/CalendarServer/branches/users/wsanchez/transations:5515-5593
</span><span class="cx">   + /CalDAVTester/trunk:11193-11198
</span><span class="cx">/CalendarServer/branches/config-separation:4379-4443
</span><span class="cx">/CalendarServer/branches/egg-info-351:4589-4625
</span><span class="cx">/CalendarServer/branches/generic-sqlstore:6167-6191
</span><span class="cx">/CalendarServer/branches/new-store:5594-5934
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile:5911-5935
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile-2:5936-5981
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-4.3-dev:10180-10190,10192
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.1-dev:11846
</span><span class="cx">/CalendarServer/branches/users/cdaboo/batchupload-6699:6700-7198
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cached-subscription-calendars-5692:5693-5702
</span><span class="cx">/CalendarServer/branches/users/cdaboo/component-set-fixes:8130-8346
</span><span class="cx">/CalendarServer/branches/users/cdaboo/directory-cache-on-demand-3627:3628-3644
</span><span class="cx">/CalendarServer/branches/users/cdaboo/fix-no-ischedule:11607-11871
</span><span class="cx">/CalendarServer/branches/users/cdaboo/implicituidrace:8137-8141
</span><span class="cx">/CalendarServer/branches/users/cdaboo/ischedule-dkim:9747-9979
</span><span class="cx">/CalendarServer/branches/users/cdaboo/managed-attachments:9985-10145
</span><span class="cx">/CalendarServer/branches/users/cdaboo/more-sharing-5591:5592-5601
</span><span class="cx">/CalendarServer/branches/users/cdaboo/partition-4464:4465-4957
</span><span class="cx">/CalendarServer/branches/users/cdaboo/performance-tweaks:11824-11836
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pods:7297-7377
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycalendar:7085-7206
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycard:7227-7237
</span><span class="cx">/CalendarServer/branches/users/cdaboo/queued-attendee-refreshes:7740-8287
</span><span class="cx">/CalendarServer/branches/users/cdaboo/relative-config-paths-5070:5071-5105
</span><span class="cx">/CalendarServer/branches/users/cdaboo/shared-calendars-5187:5188-5440
</span><span class="cx">/CalendarServer/branches/users/cdaboo/store-scheduling:10876-11129
</span><span class="cx">/CalendarServer/branches/users/cdaboo/timezones:7443-7699
</span><span class="cx">/CalendarServer/branches/users/cdaboo/txn-debugging:8730-8743
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroups-3:11088-11204
</span><span class="cx">/CalendarServer/branches/users/glyph/always-abort-txn-on-error:9958-9969
</span><span class="cx">/CalendarServer/branches/users/glyph/case-insensitive-uid:8772-8805
</span><span class="cx">/CalendarServer/branches/users/glyph/conn-limit:6574-6577
</span><span class="cx">/CalendarServer/branches/users/glyph/contacts-server-merge:4971-5080
</span><span class="cx">/CalendarServer/branches/users/glyph/dalify:6932-7023
</span><span class="cx">/CalendarServer/branches/users/glyph/db-reconnect:6824-6876
</span><span class="cx">/CalendarServer/branches/users/glyph/deploybuild:7563-7572
</span><span class="cx">/CalendarServer/branches/users/glyph/digest-auth-redux:10624-10635
</span><span class="cx">/CalendarServer/branches/users/glyph/disable-quota:7718-7727
</span><span class="cx">/CalendarServer/branches/users/glyph/dont-start-postgres:6592-6614
</span><span class="cx">/CalendarServer/branches/users/glyph/enforce-max-requests:11640-11643
</span><span class="cx">/CalendarServer/branches/users/glyph/hang-fix:11465-11491
</span><span class="cx">/CalendarServer/branches/users/glyph/imip-and-admin-html:7866-7984
</span><span class="cx">/CalendarServer/branches/users/glyph/ipv6-client:9054-9105
</span><span class="cx">/CalendarServer/branches/users/glyph/launchd-wrapper-bis:11413-11436
</span><span class="cx">/CalendarServer/branches/users/glyph/linux-tests:6893-6900
</span><span class="cx">/CalendarServer/branches/users/glyph/log-cleanups:11691-11731
</span><span class="cx">/CalendarServer/branches/users/glyph/migrate-merge:8690-8713
</span><span class="cx">/CalendarServer/branches/users/glyph/misc-portability-fixes:7365-7374
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-6:6322-6368
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-7:6369-6445
</span><span class="cx">/CalendarServer/branches/users/glyph/multiget-delete:8321-8330
</span><span class="cx">/CalendarServer/branches/users/glyph/new-export:7444-7485
</span><span class="cx">/CalendarServer/branches/users/glyph/one-home-list-api:10048-10073
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle:7106-7155
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle-nulls:7340-7351
</span><span class="cx">/CalendarServer/branches/users/glyph/other-html:8062-8091
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-sim:8240-8251
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade:8376-8400
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade_to_1:8571-8583
</span><span class="cx">/CalendarServer/branches/users/glyph/q:9560-9688
</span><span class="cx">/CalendarServer/branches/users/glyph/queue-locking-and-timing:10204-10289
</span><span class="cx">/CalendarServer/branches/users/glyph/quota:7604-7637
</span><span class="cx">/CalendarServer/branches/users/glyph/sendfdport:5388-5424
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-fixes:8436-8443
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-take2:8155-8174
</span><span class="cx">/CalendarServer/branches/users/glyph/sharedpool:6490-6550
</span><span class="cx">/CalendarServer/branches/users/glyph/sharing-api:9192-9205
</span><span class="cx">/CalendarServer/branches/users/glyph/skip-lonely-vtimezones:8524-8535
</span><span class="cx">/CalendarServer/branches/users/glyph/sql-store:5929-6073
</span><span class="cx">/CalendarServer/branches/users/glyph/start-service-start-loop:11060-11065
</span><span class="cx">/CalendarServer/branches/users/glyph/subtransactions:7248-7258
</span><span class="cx">/CalendarServer/branches/users/glyph/table-alias:8651-8664
</span><span class="cx">/CalendarServer/branches/users/glyph/uidexport:7673-7676
</span><span class="cx">/CalendarServer/branches/users/glyph/unshare-when-access-revoked:10562-10595
</span><span class="cx">/CalendarServer/branches/users/glyph/use-system-twisted:5084-5149
</span><span class="cx">/CalendarServer/branches/users/glyph/uuid-normalize:9268-9296
</span><span class="cx">/CalendarServer/branches/users/glyph/warning-cleanups:11347-11357
</span><span class="cx">/CalendarServer/branches/users/glyph/xattrs-from-files:7757-7769
</span><span class="cx">/CalendarServer/branches/users/sagen/applepush:8126-8184
</span><span class="cx">/CalendarServer/branches/users/sagen/inboxitems:7380-7381
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources:5032-5051
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources-2:5052-5061
</span><span class="cx">/CalendarServer/branches/users/sagen/purge_old_events:6735-6746
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4038:4040-4067
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4066:4068-4075
</span><span class="cx">/CalendarServer/branches/users/sagen/resources-2:5084-5093
</span><span class="cx">/CalendarServer/branches/users/sagen/testing:10827-10851,10853-10855
</span><span class="cx">/CalendarServer/branches/users/wsanchez/transations:5515-5593
</span><span class="cx">/CalendarServer/trunk:11875-11895
</span><a id="CalendarServerbranchesuserscdabooreverseproxypodsHACKING"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/reverse-proxy-pods/HACKING (11899 => 11900)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/reverse-proxy-pods/HACKING        2013-11-06 23:41:28 UTC (rev 11899)
+++ CalendarServer/branches/users/cdaboo/reverse-proxy-pods/HACKING        2013-11-07 02:00:24 UTC (rev 11900)
</span><span class="lines">@@ -144,10 +144,6 @@
</span><span class="cx"> 
</span><span class="cx"> PEP-8 items we do not follow:
</span><span class="cx"> 
</span><del>- * Lines need not be limited to 79 spaces, but longer lines are
-   undesirable.  If you can easily do so, try to keep lines under 80
-   columns.
-
</del><span class="cx">  * PEP-8 recommends using a backslash to break long lines up:
</span><span class="cx"> 
</span><span class="cx">    ::
</span><span class="lines">@@ -181,14 +177,6 @@
</span><span class="cx"> 
</span><span class="cx">    Because that's just silly.
</span><span class="cx"> 
</span><del>- * Lining up assignments is OK, within reason:
-
-   ::
-
-     cars       =  4
-     motorbikes =  8
-     bicycles   = 18
-
</del><span class="cx"> Additions:
</span><span class="cx"> 
</span><span class="cx">  * Close parentheses and brackets such as ``()``, ``[]`` and ``{}`` at the
</span><span class="lines">@@ -248,9 +236,8 @@
</span><span class="cx"> 
</span><span class="cx">      process = subprocess.Popen(...)
</span><span class="cx"> 
</span><del>-   This makes code shorter and removes the runtime indirection (which
-   can be relevant in tight loops). It also makes it easier to replace
-   one implementation with another.
</del><ins>+   This makes code shorter and makes it easier to replace one implementation
+   with another.
</ins><span class="cx"> 
</span><span class="cx">  * All files should have an ``__all__`` specification.  Put them at the
</span><span class="cx">    top of the file, before imports (PEP-8 puts them at the top, but
</span><span class="lines">@@ -259,8 +246,8 @@
</span><span class="cx"> 
</span><span class="cx">  * It is more important that symbol names are meaningful than it is
</span><span class="cx">    that they be concise.  ``x`` is rarely an appropriate name for a
</span><del>-   variable.  ``transmogrifierStatus`` is more useful to the reader
-   than ``trmgStat``; avoid contractions.
</del><ins>+   variable.  Avoid contractions: ``transmogrifierStatus`` is more useful
+   to the reader than ``trmgStat``.
</ins><span class="cx"> 
</span><span class="cx">  * A deferred that will be immediately returned may be called ``d``:
</span><span class="cx"> 
</span><span class="lines">@@ -271,9 +258,7 @@
</span><span class="cx">      d.addErrback(onError)
</span><span class="cx">      return d
</span><span class="cx"> 
</span><del>- * We prefer ``inlineCallbacks`` over ``deferredGenerator``.
-   ``inlineCallbacks`` are more readable, and we do not support Python
-   versions old enough that ``deferredGenerator`` would be necessary.
</del><ins>+ * Do not use ``deferredGenerator``.  Use ``inlineCallbacks`` instead.
</ins><span class="cx"> 
</span><span class="cx">  * That said, avoid using ``inlineCallbacks`` when chaining deferreds
</span><span class="cx">    is straightforward, as they are more expensive.  Use
</span><span class="lines">@@ -306,17 +291,29 @@
</span><span class="cx">    Use of underscores is reserved for implied dispatching and the like
</span><span class="cx">    (eg. ``http_FOO()``).  See the Twisted Coding Standard for details.
</span><span class="cx"> 
</span><del>- * Always use a tuple when using ``%``-formatting, even when only one
-   value is being provided:
</del><ins>+ * Do not use ``%``-formatting:
</ins><span class="cx"> 
</span><span class="cx">    ::
</span><span class="cx"> 
</span><span class="cx">      error = &quot;Unexpected value: %s&quot; % (value,)
</span><span class="cx"> 
</span><del>-   Do not use the non-tuple form:
</del><ins>+   Use PEP-3101 formatting instead:
</ins><span class="cx"> 
</span><span class="cx">    ::
</span><span class="cx"> 
</span><ins>+     error = &quot;Unexpected value: {value}&quot;.format(value=value)
+
+ * If you must use ``%``-formatting for some reason, always use a tuple as
+   the format argument, even when only one value is being provided:
+
+   ::
+
+     error = &quot;Unexpected value: %s&quot; % (value,)
+
+   Never use the non-tuple form:
+
+   ::
+
</ins><span class="cx">      error = &quot;Unexpected value: %s&quot; % value
</span><span class="cx"> 
</span><span class="cx">    Which is allowed in Python, but results in a programming error if
</span><span class="lines">@@ -329,8 +326,9 @@
</span><span class="cx">      numbers = (1,2,3,) # No
</span><span class="cx">      numbers = (1,2,3)  # Yes
</span><span class="cx"> 
</span><del>-   It's desirable on multiple lines, though, as that makes re-ordering
-   items easy, and avoids a diff on the last line when adding another:
</del><ins>+   The trailing comma is desirable on multiple lines, though, as that makes
+   re-ordering items easy, and avoids a diff on the last line when adding
+   another:
</ins><span class="cx"> 
</span><span class="cx">    ::
</span><span class="cx"> 
</span><span class="lines">@@ -368,11 +366,11 @@
</span><span class="cx"> ==============
</span><span class="cx"> 
</span><span class="cx">  * If a callable is going to return a Deferred some of the time, it
</span><del>-   should probably return a deferred all of the time.  Return
-   ``succeed(value)`` instead of ``value`` if necessary.  This avoids
-   forcing the caller to check as to whether the value is a deferred
-   or not (eg. by using ``maybeDeferred()``), which is both annoying
-   to code and potentially expensive at runtime.
</del><ins>+   should return a deferred all of the time.  Return ``succeed(value)``
+   instead of ``value`` if necessary.  This avoids forcing the caller
+   to check as to whether the value is a deferred or not (eg. by using
+   ``maybeDeferred()``), which is both annoying to code and potentially
+   expensive at runtime.
</ins><span class="cx"> 
</span><span class="cx">  * Be proactive about closing files and file-like objects.
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdabooreverseproxypodstwextwhodirectorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/directory.py (11899 => 11900)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/directory.py        2013-11-06 23:41:28 UTC (rev 11899)
+++ CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/directory.py        2013-11-07 02:00:24 UTC (rev 11900)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> 
</span><span class="cx"> from uuid import UUID
</span><span class="cx"> 
</span><del>-from zope.interface import implements
</del><ins>+from zope.interface import implementer
</ins><span class="cx"> 
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span><span class="cx"> from twisted.internet.defer import succeed, fail
</span><span class="lines">@@ -40,19 +40,63 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+@implementer(IDirectoryService)
</ins><span class="cx"> class DirectoryService(object):
</span><del>-    implements(IDirectoryService)
</del><ins>+    &quot;&quot;&quot;
+    Generic implementation of L{IDirectoryService}.
</ins><span class="cx"> 
</span><ins>+    This is a complete implementation of L{IDirectoryService}, with support for
+    the query operands in L{Operand}.
+
+    The C{recordsWith*} methods are all implemented in terms of
+    L{recordsWithFieldValue}, which is in turn implemented in terms of
+    L{recordsFromExpression}.
+    L{recordsFromQuery} is also implemented in terms of
+    {recordsFromExpression}.
+
+    L{recordsFromExpression} (and therefore most uses of the other methods)
+    will always fail with a L{QueryNotSupportedError}.
+
+    A subclass should therefore override L{recordsFromExpression} with an
+    implementation that handles any queries that it can support and its
+    superclass' implementation with any query it cannot support.
+
+    A subclass may override L{recordsFromQuery} if it is to support additional
+    operands.
+
+    L{updateRecords} and L{removeRecords} will fail with L{NotAllowedError}
+    when asked to modify data.
+    A subclass should override these methods if is to allow editing of
+    directory information.
+
+    @cvar recordType: a L{Names} class or compatible object (eg.
+        L{ConstantsContainer}) which contains the L{NamedConstant}s denoting
+        the record types that are supported by this directory service.
+
+    @cvar fieldName: a L{Names} class or compatible object (eg.
+        L{ConstantsContainer}) which contains the L{NamedConstant}s denoting
+        the record field names that are supported by this directory service.
+
+    @cvar normalizedFields: a L{dict} mapping of (ie. L{NamedConstant}s
+        contained in the C{fieldName} class variable) to callables that take
+        a field value (a L{unicode}) and return a normalized field value (also
+        a L{unicode}).
+    &quot;&quot;&quot;
+
</ins><span class="cx">     recordType = RecordType
</span><span class="cx">     fieldName  = FieldName
</span><span class="cx"> 
</span><span class="cx">     normalizedFields = {
</span><span class="cx">         FieldName.guid: lambda g: UUID(g).hex,
</span><del>-        FieldName.emailAddresses: lambda e: e.lower(),
</del><ins>+        FieldName.emailAddresses: lambda e: bytes(e).lower(),
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def __init__(self, realmName):
</span><ins>+        &quot;&quot;&quot;
+        @param realmName: a realm name
+        @type realmName: unicode
+        &quot;&quot;&quot;
</ins><span class="cx">         self.realmName = realmName
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -70,11 +114,30 @@
</span><span class="cx">     def recordsFromExpression(self, expression, records=None):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Finds records matching a single expression.
</span><del>-        @param expression: an expression
</del><ins>+
+        @note: The implementation in L{DirectoryService} always raises
+            L{QueryNotSupportedError}.
+
+        @note: This L{DirectoryService} adds a C{records} keyword argument to
+            the interface defined by L{IDirectoryService}.
+            This allows the implementation of
+            L{DirectoryService.recordsFromQuery} to narrow the scope of records
+            being searched as it applies expressions.
+            This is therefore relevant to subclasses, which need to support the
+            added parameter, but not to users of L{IDirectoryService}.
+
+        @param expression: an expression to apply
</ins><span class="cx">         @type expression: L{object}
</span><del>-        @param records: a set of records to search within. C{None} if
</del><ins>+
+        @param records: a set of records to limit the search to. C{None} if
</ins><span class="cx">             the whole directory should be searched.
</span><span class="cx">         @type records: L{set} or L{frozenset}
</span><ins>+
+        @return: The matching records.
+        @rtype: deferred iterable of L{IDirectoryRecord}s
+
+        @raises: L{QueryNotSupportedError} if the expression is not
+            supported by this directory service.
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         return fail(QueryNotSupportedError(
</span><span class="cx">             &quot;Unknown expression: {0}&quot;.format(expression)
</span><span class="lines">@@ -158,17 +221,32 @@
</span><span class="cx">     def updateRecords(self, records, create=False):
</span><span class="cx">         for record in records:
</span><span class="cx">             return fail(NotAllowedError(&quot;Record updates not allowed.&quot;))
</span><ins>+        return succeed(None)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def removeRecords(self, uids):
</span><span class="cx">         for uid in uids:
</span><span class="cx">             return fail(NotAllowedError(&quot;Record removal not allowed.&quot;))
</span><ins>+        return succeed(None)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+@implementer(IDirectoryRecord)
</ins><span class="cx"> class DirectoryRecord(object):
</span><del>-    implements(IDirectoryRecord)
</del><ins>+    &quot;&quot;&quot;
+    Generic implementation of L{IDirectoryService}.
</ins><span class="cx"> 
</span><ins>+    This is an incomplete implementation of L{IDirectoryRecord}.
+
+    L{groups} will always fail with L{NotImplementedError} and L{members} will
+    do so if this is a group record.
+    A subclass should override these methods to support group membership and
+    complete this implementation.
+
+    @cvar requiredFields: an iterable of field names that must be present in
+        all directory records.
+    &quot;&quot;&quot;
+
</ins><span class="cx">     requiredFields = (
</span><span class="cx">         FieldName.uid,
</span><span class="cx">         FieldName.recordType,
</span><span class="lines">@@ -285,9 +363,11 @@
</span><span class="cx"> 
</span><span class="cx">     def members(self):
</span><span class="cx">         if self.recordType == RecordType.group:
</span><del>-            raise NotImplementedError(&quot;Subclasses must implement members()&quot;)
</del><ins>+            return fail(
+                NotImplementedError(&quot;Subclasses must implement members()&quot;)
+            )
</ins><span class="cx">         return succeed(())
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def groups(self):
</span><del>-        raise NotImplementedError(&quot;Subclasses must implement groups()&quot;)
</del><ins>+        return fail(NotImplementedError(&quot;Subclasses must implement groups()&quot;))
</ins></span></pre></div>
<a id="CalendarServerbranchesuserscdabooreverseproxypodstwextwhoidirectorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/idirectory.py (11899 => 11900)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/idirectory.py        2013-11-06 23:41:28 UTC (rev 11899)
+++ CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/idirectory.py        2013-11-07 02:00:24 UTC (rev 11900)
</span><span class="lines">@@ -42,9 +42,9 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-##
</del><ins>+#
</ins><span class="cx"> # Exceptions
</span><del>-##
</del><ins>+#
</ins><span class="cx"> 
</span><span class="cx"> class DirectoryServiceError(Exception):
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> 
</span><span class="cx"> class DirectoryConfigurationError(DirectoryServiceError):
</span><span class="cx">     &quot;&quot;&quot;
</span><del>-    Directory configurtion error.
</del><ins>+    Directory configuration error.
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -93,16 +93,19 @@
</span><span class="cx"> 
</span><span class="cx"> class NotAllowedError(DirectoryServiceError):
</span><span class="cx">     &quot;&quot;&quot;
</span><del>-    Apparently, you can't do that.
</del><ins>+    It seems you aren't permitted to do that.
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-##
</del><ins>+#
</ins><span class="cx"> # Data Types
</span><del>-##
</del><ins>+#
</ins><span class="cx"> 
</span><span class="cx"> class RecordType(Names):
</span><ins>+    &quot;&quot;&quot;
+    Constants for common directory record types.
+    &quot;&quot;&quot;
</ins><span class="cx">     user  = NamedConstant()
</span><span class="cx">     group = NamedConstant()
</span><span class="cx"> 
</span><span class="lines">@@ -113,7 +116,31 @@
</span><span class="cx"> 
</span><span class="cx"> class FieldName(Names):
</span><span class="cx">     &quot;&quot;&quot;
</span><del>-    Constants for common field names.
</del><ins>+    Constants for common directory record field names.
+
+    Fields as assciated with either a single value or an iterable of values.
+
+    @cvar uid: The primary unique identifier for a directory record.
+        The associated value must be a L{unicode}.
+
+    @cvar guid: The globally unique identifier for a directory record.
+        The associated value must be a L{UUID} or C{None}.
+
+    @cvar recordType: The type of a directory record.
+        The associated value must be a L{NamedConstant}.
+
+    @cvar shortNames: The short names for a directory record.
+        The associated values must L{unicode}s and there must be at least
+        one associated value.
+
+    @cvar fullNames: The full names for a directory record.
+        The associated values must be L{unicode}s.
+
+    @cvar emailAddresses: The email addresses for a directory record.
+        The associated values must be L{unicodes}.
+
+    @cvar password: The clear text password for a directory record.
+        The associated value must be a L{unicode} or C{None}.
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     uid            = NamedConstant()
</span><span class="cx">     guid           = NamedConstant()
</span><span class="lines">@@ -138,11 +165,20 @@
</span><span class="cx"> 
</span><span class="cx">     @staticmethod
</span><span class="cx">     def isMultiValue(name):
</span><ins>+        &quot;&quot;&quot;
+        Check for whether a field is multi-value (as opposed to single-value).
+
+        @return: C{True} if the field is multi-value, C{False} otherwise.
+        @rtype: L{BOOL}
+        &quot;&quot;&quot;
</ins><span class="cx">         return getattr(name, &quot;multiValue&quot;, False)
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> class Operand(Names):
</span><ins>+    &quot;&quot;&quot;
+    Contants for common operands.
+    &quot;&quot;&quot;
</ins><span class="cx">     OR  = NamedConstant()
</span><span class="cx">     AND = NamedConstant()
</span><span class="cx"> 
</span><span class="lines">@@ -151,9 +187,9 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-##
</del><ins>+#
</ins><span class="cx"> # Interfaces
</span><del>-##
</del><ins>+#
</ins><span class="cx"> 
</span><span class="cx"> class IDirectoryService(Interface):
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="lines">@@ -169,7 +205,15 @@
</span><span class="cx"> 
</span><span class="cx">     A directory service may allow support the editing, removal and
</span><span class="cx">     addition of records.
</span><ins>+    Services are read-only should fail with L{NotAllowedError} in editing
+    methods.
+
+    The L{FieldName.uid} field, the L{FieldName.guid} field (if not C{None}),
+    and the combination of the L{FieldName.recordType} and
+    L{FieldName.shortName} fields must be unique to each directory record
+    vended by a directory service.
</ins><span class="cx">     &quot;&quot;&quot;
</span><ins>+
</ins><span class="cx">     realmName = Attribute(
</span><span class="cx">         &quot;The name of the authentication realm this service represents.&quot;
</span><span class="cx">     )
</span><span class="lines">@@ -177,8 +221,10 @@
</span><span class="cx"> 
</span><span class="cx">     def recordTypes():
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        @return: an iterable of L{NamedConstant}s denoting the record
-            types that are kept in this directory.
</del><ins>+        Get the record types supported by this directory service.
+
+        @return: The record types that are supported by this directory service.
+        @rtype: iterable of L{NamedConstant}s
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -189,7 +235,8 @@
</span><span class="cx">         @param expression: an expression to apply
</span><span class="cx">         @type expression: L{object}
</span><span class="cx"> 
</span><del>-        @return: a deferred iterable of matching L{IDirectoryRecord}s.
</del><ins>+        @return: The matching records.
+        @rtype: deferred iterable of L{IDirectoryRecord}s
</ins><span class="cx"> 
</span><span class="cx">         @raises: L{QueryNotSupportedError} if the expression is not
</span><span class="cx">             supported by this directory service.
</span><span class="lines">@@ -207,7 +254,8 @@
</span><span class="cx">         @param operand: an operand
</span><span class="cx">         @type operand: a L{NamedConstant}
</span><span class="cx"> 
</span><del>-        @return: a deferred iterable of matching L{IDirectoryRecord}s.
</del><ins>+        @return: The matching records.
+        @rtype: deferred iterable of L{IDirectoryRecord}s
</ins><span class="cx"> 
</span><span class="cx">         @raises: L{QueryNotSupportedError} if the query is not
</span><span class="cx">             supported by this directory service.
</span><span class="lines">@@ -225,7 +273,8 @@
</span><span class="cx">         @param value: a value to match
</span><span class="cx">         @type value: L{bytes}
</span><span class="cx"> 
</span><del>-        @return: a deferred iterable of L{IDirectoryRecord}s.
</del><ins>+        @return: The matching records.
+        @rtype: deferred iterable of L{IDirectoryRecord}s
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -236,8 +285,8 @@
</span><span class="cx">         @param uid: a UID
</span><span class="cx">         @type uid: L{bytes}
</span><span class="cx"> 
</span><del>-        @return: a deferred iterable of L{IDirectoryRecord}s, or
-            C{None} if there is no such record.
</del><ins>+        @return: The matching record or C{None} if there is no match.
+        @rtype: deferred L{IDirectoryRecord}s or C{None}
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -248,8 +297,8 @@
</span><span class="cx">         @param guid: a GUID
</span><span class="cx">         @type guid: L{bytes}
</span><span class="cx"> 
</span><del>-        @return: a deferred iterable of L{IDirectoryRecord}s, or
-            C{None} if there is no such record.
</del><ins>+        @return: The matching record or C{None} if there is no match.
+        @rtype: deferred L{IDirectoryRecord}s or C{None}
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -260,7 +309,8 @@
</span><span class="cx">         @param recordType: a record type
</span><span class="cx">         @type recordType: L{NamedConstant}
</span><span class="cx"> 
</span><del>-        @return: a deferred iterable of L{IDirectoryRecord}s.
</del><ins>+        @return: The matching records.
+        @rtype: deferred iterable of L{IDirectoryRecord}s
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -274,8 +324,8 @@
</span><span class="cx">         @param shortName: a short name
</span><span class="cx">         @type shortName: L{bytes}
</span><span class="cx"> 
</span><del>-        @return: a deferred iterable of L{IDirectoryRecord}s, or
-            C{None} if there is no such record.
</del><ins>+        @return: The matching record or C{None} if there is no match.
+        @rtype: deferred L{IDirectoryRecord}s or C{None}
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -286,8 +336,8 @@
</span><span class="cx">         @param emailAddress: an email address
</span><span class="cx">         @type emailAddress: L{bytes}
</span><span class="cx"> 
</span><del>-        @return: a deferred iterable of L{IDirectoryRecord}s, or
-            C{None} if there is no such record.
</del><ins>+        @return: The matching records.
+        @rtype: deferred iterable of L{IDirectoryRecord}s
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -300,6 +350,12 @@
</span><span class="cx"> 
</span><span class="cx">         @param create: if true, create records if necessary
</span><span class="cx">         @type create: boolean
</span><ins>+
+        @return: unspecifiied
+        @rtype: deferred object
+
+        @raises L{NotAllowedError}: if the update is not allowed by the
+            directory service.
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -309,6 +365,12 @@
</span><span class="cx"> 
</span><span class="cx">         @param uids: the UIDs of the records to remove
</span><span class="cx">         @type uids: iterable of L{bytes}
</span><ins>+
+        @return: unspecifiied
+        @rtype: deferred object
+
+        @raises L{NotAllowedError}: if the removal is not allowed by the
+            directory service.
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -349,6 +411,7 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Find the records that are members of this group.  Only direct
</span><span class="cx">         members are included; members of members are not expanded.
</span><ins>+
</ins><span class="cx">         @return: a deferred iterable of L{IDirectoryRecord}s which are
</span><span class="cx">             direct members of this group.
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="lines">@@ -359,6 +422,7 @@
</span><span class="cx">         Find the group records that this record is a member of.  Only
</span><span class="cx">         groups for which this record is a direct member is are
</span><span class="cx">         included; membership is not expanded.
</span><ins>+
</ins><span class="cx">         @return: a deferred iterable of L{IDirectoryRecord}s which are
</span><span class="cx">             groups that this record is a member of.
</span><span class="cx">         &quot;&quot;&quot;
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdabooreverseproxypodstwextwhotesttest_aggregatepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_aggregate.py (11899 => 11900)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_aggregate.py        2013-11-06 23:41:28 UTC (rev 11899)
+++ CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_aggregate.py        2013-11-07 02:00:24 UTC (rev 11900)
</span><span class="lines">@@ -26,7 +26,8 @@
</span><span class="cx"> from twext.who.util import ConstantsContainer
</span><span class="cx"> 
</span><span class="cx"> from twext.who.test import test_directory, test_xml
</span><del>-from twext.who.test.test_xml import QueryMixIn, xmlService, TestService as XMLTestService
</del><ins>+from twext.who.test.test_xml import QueryMixIn, xmlService
+from twext.who.test.test_xml import TestService as XMLTestService
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -68,7 +69,10 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryServiceImmutableTest(BaseTest, test_directory.DirectoryServiceImmutableTest):
</del><ins>+class DirectoryServiceImmutableTest(
+    BaseTest,
+    test_directory.BaseDirectoryServiceImmutableTest,
+):
</ins><span class="cx">     pass
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -81,24 +85,39 @@
</span><span class="cx">         class GroupsDirectoryService(XMLTestService):
</span><span class="cx">             recordType = ConstantsContainer((XMLTestService.recordType.group,))
</span><span class="cx"> 
</span><del>-        usersService  = self.xmlService(testXMLConfigUsers, UsersDirectoryService)
-        groupsService = self.xmlService(testXMLConfigGroups, GroupsDirectoryService)
</del><ins>+        usersService = self.xmlService(
+            testXMLConfigUsers,
+            UsersDirectoryService
+        )
+        groupsService = self.xmlService(
+            testXMLConfigGroups,
+            GroupsDirectoryService
+        )
</ins><span class="cx"> 
</span><span class="cx">         return BaseTest.service(self, (usersService, groupsService))
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryServiceAggregatedBaseTest(AggregatedBaseTest, DirectoryServiceBaseTest):
</del><ins>+class DirectoryServiceAggregatedBaseTest(
+    AggregatedBaseTest,
+    DirectoryServiceBaseTest,
+):
</ins><span class="cx">     pass
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryServiceAggregatedQueryTest(AggregatedBaseTest, test_xml.DirectoryServiceQueryTest):
</del><ins>+class DirectoryServiceAggregatedQueryTest(
+    AggregatedBaseTest,
+    test_xml.DirectoryServiceQueryTest,
+):
</ins><span class="cx">     pass
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryServiceAggregatedImmutableTest(AggregatedBaseTest, test_directory.DirectoryServiceImmutableTest):
</del><ins>+class DirectoryServiceAggregatedImmutableTest(
+    AggregatedBaseTest,
+    test_directory.BaseDirectoryServiceImmutableTest,
+):
</ins><span class="cx">     pass
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdabooreverseproxypodstwextwhotesttest_directorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_directory.py (11899 => 11900)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_directory.py        2013-11-06 23:41:28 UTC (rev 11899)
+++ CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_directory.py        2013-11-07 02:00:24 UTC (rev 11900)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class BaseTest(unittest.TestCase):
</del><ins>+class ServiceMixIn(object):
</ins><span class="cx">     realmName = &quot;xyzzy&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryServiceTest(BaseTest):
</del><ins>+class BaseDirectoryServiceTest(ServiceMixIn):
</ins><span class="cx">     def test_interface(self):
</span><span class="cx">         service = self.service()
</span><span class="cx">         try:
</span><span class="lines">@@ -69,13 +69,6 @@
</span><span class="cx">         )
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    # @inlineCallbacks
-    # def test_recordsFromExpression(self):
-    #     service = self.service()
-    #     result = yield(service.recordsFromExpression(None))
-    #     self.assertIsInstance(result, QueryNotSupportedError)
-
-
</del><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_recordsFromQueryNone(self):
</span><span class="cx">         service = self.service()
</span><span class="lines">@@ -113,7 +106,55 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryServiceImmutableTest(BaseTest):
</del><ins>+class DirectoryServiceTest(unittest.TestCase, BaseDirectoryServiceTest):
+    def test_recordsFromExpression(self):
+        service = self.service()
+        result = yield(service.recordsFromExpression(None))
+        self.assertFailure(result, QueryNotSupportedError)
+
+
+    def test_recordWithUID(self):
+        service = self.service()
+        self.assertFailure(
+            service.recordWithUID(None),
+            QueryNotSupportedError
+        )
+
+
+    def test_recordWithGUID(self):
+        service = self.service()
+        self.assertFailure(
+            service.recordWithGUID(None),
+            QueryNotSupportedError
+        )
+
+
+    def test_recordsWithRecordType(self):
+        service = self.service()
+        self.assertFailure(
+            service.recordsWithRecordType(None),
+            QueryNotSupportedError
+        )
+
+
+    def test_recordWithShortName(self):
+        service = self.service()
+        self.assertFailure(
+            service.recordWithShortName(None, None),
+            QueryNotSupportedError
+        )
+
+
+    def test_recordsWithEmailAddress(self):
+        service = self.service()
+        self.assertFailure(
+            service.recordsWithEmailAddress(None),
+            QueryNotSupportedError
+        )
+
+
+
+class BaseDirectoryServiceImmutableTest(ServiceMixIn):
</ins><span class="cx">     def test_updateRecordsNotAllowed(self):
</span><span class="cx">         service = self.service()
</span><span class="cx"> 
</span><span class="lines">@@ -148,7 +189,15 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryRecordTest(BaseTest):
</del><ins>+class DirectoryServiceImmutableTest(
+    unittest.TestCase,
+    BaseDirectoryServiceImmutableTest,
+):
+    pass
+
+
+
+class BaseDirectoryRecordTest(ServiceMixIn):
</ins><span class="cx">     fields_wsanchez = {
</span><span class="cx">         FieldName.uid: &quot;UID:wsanchez&quot;,
</span><span class="cx">         FieldName.recordType: RecordType.user,
</span><span class="lines">@@ -179,8 +228,16 @@
</span><span class="cx">         FieldName.emailAddresses: (&quot;sagen@CalendarServer.org&quot;,)
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    fields_staff = {
+        FieldName.uid: &quot;UID:staff&quot;,
+        FieldName.recordType: RecordType.group,
+        FieldName.shortNames: (&quot;staff&quot;,),
+        FieldName.fullNames: (&quot;Staff&quot;,),
+        FieldName.emailAddresses: (&quot;staff@CalendarServer.org&quot;,)
+    }
</ins><span class="cx"> 
</span><del>-    def _testRecord(self, fields=None, service=None):
</del><ins>+
+    def makeRecord(self, fields=None, service=None):
</ins><span class="cx">         if fields is None:
</span><span class="cx">             fields = self.fields_wsanchez
</span><span class="cx">         if service is None:
</span><span class="lines">@@ -189,7 +246,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def test_interface(self):
</span><del>-        record = self._testRecord()
</del><ins>+        record = self.makeRecord()
</ins><span class="cx">         try:
</span><span class="cx">             verifyObject(IDirectoryRecord, record)
</span><span class="cx">         except BrokenMethodImplementation as e:
</span><span class="lines">@@ -198,7 +255,7 @@
</span><span class="cx"> 
</span><span class="cx">     def test_init(self):
</span><span class="cx">         service  = self.service()
</span><del>-        wsanchez = self._testRecord(self.fields_wsanchez, service=service)
</del><ins>+        wsanchez = self.makeRecord(self.fields_wsanchez, service=service)
</ins><span class="cx"> 
</span><span class="cx">         self.assertEquals(wsanchez.service, service)
</span><span class="cx">         self.assertEquals(wsanchez.fields, self.fields_wsanchez)
</span><span class="lines">@@ -207,49 +264,49 @@
</span><span class="cx">     def test_initWithNoUID(self):
</span><span class="cx">         fields = self.fields_wsanchez.copy()
</span><span class="cx">         del fields[FieldName.uid]
</span><del>-        self.assertRaises(ValueError, self._testRecord, fields)
</del><ins>+        self.assertRaises(ValueError, self.makeRecord, fields)
</ins><span class="cx"> 
</span><span class="cx">         fields = self.fields_wsanchez.copy()
</span><span class="cx">         fields[FieldName.uid] = &quot;&quot;
</span><del>-        self.assertRaises(ValueError, self._testRecord, fields)
</del><ins>+        self.assertRaises(ValueError, self.makeRecord, fields)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def test_initWithNoRecordType(self):
</span><span class="cx">         fields = self.fields_wsanchez.copy()
</span><span class="cx">         del fields[FieldName.recordType]
</span><del>-        self.assertRaises(ValueError, self._testRecord, fields)
</del><ins>+        self.assertRaises(ValueError, self.makeRecord, fields)
</ins><span class="cx"> 
</span><span class="cx">         fields = self.fields_wsanchez.copy()
</span><span class="cx">         fields[FieldName.recordType] = &quot;&quot;
</span><del>-        self.assertRaises(ValueError, self._testRecord, fields)
</del><ins>+        self.assertRaises(ValueError, self.makeRecord, fields)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def test_initWithNoShortNames(self):
</span><span class="cx">         fields = self.fields_wsanchez.copy()
</span><span class="cx">         del fields[FieldName.shortNames]
</span><del>-        self.assertRaises(ValueError, self._testRecord, fields)
</del><ins>+        self.assertRaises(ValueError, self.makeRecord, fields)
</ins><span class="cx"> 
</span><span class="cx">         fields = self.fields_wsanchez.copy()
</span><span class="cx">         fields[FieldName.shortNames] = ()
</span><del>-        self.assertRaises(ValueError, self._testRecord, fields)
</del><ins>+        self.assertRaises(ValueError, self.makeRecord, fields)
</ins><span class="cx"> 
</span><span class="cx">         fields = self.fields_wsanchez.copy()
</span><span class="cx">         fields[FieldName.shortNames] = (&quot;&quot;,)
</span><del>-        self.assertRaises(ValueError, self._testRecord, fields)
</del><ins>+        self.assertRaises(ValueError, self.makeRecord, fields)
</ins><span class="cx"> 
</span><span class="cx">         fields = self.fields_wsanchez.copy()
</span><span class="cx">         fields[FieldName.shortNames] = (&quot;wsanchez&quot;, &quot;&quot;)
</span><del>-        self.assertRaises(ValueError, self._testRecord, fields)
</del><ins>+        self.assertRaises(ValueError, self.makeRecord, fields)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def test_initWithBogusRecordType(self):
</span><span class="cx">         fields = self.fields_wsanchez.copy()
</span><span class="cx">         fields[FieldName.recordType] = object()
</span><del>-        self.assertRaises(ValueError, self._testRecord, fields)
</del><ins>+        self.assertRaises(ValueError, self.makeRecord, fields)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def test_initNormalize(self):
</span><del>-        sagen = self._testRecord(self.fields_sagen)
</del><ins>+        sagen = self.makeRecord(self.fields_sagen)
</ins><span class="cx"> 
</span><span class="cx">         self.assertEquals(
</span><span class="cx">             sagen.fields[FieldName.emailAddresses],
</span><span class="lines">@@ -263,10 +320,10 @@
</span><span class="cx"> 
</span><span class="cx">         plugh = DirectoryService(&quot;plugh&quot;)
</span><span class="cx"> 
</span><del>-        wsanchez    = self._testRecord(self.fields_wsanchez)
-        wsanchezmod = self._testRecord(self.fields_wsanchez, plugh)
-        glyph       = self._testRecord(self.fields_glyph)
-        glyphmod    = self._testRecord(fields_glyphmod)
</del><ins>+        wsanchez    = self.makeRecord(self.fields_wsanchez)
+        wsanchezmod = self.makeRecord(self.fields_wsanchez, plugh)
+        glyph       = self.makeRecord(self.fields_glyph)
+        glyphmod    = self.makeRecord(fields_glyphmod)
</ins><span class="cx"> 
</span><span class="cx">         self.assertEquals(wsanchez, wsanchez)
</span><span class="cx">         self.assertNotEqual(wsanchez, glyph)
</span><span class="lines">@@ -276,7 +333,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def test_attributeAccess(self):
</span><del>-        wsanchez = self._testRecord(self.fields_wsanchez)
</del><ins>+        wsanchez = self.makeRecord(self.fields_wsanchez)
</ins><span class="cx"> 
</span><span class="cx">         self.assertEquals(
</span><span class="cx">             wsanchez.recordType,
</span><span class="lines">@@ -295,10 +352,10 @@
</span><span class="cx">             wsanchez.fields[FieldName.emailAddresses]
</span><span class="cx">         )
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_members(self):
</span><del>-        wsanchez = self._testRecord(self.fields_wsanchez)
-
</del><ins>+        wsanchez = self.makeRecord(self.fields_wsanchez)
</ins><span class="cx">         self.assertEquals(
</span><span class="cx">             set((yield wsanchez.members())),
</span><span class="cx">             set()
</span><span class="lines">@@ -306,5 +363,24 @@
</span><span class="cx"> 
</span><span class="cx">         raise SkipTest(&quot;Subclasses should implement this test.&quot;)
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx">     def test_groups(self):
</span><span class="cx">         raise SkipTest(&quot;Subclasses should implement this test.&quot;)
</span><ins>+
+
+
+class DirectoryRecordTest(unittest.TestCase, BaseDirectoryRecordTest):
+    def test_members(self):
+        wsanchez = self.makeRecord(self.fields_wsanchez)
+        self.assertEquals(
+            set((yield wsanchez.members())),
+            set()
+        )
+
+        staff = self.makeRecord(self.fields_staff)
+        self.assertFailure(staff.members(), NotImplementedError)
+
+
+    def test_groups(self):
+        wsanchez = self.makeRecord(self.fields_wsanchez)
+        self.assertFailure(wsanchez.groups(), NotImplementedError)
</ins></span></pre></div>
<a id="CalendarServerbranchesuserscdabooreverseproxypodstwextwhotesttest_utilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_util.py (11899 => 11900)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_util.py        2013-11-06 23:41:28 UTC (rev 11899)
+++ CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_util.py        2013-11-07 02:00:24 UTC (rev 11900)
</span><span class="lines">@@ -82,7 +82,11 @@
</span><span class="cx">         )
</span><span class="cx"> 
</span><span class="cx">     def test_lookupByName(self):
</span><del>-        constants = set((Instruments.hammer, Tools.screwdriver, Instruments.chisel))
</del><ins>+        constants = set((
+            Instruments.hammer,
+            Tools.screwdriver,
+            Instruments.chisel,
+        ))
</ins><span class="cx">         container = ConstantsContainer(constants)
</span><span class="cx"> 
</span><span class="cx">         self.assertEquals(
</span><span class="lines">@@ -108,7 +112,7 @@
</span><span class="cx"> class UtilTest(unittest.TestCase):
</span><span class="cx">     def test_uniqueResult(self):
</span><span class="cx">         self.assertEquals(1, uniqueResult((1,)))
</span><del>-        self.assertRaises(DirectoryServiceError, uniqueResult, (1,2,3))
</del><ins>+        self.assertRaises(DirectoryServiceError, uniqueResult, (1, 2, 3))
</ins><span class="cx"> 
</span><span class="cx">     def test_describe(self):
</span><span class="cx">         self.assertEquals(&quot;nail pounder&quot;, describe(Tools.hammer))
</span><span class="lines">@@ -116,5 +120,5 @@
</span><span class="cx"> 
</span><span class="cx">     def test_describeFlags(self):
</span><span class="cx">         self.assertEquals(&quot;blue&quot;, describe(Switches.b))
</span><del>-        self.assertEquals(&quot;red|green&quot;, describe(Switches.r|Switches.g))
-        self.assertEquals(&quot;blue|black&quot;, describe(Switches.b|Switches.black))
</del><ins>+        self.assertEquals(&quot;red|green&quot;, describe(Switches.r | Switches.g))
+        self.assertEquals(&quot;blue|black&quot;, describe(Switches.b | Switches.black))
</ins></span></pre></div>
<a id="CalendarServerbranchesuserscdabooreverseproxypodstwextwhotesttest_xmlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_xml.py (11899 => 11900)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_xml.py        2013-11-06 23:41:28 UTC (rev 11899)
+++ CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext/who/test/test_xml.py        2013-11-07 02:00:24 UTC (rev 11900)
</span><span class="lines">@@ -47,7 +47,10 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryServiceBaseTest(BaseTest, test_directory.DirectoryServiceTest):
</del><ins>+class DirectoryServiceBaseTest(
+    BaseTest,
+    test_directory.BaseDirectoryServiceTest,
+):
</ins><span class="cx">     def test_repr(self):
</span><span class="cx">         service = self.service()
</span><span class="cx"> 
</span><span class="lines">@@ -70,7 +73,11 @@
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_recordWithGUID(self):
</span><span class="cx">         service = self.service()
</span><del>-        record = (yield service.recordWithGUID(&quot;6C495FCD-7E78-4D5C-AA66-BC890AD04C9D&quot;))
</del><ins>+        record = (
+            yield service.recordWithGUID(
+                &quot;6C495FCD-7E78-4D5C-AA66-BC890AD04C9D&quot;
+            )
+        )
</ins><span class="cx">         self.assertEquals(record, None)
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="lines">@@ -80,8 +87,11 @@
</span><span class="cx">         records = (yield service.recordsWithRecordType(object()))
</span><span class="cx">         self.assertEquals(set(records), set())
</span><span class="cx"> 
</span><del>-        records = (yield service.recordsWithRecordType(service.recordType.user))
-        self.assertRecords(records,
</del><ins>+        records = (
+            yield service.recordsWithRecordType(service.recordType.user)
+        )
+        self.assertRecords(
+            records,
</ins><span class="cx">             (
</span><span class="cx">                 &quot;__wsanchez__&quot;,
</span><span class="cx">                 &quot;__glyph__&quot;,
</span><span class="lines">@@ -95,8 +105,11 @@
</span><span class="cx">             ),
</span><span class="cx">         )
</span><span class="cx"> 
</span><del>-        records = (yield service.recordsWithRecordType(service.recordType.group))
-        self.assertRecords(records,
</del><ins>+        records = (
+            yield service.recordsWithRecordType(service.recordType.group)
+        )
+        self.assertRecords(
+            records,
</ins><span class="cx">             (
</span><span class="cx">                 &quot;__calendar-dev__&quot;,
</span><span class="cx">                 &quot;__twisted__&quot;,
</span><span class="lines">@@ -109,13 +122,28 @@
</span><span class="cx">     def test_recordWithShortName(self):
</span><span class="cx">         service = self.service()
</span><span class="cx"> 
</span><del>-        record = (yield service.recordWithShortName(service.recordType.user, &quot;null&quot;))
</del><ins>+        record = (
+            yield service.recordWithShortName(
+                service.recordType.user,
+                &quot;null&quot;,
+            )
+        )
</ins><span class="cx">         self.assertEquals(record, None)
</span><span class="cx"> 
</span><del>-        record = (yield service.recordWithShortName(service.recordType.user, &quot;wsanchez&quot;))
</del><ins>+        record = (
+            yield service.recordWithShortName(
+                service.recordType.user,
+                &quot;wsanchez&quot;,
+            )
+        )
</ins><span class="cx">         self.assertEquals(record.uid, &quot;__wsanchez__&quot;)
</span><span class="cx"> 
</span><del>-        record = (yield service.recordWithShortName(service.recordType.user, &quot;wilfredo_sanchez&quot;))
</del><ins>+        record = (
+            yield service.recordWithShortName(
+                service.recordType.user,
+                &quot;wilfredo_sanchez&quot;,
+            )
+        )
</ins><span class="cx">         self.assertEquals(record.uid, &quot;__wsanchez__&quot;)
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -123,13 +151,25 @@
</span><span class="cx">     def test_recordsWithEmailAddress(self):
</span><span class="cx">         service = self.service()
</span><span class="cx"> 
</span><del>-        records = (yield service.recordsWithEmailAddress(&quot;wsanchez@bitbucket.calendarserver.org&quot;))
</del><ins>+        records = (
+            yield service.recordsWithEmailAddress(
+                &quot;wsanchez@bitbucket.calendarserver.org&quot;
+            )
+        )
</ins><span class="cx">         self.assertRecords(records, (&quot;__wsanchez__&quot;,))
</span><span class="cx"> 
</span><del>-        records = (yield service.recordsWithEmailAddress(&quot;wsanchez@devnull.twistedmatrix.com&quot;))
</del><ins>+        records = (
+            yield service.recordsWithEmailAddress(
+                &quot;wsanchez@devnull.twistedmatrix.com&quot;
+            )
+        )
</ins><span class="cx">         self.assertRecords(records, (&quot;__wsanchez__&quot;,))
</span><span class="cx"> 
</span><del>-        records = (yield service.recordsWithEmailAddress(&quot;shared@example.com&quot;))
</del><ins>+        records = (
+            yield service.recordsWithEmailAddress(
+                &quot;shared@example.com&quot;
+            )
+        )
</ins><span class="cx">         self.assertRecords(records, (&quot;__sagen__&quot;, &quot;__dre__&quot;))
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -176,12 +216,12 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def test_badRootElement(self):
</span><del>-        service = self.service(xmlData=
</del><ins>+        service = self.service(xmlData=(
</ins><span class="cx"> &quot;&quot;&quot;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;frobnitz /&gt;
</span><span class="cx"> &quot;&quot;&quot;
</span><del>-        )
</del><ins>+        ))
</ins><span class="cx"> 
</span><span class="cx">         self.assertRaises(ParseError, service.loadRecords)
</span><span class="cx">         try:
</span><span class="lines">@@ -193,12 +233,12 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def test_noRealmName(self):
</span><del>-        service = self.service(xmlData=
</del><ins>+        service = self.service(xmlData=(
</ins><span class="cx"> &quot;&quot;&quot;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;directory /&gt;
</span><span class="cx"> &quot;&quot;&quot;
</span><del>-        )
</del><ins>+        ))
</ins><span class="cx"> 
</span><span class="cx">         self.assertRaises(ParseError, service.loadRecords)
</span><span class="cx">         try:
</span><span class="lines">@@ -215,7 +255,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def test_unknownFieldElementsDirty(self):
</span><del>-        service = self.service(xmlData=
</del><ins>+        service = self.service(xmlData=(
</ins><span class="cx"> &quot;&quot;&quot;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;directory realm=&quot;Unknown Record Types&quot;&gt;
</span><span class="lines">@@ -226,8 +266,11 @@
</span><span class="cx">   &lt;/record&gt;
</span><span class="cx"> &lt;/directory&gt;
</span><span class="cx"> &quot;&quot;&quot;
</span><ins>+        ))
+        self.assertEquals(
+            set(service.unknownFieldElements),
+            set((&quot;political-affiliation&quot;,))
</ins><span class="cx">         )
</span><del>-        self.assertEquals(set(service.unknownFieldElements), set((&quot;political-affiliation&quot;,)))
</del><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def test_unknownRecordTypesClean(self):
</span><span class="lines">@@ -236,7 +279,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def test_unknownRecordTypesDirty(self):
</span><del>-        service = self.service(xmlData=
</del><ins>+        service = self.service(xmlData=(
</ins><span class="cx"> &quot;&quot;&quot;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;directory realm=&quot;Unknown Record Types&quot;&gt;
</span><span class="lines">@@ -247,7 +290,7 @@
</span><span class="cx">   &lt;/record&gt;
</span><span class="cx"> &lt;/directory&gt;
</span><span class="cx"> &quot;&quot;&quot;
</span><del>-        )
</del><ins>+        ))
</ins><span class="cx">         self.assertEquals(set(service.unknownRecordTypes), set((&quot;camera&quot;,)))
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -314,7 +357,10 @@
</span><span class="cx">         records = yield service.recordsFromQuery(
</span><span class="cx">             (
</span><span class="cx">                 service.query(&quot;emailAddresses&quot;, &quot;shared@example.com&quot;),
</span><del>-                service.query(&quot;fullNames&quot;, &quot;Andre LaBranche&quot;, flags=MatchFlags.NOT),
</del><ins>+                service.query(
+                    &quot;fullNames&quot;, &quot;Andre LaBranche&quot;,
+                    flags=MatchFlags.NOT
+                ),
</ins><span class="cx">             ),
</span><span class="cx">             operand=Operand.AND
</span><span class="cx">         )
</span><span class="lines">@@ -325,7 +371,10 @@
</span><span class="cx">     def test_queryCaseInsensitive(self):
</span><span class="cx">         service = self.service()
</span><span class="cx">         records = yield service.recordsFromQuery((
</span><del>-            service.query(&quot;shortNames&quot;, &quot;SagEn&quot;, flags=MatchFlags.caseInsensitive),
</del><ins>+            service.query(
+                &quot;shortNames&quot;, &quot;SagEn&quot;,
+                flags=MatchFlags.caseInsensitive
+            ),
</ins><span class="cx">         ))
</span><span class="cx">         self.assertRecords(records, (&quot;__sagen__&quot;,))
</span><span class="cx"> 
</span><span class="lines">@@ -334,7 +383,10 @@
</span><span class="cx">     def test_queryCaseInsensitiveNoIndex(self):
</span><span class="cx">         service = self.service()
</span><span class="cx">         records = yield service.recordsFromQuery((
</span><del>-            service.query(&quot;fullNames&quot;, &quot;moRGen SAGen&quot;, flags=MatchFlags.caseInsensitive),
</del><ins>+            service.query(
+                &quot;fullNames&quot;, &quot;moRGen SAGen&quot;,
+                flags=MatchFlags.caseInsensitive
+            ),
</ins><span class="cx">         ))
</span><span class="cx">         self.assertRecords(records, (&quot;__sagen__&quot;,))
</span><span class="cx"> 
</span><span class="lines">@@ -352,7 +404,10 @@
</span><span class="cx">     def test_queryStartsWithNoIndex(self):
</span><span class="cx">         service = self.service()
</span><span class="cx">         records = yield service.recordsFromQuery((
</span><del>-            service.query(&quot;fullNames&quot;, &quot;Wilfredo&quot;, matchType=MatchType.startsWith),
</del><ins>+            service.query(
+                &quot;fullNames&quot;, &quot;Wilfredo&quot;,
+                matchType=MatchType.startsWith
+            ),
</ins><span class="cx">         ))
</span><span class="cx">         self.assertRecords(records, (&quot;__wsanchez__&quot;,))
</span><span class="cx"> 
</span><span class="lines">@@ -363,8 +418,8 @@
</span><span class="cx">         records = yield service.recordsFromQuery((
</span><span class="cx">             service.query(
</span><span class="cx">                 &quot;shortNames&quot;, &quot;w&quot;,
</span><del>-                matchType = MatchType.startsWith,
-                flags = MatchFlags.NOT,
</del><ins>+                matchType=MatchType.startsWith,
+                flags=MatchFlags.NOT,
</ins><span class="cx">             ),
</span><span class="cx">         ))
</span><span class="cx">         self.assertRecords(
</span><span class="lines">@@ -397,8 +452,8 @@
</span><span class="cx">         records = yield service.recordsFromQuery((
</span><span class="cx">             service.query(
</span><span class="cx">                 &quot;shortNames&quot;, &quot;wil&quot;,
</span><del>-                matchType = MatchType.startsWith,
-                flags = MatchFlags.NOT,
</del><ins>+                matchType=MatchType.startsWith,
+                flags=MatchFlags.NOT,
</ins><span class="cx">             ),
</span><span class="cx">         ))
</span><span class="cx">         self.assertRecords(
</span><span class="lines">@@ -426,8 +481,8 @@
</span><span class="cx">         records = yield service.recordsFromQuery((
</span><span class="cx">             service.query(
</span><span class="cx">                 &quot;fullNames&quot;, &quot;Wilfredo&quot;,
</span><del>-                matchType = MatchType.startsWith,
-                flags = MatchFlags.NOT,
</del><ins>+                matchType=MatchType.startsWith,
+                flags=MatchFlags.NOT,
</ins><span class="cx">             ),
</span><span class="cx">         ))
</span><span class="cx">         self.assertRecords(
</span><span class="lines">@@ -454,8 +509,8 @@
</span><span class="cx">         records = yield service.recordsFromQuery((
</span><span class="cx">             service.query(
</span><span class="cx">                 &quot;shortNames&quot;, &quot;WIL&quot;,
</span><del>-                matchType = MatchType.startsWith,
-                flags = MatchFlags.caseInsensitive,
</del><ins>+                matchType=MatchType.startsWith,
+                flags=MatchFlags.caseInsensitive,
</ins><span class="cx">             ),
</span><span class="cx">         ))
</span><span class="cx">         self.assertRecords(records, (&quot;__wsanchez__&quot;,))
</span><span class="lines">@@ -467,8 +522,8 @@
</span><span class="cx">         records = yield service.recordsFromQuery((
</span><span class="cx">             service.query(
</span><span class="cx">                 &quot;fullNames&quot;, &quot;wilfrEdo&quot;,
</span><del>-                matchType = MatchType.startsWith,
-                flags = MatchFlags.caseInsensitive,
</del><ins>+                matchType=MatchType.startsWith,
+                flags=MatchFlags.caseInsensitive,
</ins><span class="cx">             ),
</span><span class="cx">         ))
</span><span class="cx">         self.assertRecords(records, (&quot;__wsanchez__&quot;,))
</span><span class="lines">@@ -478,7 +533,10 @@
</span><span class="cx">     def test_queryContains(self):
</span><span class="cx">         service = self.service()
</span><span class="cx">         records = yield service.recordsFromQuery((
</span><del>-            service.query(&quot;shortNames&quot;, &quot;sanchez&quot;, matchType=MatchType.contains),
</del><ins>+            service.query(
+                &quot;shortNames&quot;, &quot;sanchez&quot;,
+                matchType=MatchType.contains
+            ),
</ins><span class="cx">         ))
</span><span class="cx">         self.assertRecords(records, (&quot;__wsanchez__&quot;,))
</span><span class="cx"> 
</span><span class="lines">@@ -498,8 +556,8 @@
</span><span class="cx">         records = yield service.recordsFromQuery((
</span><span class="cx">             service.query(
</span><span class="cx">                 &quot;shortNames&quot;, &quot;sanchez&quot;,
</span><del>-                matchType = MatchType.contains,
-                flags = MatchFlags.NOT,
</del><ins>+                matchType=MatchType.contains,
+                flags=MatchFlags.NOT,
</ins><span class="cx">             ),
</span><span class="cx">         ))
</span><span class="cx">         self.assertRecords(
</span><span class="lines">@@ -526,8 +584,8 @@
</span><span class="cx">         records = yield service.recordsFromQuery((
</span><span class="cx">             service.query(
</span><span class="cx">                 &quot;fullNames&quot;, &quot;fred&quot;,
</span><del>-                matchType = MatchType.contains,
-                flags = MatchFlags.NOT,
</del><ins>+                matchType=MatchType.contains,
+                flags=MatchFlags.NOT,
</ins><span class="cx">             ),
</span><span class="cx">         ))
</span><span class="cx">         self.assertRecords(
</span><span class="lines">@@ -590,12 +648,18 @@
</span><span class="cx"> 
</span><span class="cx">         # Verify change is present immediately
</span><span class="cx">         record = (yield service.recordWithUID(&quot;__wsanchez__&quot;))
</span><del>-        self.assertEquals(set(record.fullNames), set((&quot;Wilfredo Sanchez Vega&quot;,)))
</del><ins>+        self.assertEquals(
+            set(record.fullNames),
+            set((&quot;Wilfredo Sanchez Vega&quot;,))
+        )
</ins><span class="cx"> 
</span><span class="cx">         # Verify change is persisted
</span><span class="cx">         service.flush()
</span><span class="cx">         record = (yield service.recordWithUID(&quot;__wsanchez__&quot;))
</span><del>-        self.assertEquals(set(record.fullNames), set((&quot;Wilfredo Sanchez Vega&quot;,)))
</del><ins>+        self.assertEquals(
+            set(record.fullNames),
+            set((&quot;Wilfredo Sanchez Vega&quot;,))
+        )
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="lines">@@ -604,7 +668,7 @@
</span><span class="cx"> 
</span><span class="cx">         newRecord = DirectoryRecord(
</span><span class="cx">             service,
</span><del>-            fields = {
</del><ins>+            fields={
</ins><span class="cx">                 service.fieldName.uid:        &quot;__plugh__&quot;,
</span><span class="cx">                 service.fieldName.recordType: service.recordType.user,
</span><span class="cx">                 service.fieldName.shortNames: (&quot;plugh&quot;,),
</span><span class="lines">@@ -628,14 +692,17 @@
</span><span class="cx"> 
</span><span class="cx">         newRecord = DirectoryRecord(
</span><span class="cx">             service,
</span><del>-            fields = {
</del><ins>+            fields={
</ins><span class="cx">                 service.fieldName.uid:        &quot;__plugh__&quot;,
</span><span class="cx">                 service.fieldName.recordType: service.recordType.user,
</span><span class="cx">                 service.fieldName.shortNames: (&quot;plugh&quot;,),
</span><span class="cx">             }
</span><span class="cx">         )
</span><span class="cx"> 
</span><del>-        self.assertFailure(service.updateRecords((newRecord,)), NoSuchRecordError)
</del><ins>+        self.assertFailure(
+            service.updateRecords((newRecord,)),
+            NoSuchRecordError
+        )
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="lines">@@ -659,7 +726,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryRecordTest(BaseTest, test_directory.DirectoryRecordTest):
</del><ins>+class DirectoryRecordTest(BaseTest, test_directory.BaseDirectoryRecordTest):
</ins><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_members(self):
</span><span class="cx">         service = self.service()
</span><span class="lines">@@ -714,8 +781,8 @@
</span><span class="cx">         assert name is not None
</span><span class="cx">         return MatchExpression(
</span><span class="cx">             name, value,
</span><del>-            matchType = matchType,
-            flags = flags,
</del><ins>+            matchType=matchType,
+            flags=flags,
</ins><span class="cx">         )
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdabooreverseproxypodstxdavcommondatastoreupgradesqlupgradescalendar_upgrade_from_3_to_4py"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/reverse-proxy-pods/txdav/common/datastore/upgrade/sql/upgrades/calendar_upgrade_from_3_to_4.py (11899 => 11900)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/reverse-proxy-pods/txdav/common/datastore/upgrade/sql/upgrades/calendar_upgrade_from_3_to_4.py        2013-11-06 23:41:28 UTC (rev 11899)
+++ CalendarServer/branches/users/cdaboo/reverse-proxy-pods/txdav/common/datastore/upgrade/sql/upgrades/calendar_upgrade_from_3_to_4.py        2013-11-07 02:00:24 UTC (rev 11900)
</span><span class="lines">@@ -94,27 +94,28 @@
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">     inbox = (yield home.calendarWithName(&quot;inbox&quot;))
</span><del>-    prop = inbox.properties().get(PropertyName.fromElement(propname))
-    if prop is not None:
-        defaultCalendar = str(prop.children[0])
-        parts = defaultCalendar.split(&quot;/&quot;)
-        if len(parts) == 5:
</del><ins>+    if inbox is not None:
+        prop = inbox.properties().get(PropertyName.fromElement(propname))
+        if prop is not None:
+            defaultCalendar = str(prop.children[0])
+            parts = defaultCalendar.split(&quot;/&quot;)
+            if len(parts) == 5:
</ins><span class="cx"> 
</span><del>-            calendarName = parts[-1]
-            calendarHomeUID = parts[-2]
-            if calendarHomeUID == home.uid():
</del><ins>+                calendarName = parts[-1]
+                calendarHomeUID = parts[-2]
+                if calendarHomeUID == home.uid():
</ins><span class="cx"> 
</span><del>-                calendar = (yield home.calendarWithName(calendarName))
-                if calendar is not None:
-                    try:
-                        yield home.setDefaultCalendar(
-                            calendar, tasks=(propname == customxml.ScheduleDefaultTasksURL)
-                        )
-                    except InvalidDefaultCalendar:
-                        # Ignore these - the server will recover
-                        pass
</del><ins>+                    calendar = (yield home.calendarWithName(calendarName))
+                    if calendar is not None:
+                        try:
+                            yield home.setDefaultCalendar(
+                                calendar, tasks=(propname == customxml.ScheduleDefaultTasksURL)
+                            )
+                        except InvalidDefaultCalendar:
+                            # Ignore these - the server will recover
+                            pass
</ins><span class="cx"> 
</span><del>-        del inbox.properties()[PropertyName.fromElement(propname)]
</del><ins>+            del inbox.properties()[PropertyName.fromElement(propname)]
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -130,15 +131,13 @@
</span><span class="cx">     calendars = (yield home.loadChildren())
</span><span class="cx">     for calendar in calendars:
</span><span class="cx">         if calendar.isInbox():
</span><del>-            continue
</del><ins>+            prop = calendar.properties().get(PropertyName.fromElement(caldavxml.CalendarFreeBusySet))
+            if prop is not None:
+                del calendar.properties()[PropertyName.fromElement(caldavxml.CalendarFreeBusySet)]
</ins><span class="cx">         prop = calendar.properties().get(PropertyName.fromElement(caldavxml.ScheduleCalendarTransp))
</span><span class="cx">         if prop is not None:
</span><span class="cx">             yield calendar.setUsedForFreeBusy(prop == caldavxml.ScheduleCalendarTransp(caldavxml.Opaque()))
</span><span class="cx">             del calendar.properties()[PropertyName.fromElement(caldavxml.ScheduleCalendarTransp)]
</span><del>-    inbox = (yield home.calendarWithName(&quot;inbox&quot;))
-    prop = inbox.properties().get(PropertyName.fromElement(caldavxml.CalendarFreeBusySet))
-    if prop is not None:
-        del inbox.properties()[PropertyName.fromElement(caldavxml.CalendarFreeBusySet)]
</del><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdabooreverseproxypodstxdavcommondatastoreupgradesqlupgradescalendar_upgrade_from_4_to_5py"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/reverse-proxy-pods/txdav/common/datastore/upgrade/sql/upgrades/calendar_upgrade_from_4_to_5.py (11899 => 11900)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/reverse-proxy-pods/txdav/common/datastore/upgrade/sql/upgrades/calendar_upgrade_from_4_to_5.py        2013-11-06 23:41:28 UTC (rev 11899)
+++ CalendarServer/branches/users/cdaboo/reverse-proxy-pods/txdav/common/datastore/upgrade/sql/upgrades/calendar_upgrade_from_4_to_5.py        2013-11-07 02:00:24 UTC (rev 11900)
</span><span class="lines">@@ -102,10 +102,11 @@
</span><span class="cx">     the new value from the XML property.
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     inbox = (yield home.calendarWithName(&quot;inbox&quot;))
</span><del>-    prop = inbox.properties().get(PropertyName.fromElement(customxml.CalendarAvailability))
-    if prop is not None:
-        yield home.setAvailability(prop.calendar())
-        del inbox.properties()[PropertyName.fromElement(customxml.CalendarAvailability)]
</del><ins>+    if inbox is not None:
+        prop = inbox.properties().get(PropertyName.fromElement(customxml.CalendarAvailability))
+        if prop is not None:
+            yield home.setAvailability(prop.calendar())
+            del inbox.properties()[PropertyName.fromElement(customxml.CalendarAvailability)]
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>