<!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>[13660] twext/trunk</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Land recordtypes branch</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#twexttrunktwextwhoaggregatepy">twext/trunk/twext/who/aggregate.py</a></li>
<li><a href="#twexttrunktwextwhodirectorypy">twext/trunk/twext/who/directory.py</a></li>
<li><a href="#twexttrunktwextwhoidirectorypy">twext/trunk/twext/who/idirectory.py</a></li>
<li><a href="#twexttrunktwextwhoindexpy">twext/trunk/twext/who/index.py</a></li>
<li><a href="#twexttrunktwextwholdap_servicepy">twext/trunk/twext/who/ldap/_service.py</a></li>
<li><a href="#twexttrunktwextwhoopendirectory_servicepy">twext/trunk/twext/who/opendirectory/_service.py</a></li>
<li><a href="#twexttrunktwextwhotesttest_directorypy">twext/trunk/twext/who/test/test_directory.py</a></li>
<li><a href="#twexttrunktwextwhotesttest_indexpy">twext/trunk/twext/who/test/test_index.py</a></li>
<li><a href="#twexttrunktwextwhotesttest_xmlpy">twext/trunk/twext/who/test/test_xml.py</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#twexttrunk">twext/trunk/</a></li>
<li><a href="#twexttrunktwext">twext/trunk/twext/</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="twexttrunk"></a>
<div class="propset"><h4>Property changes: twext/trunk</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4>Modified: svn:mergeinfo</h4></div>
<span class="cx">/twext/branches/users/cdaboo/jobs:12742-12780
</span><span class="cx">   + /twext/branches/users/cdaboo/jobqueue-3:13444-13471
</span><span class="cx">/twext/branches/users/cdaboo/jobs:12742-12780
</span><span class="cx">/twext/branches/users/sagen/recordtypes:13647-13658
</span><span class="cx">/twext/branches/users/sagen/recordtypes-2:13659
</span><a id="twexttrunktwext"></a>
<div class="propset"><h4>Property changes: twext/trunk/twext</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/twext:4379-4443
</span><span class="cx">/CalendarServer/branches/egg-info-351/twext:4589-4625
</span><span class="cx">/CalendarServer/branches/generic-sqlstore/twext:6167-6191
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile-2/twext:5936-5981
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile/twext:5911-5935
</span><span class="cx">/CalendarServer/branches/new-store/twext:5594-5934
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-4.3-dev/twext:10180-10190,10192
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.1-dev/twext:11846
</span><span class="cx">/CalendarServer/branches/users/cdaboo/batchupload-6699/twext:6700-7198
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cached-subscription-calendars-5692/twext:5693-5702
</span><span class="cx">/CalendarServer/branches/users/cdaboo/component-set-fixes/twext:8130-8346
</span><span class="cx">/CalendarServer/branches/users/cdaboo/directory-cache-on-demand-3627/twext:3628-3644
</span><span class="cx">/CalendarServer/branches/users/cdaboo/fix-no-ischedule/twext:11607-11871
</span><span class="cx">/CalendarServer/branches/users/cdaboo/implicituidrace/twext:8137-8141
</span><span class="cx">/CalendarServer/branches/users/cdaboo/ischedule-dkim/twext:9747-9979
</span><span class="cx">/CalendarServer/branches/users/cdaboo/json/twext:11622-11912
</span><span class="cx">/CalendarServer/branches/users/cdaboo/managed-attachments/twext:9985-10145
</span><span class="cx">/CalendarServer/branches/users/cdaboo/more-sharing-5591/twext:5592-5601
</span><span class="cx">/CalendarServer/branches/users/cdaboo/partition-4464/twext:4465-4957
</span><span class="cx">/CalendarServer/branches/users/cdaboo/performance-tweaks/twext:11824-11836
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pods/twext:7297-7377
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycalendar/twext:7085-7206
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycard/twext:7227-7237
</span><span class="cx">/CalendarServer/branches/users/cdaboo/queued-attendee-refreshes/twext:7740-8287
</span><span class="cx">/CalendarServer/branches/users/cdaboo/relative-config-paths-5070/twext:5071-5105
</span><span class="cx">/CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext:11875-11900
</span><span class="cx">/CalendarServer/branches/users/cdaboo/shared-calendars-5187/twext:5188-5440
</span><span class="cx">/CalendarServer/branches/users/cdaboo/sharing-in-the-store/twext:11935-12016
</span><span class="cx">/CalendarServer/branches/users/cdaboo/store-scheduling/twext:10876-11129
</span><span class="cx">/CalendarServer/branches/users/cdaboo/timezones/twext:7443-7699
</span><span class="cx">/CalendarServer/branches/users/cdaboo/txn-debugging/twext:8730-8743
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroups-3/twext:11088-11204
</span><span class="cx">/CalendarServer/branches/users/glyph/always-abort-txn-on-error/twext:9958-9969
</span><span class="cx">/CalendarServer/branches/users/glyph/case-insensitive-uid/twext:8772-8805
</span><span class="cx">/CalendarServer/branches/users/glyph/conn-limit/twext:6574-6577
</span><span class="cx">/CalendarServer/branches/users/glyph/contacts-server-merge/twext:4971-5080
</span><span class="cx">/CalendarServer/branches/users/glyph/dalify/twext:6932-7023
</span><span class="cx">/CalendarServer/branches/users/glyph/db-reconnect/twext:6824-6876
</span><span class="cx">/CalendarServer/branches/users/glyph/deploybuild/twext:7563-7572
</span><span class="cx">/CalendarServer/branches/users/glyph/digest-auth-redux/twext:10624-10635
</span><span class="cx">/CalendarServer/branches/users/glyph/disable-quota/twext:7718-7727
</span><span class="cx">/CalendarServer/branches/users/glyph/dont-start-postgres/twext:6592-6614
</span><span class="cx">/CalendarServer/branches/users/glyph/enforce-max-requests/twext:11640-11643
</span><span class="cx">/CalendarServer/branches/users/glyph/hang-fix/twext:11465-11491
</span><span class="cx">/CalendarServer/branches/users/glyph/imip-and-admin-html/twext:7866-7984
</span><span class="cx">/CalendarServer/branches/users/glyph/ipv6-client/twext:9054-9105
</span><span class="cx">/CalendarServer/branches/users/glyph/launchd-wrapper-bis/twext:11413-11436
</span><span class="cx">/CalendarServer/branches/users/glyph/linux-tests/twext:6893-6900
</span><span class="cx">/CalendarServer/branches/users/glyph/log-cleanups/twext:11691-11731
</span><span class="cx">/CalendarServer/branches/users/glyph/migrate-merge/twext:8690-8713
</span><span class="cx">/CalendarServer/branches/users/glyph/misc-portability-fixes/twext:7365-7374
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-6/twext:6322-6368
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-7/twext:6369-6445
</span><span class="cx">/CalendarServer/branches/users/glyph/multiget-delete/twext:8321-8330
</span><span class="cx">/CalendarServer/branches/users/glyph/new-export/twext:7444-7485
</span><span class="cx">/CalendarServer/branches/users/glyph/one-home-list-api/twext:10048-10073
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle-nulls/twext:7340-7351
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle/twext:7106-7155
</span><span class="cx">/CalendarServer/branches/users/glyph/other-html/twext:8062-8091
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-sim/twext:8240-8251
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade/twext:8376-8400
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade_to_1/twext:8571-8583
</span><span class="cx">/CalendarServer/branches/users/glyph/q/twext:9560-9688
</span><span class="cx">/CalendarServer/branches/users/glyph/queue-locking-and-timing/twext:10204-10289
</span><span class="cx">/CalendarServer/branches/users/glyph/quota/twext:7604-7637
</span><span class="cx">/CalendarServer/branches/users/glyph/sendfdport/twext:5388-5424
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-fixes/twext:8436-8443
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-take2/twext:8155-8174
</span><span class="cx">/CalendarServer/branches/users/glyph/sharedpool/twext:6490-6550
</span><span class="cx">/CalendarServer/branches/users/glyph/sharing-api/twext:9192-9205
</span><span class="cx">/CalendarServer/branches/users/glyph/skip-lonely-vtimezones/twext:8524-8535
</span><span class="cx">/CalendarServer/branches/users/glyph/sql-store/twext:5929-6073
</span><span class="cx">/CalendarServer/branches/users/glyph/start-service-start-loop/twext:11060-11065
</span><span class="cx">/CalendarServer/branches/users/glyph/subtransactions/twext:7248-7258
</span><span class="cx">/CalendarServer/branches/users/glyph/table-alias/twext:8651-8664
</span><span class="cx">/CalendarServer/branches/users/glyph/uidexport/twext:7673-7676
</span><span class="cx">/CalendarServer/branches/users/glyph/unshare-when-access-revoked/twext:10562-10595
</span><span class="cx">/CalendarServer/branches/users/glyph/use-system-twisted/twext:5084-5149
</span><span class="cx">/CalendarServer/branches/users/glyph/uuid-normalize/twext:9268-9296
</span><span class="cx">/CalendarServer/branches/users/glyph/warning-cleanups/twext:11347-11357
</span><span class="cx">/CalendarServer/branches/users/glyph/whenNotProposed/twext:11881-11897
</span><span class="cx">/CalendarServer/branches/users/glyph/xattrs-from-files/twext:7757-7769
</span><span class="cx">/CalendarServer/branches/users/sagen/applepush/twext:8126-8184
</span><span class="cx">/CalendarServer/branches/users/sagen/inboxitems/twext:7380-7381
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources-2/twext:5052-5061
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources/twext:5032-5051
</span><span class="cx">/CalendarServer/branches/users/sagen/purge_old_events/twext:6735-6746
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4038/twext:4040-4067
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4066/twext:4068-4075
</span><span class="cx">/CalendarServer/branches/users/sagen/resources-2/twext:5084-5093
</span><span class="cx">/CalendarServer/branches/users/sagen/testing/twext:10827-10851,10853-10855
</span><span class="cx">/CalendarServer/branches/users/wsanchez/transations/twext:5515-5593
</span><span class="cx">/twext/branches/users/cdaboo/jobqueue-3/twext:13444-13471
</span><span class="cx">/twext/branches/users/cdaboo/jobs/twext:12742-12780
</span><span class="cx">   + /CalDAVTester/trunk/twext:11193-11198
</span><span class="cx">/CalendarServer/branches/config-separation/twext:4379-4443
</span><span class="cx">/CalendarServer/branches/egg-info-351/twext:4589-4625
</span><span class="cx">/CalendarServer/branches/generic-sqlstore/twext:6167-6191
</span><span class="cx">/CalendarServer/branches/new-store/twext:5594-5934
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile/twext:5911-5935
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile-2/twext:5936-5981
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-4.3-dev/twext:10180-10190,10192
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.1-dev/twext:11846
</span><span class="cx">/CalendarServer/branches/users/cdaboo/batchupload-6699/twext:6700-7198
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cached-subscription-calendars-5692/twext:5693-5702
</span><span class="cx">/CalendarServer/branches/users/cdaboo/component-set-fixes/twext:8130-8346
</span><span class="cx">/CalendarServer/branches/users/cdaboo/directory-cache-on-demand-3627/twext:3628-3644
</span><span class="cx">/CalendarServer/branches/users/cdaboo/fix-no-ischedule/twext:11607-11871
</span><span class="cx">/CalendarServer/branches/users/cdaboo/implicituidrace/twext:8137-8141
</span><span class="cx">/CalendarServer/branches/users/cdaboo/ischedule-dkim/twext:9747-9979
</span><span class="cx">/CalendarServer/branches/users/cdaboo/json/twext:11622-11912
</span><span class="cx">/CalendarServer/branches/users/cdaboo/managed-attachments/twext:9985-10145
</span><span class="cx">/CalendarServer/branches/users/cdaboo/more-sharing-5591/twext:5592-5601
</span><span class="cx">/CalendarServer/branches/users/cdaboo/partition-4464/twext:4465-4957
</span><span class="cx">/CalendarServer/branches/users/cdaboo/performance-tweaks/twext:11824-11836
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pods/twext:7297-7377
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycalendar/twext:7085-7206
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycard/twext:7227-7237
</span><span class="cx">/CalendarServer/branches/users/cdaboo/queued-attendee-refreshes/twext:7740-8287
</span><span class="cx">/CalendarServer/branches/users/cdaboo/relative-config-paths-5070/twext:5071-5105
</span><span class="cx">/CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext:11875-11900
</span><span class="cx">/CalendarServer/branches/users/cdaboo/shared-calendars-5187/twext:5188-5440
</span><span class="cx">/CalendarServer/branches/users/cdaboo/sharing-in-the-store/twext:11935-12016
</span><span class="cx">/CalendarServer/branches/users/cdaboo/store-scheduling/twext:10876-11129
</span><span class="cx">/CalendarServer/branches/users/cdaboo/timezones/twext:7443-7699
</span><span class="cx">/CalendarServer/branches/users/cdaboo/txn-debugging/twext:8730-8743
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroups-3/twext:11088-11204
</span><span class="cx">/CalendarServer/branches/users/glyph/always-abort-txn-on-error/twext:9958-9969
</span><span class="cx">/CalendarServer/branches/users/glyph/case-insensitive-uid/twext:8772-8805
</span><span class="cx">/CalendarServer/branches/users/glyph/conn-limit/twext:6574-6577
</span><span class="cx">/CalendarServer/branches/users/glyph/contacts-server-merge/twext:4971-5080
</span><span class="cx">/CalendarServer/branches/users/glyph/dalify/twext:6932-7023
</span><span class="cx">/CalendarServer/branches/users/glyph/db-reconnect/twext:6824-6876
</span><span class="cx">/CalendarServer/branches/users/glyph/deploybuild/twext:7563-7572
</span><span class="cx">/CalendarServer/branches/users/glyph/digest-auth-redux/twext:10624-10635
</span><span class="cx">/CalendarServer/branches/users/glyph/disable-quota/twext:7718-7727
</span><span class="cx">/CalendarServer/branches/users/glyph/dont-start-postgres/twext:6592-6614
</span><span class="cx">/CalendarServer/branches/users/glyph/enforce-max-requests/twext:11640-11643
</span><span class="cx">/CalendarServer/branches/users/glyph/hang-fix/twext:11465-11491
</span><span class="cx">/CalendarServer/branches/users/glyph/imip-and-admin-html/twext:7866-7984
</span><span class="cx">/CalendarServer/branches/users/glyph/ipv6-client/twext:9054-9105
</span><span class="cx">/CalendarServer/branches/users/glyph/launchd-wrapper-bis/twext:11413-11436
</span><span class="cx">/CalendarServer/branches/users/glyph/linux-tests/twext:6893-6900
</span><span class="cx">/CalendarServer/branches/users/glyph/log-cleanups/twext:11691-11731
</span><span class="cx">/CalendarServer/branches/users/glyph/migrate-merge/twext:8690-8713
</span><span class="cx">/CalendarServer/branches/users/glyph/misc-portability-fixes/twext:7365-7374
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-6/twext:6322-6368
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-7/twext:6369-6445
</span><span class="cx">/CalendarServer/branches/users/glyph/multiget-delete/twext:8321-8330
</span><span class="cx">/CalendarServer/branches/users/glyph/new-export/twext:7444-7485
</span><span class="cx">/CalendarServer/branches/users/glyph/one-home-list-api/twext:10048-10073
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle/twext:7106-7155
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle-nulls/twext:7340-7351
</span><span class="cx">/CalendarServer/branches/users/glyph/other-html/twext:8062-8091
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-sim/twext:8240-8251
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade/twext:8376-8400
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade_to_1/twext:8571-8583
</span><span class="cx">/CalendarServer/branches/users/glyph/q/twext:9560-9688
</span><span class="cx">/CalendarServer/branches/users/glyph/queue-locking-and-timing/twext:10204-10289
</span><span class="cx">/CalendarServer/branches/users/glyph/quota/twext:7604-7637
</span><span class="cx">/CalendarServer/branches/users/glyph/sendfdport/twext:5388-5424
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-fixes/twext:8436-8443
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-take2/twext:8155-8174
</span><span class="cx">/CalendarServer/branches/users/glyph/sharedpool/twext:6490-6550
</span><span class="cx">/CalendarServer/branches/users/glyph/sharing-api/twext:9192-9205
</span><span class="cx">/CalendarServer/branches/users/glyph/skip-lonely-vtimezones/twext:8524-8535
</span><span class="cx">/CalendarServer/branches/users/glyph/sql-store/twext:5929-6073
</span><span class="cx">/CalendarServer/branches/users/glyph/start-service-start-loop/twext:11060-11065
</span><span class="cx">/CalendarServer/branches/users/glyph/subtransactions/twext:7248-7258
</span><span class="cx">/CalendarServer/branches/users/glyph/table-alias/twext:8651-8664
</span><span class="cx">/CalendarServer/branches/users/glyph/uidexport/twext:7673-7676
</span><span class="cx">/CalendarServer/branches/users/glyph/unshare-when-access-revoked/twext:10562-10595
</span><span class="cx">/CalendarServer/branches/users/glyph/use-system-twisted/twext:5084-5149
</span><span class="cx">/CalendarServer/branches/users/glyph/uuid-normalize/twext:9268-9296
</span><span class="cx">/CalendarServer/branches/users/glyph/warning-cleanups/twext:11347-11357
</span><span class="cx">/CalendarServer/branches/users/glyph/whenNotProposed/twext:11881-11897
</span><span class="cx">/CalendarServer/branches/users/glyph/xattrs-from-files/twext:7757-7769
</span><span class="cx">/CalendarServer/branches/users/sagen/applepush/twext:8126-8184
</span><span class="cx">/CalendarServer/branches/users/sagen/inboxitems/twext:7380-7381
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources/twext:5032-5051
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources-2/twext:5052-5061
</span><span class="cx">/CalendarServer/branches/users/sagen/purge_old_events/twext:6735-6746
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4038/twext:4040-4067
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4066/twext:4068-4075
</span><span class="cx">/CalendarServer/branches/users/sagen/resources-2/twext:5084-5093
</span><span class="cx">/CalendarServer/branches/users/sagen/testing/twext:10827-10851,10853-10855
</span><span class="cx">/CalendarServer/branches/users/wsanchez/transations/twext:5515-5593
</span><span class="cx">/twext/branches/users/cdaboo/jobqueue-3/twext:13444-13471
</span><span class="cx">/twext/branches/users/cdaboo/jobs/twext:12742-12780
</span><span class="cx">/twext/branches/users/sagen/recordtypes/twext:13647-13658
</span><span class="cx">/twext/branches/users/sagen/recordtypes-2/twext:13659
</span><a id="twexttrunktwextwhoaggregatepy"></a>
<div class="modfile"><h4>Modified: twext/trunk/twext/who/aggregate.py (13659 => 13660)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/twext/who/aggregate.py        2014-06-18 21:13:12 UTC (rev 13659)
+++ twext/trunk/twext/who/aggregate.py        2014-06-18 21:13:47 UTC (rev 13660)
</span><span class="lines">@@ -108,9 +108,10 @@
</span><span class="cx">         return d
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def recordsFromExpression(self, expression, records=None):
</del><ins>+    def recordsFromExpression(self, expression, recordTypes=None, records=None):
</ins><span class="cx">         return self._gatherFromSubServices(
</span><del>-            &quot;recordsFromExpression&quot;, expression, records=None
</del><ins>+            &quot;recordsFromExpression&quot;, expression, recordTypes=recordTypes,
+            records=None
</ins><span class="cx">         )
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="twexttrunktwextwhodirectorypy"></a>
<div class="modfile"><h4>Modified: twext/trunk/twext/who/directory.py (13659 => 13660)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/twext/who/directory.py        2014-06-18 21:13:12 UTC (rev 13659)
+++ twext/trunk/twext/who/directory.py        2014-06-18 21:13:47 UTC (rev 13660)
</span><span class="lines">@@ -122,7 +122,9 @@
</span><span class="cx">         return self.recordType.iterconstants()
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def recordsFromNonCompoundExpression(self, expression, records=None):
</del><ins>+    def recordsFromNonCompoundExpression(
+        self, expression, recordTypes=None, records=None
+    ):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Finds records matching a non-compound expression.
</span><span class="cx"> 
</span><span class="lines">@@ -139,6 +141,10 @@
</span><span class="cx">         @param expression: an expression to apply
</span><span class="cx">         @type expression: L{object}
</span><span class="cx"> 
</span><ins>+        @param recordTypes: the record types to match
+        @type recordTypes: an iterable of L{NamedConstant}, or None for no
+            filtering
+
</ins><span class="cx">         @param records: a set of records to limit the search to. C{None} if
</span><span class="cx">             the whole directory should be searched.
</span><span class="cx">             This is provided by L{recordsFromExpression} when it has already
</span><span class="lines">@@ -165,7 +171,9 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><del>-    def recordsFromCompoundExpression(self, expression, records=None):
</del><ins>+    def recordsFromCompoundExpression(
+        self, expression, recordTypes=None, records=None
+    ):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Finds records matching a compound expression.
</span><span class="cx"> 
</span><span class="lines">@@ -178,6 +186,10 @@
</span><span class="cx">         @param expression: an expression to apply
</span><span class="cx">         @type expression: L{CompoundExpression}
</span><span class="cx"> 
</span><ins>+        @param recordTypes: the record types to match
+        @type recordTypes: an iterable of L{NamedConstant}, or None for no
+            filtering
+
</ins><span class="cx">         @param records: a set of records to limit the search to. C{None} if
</span><span class="cx">             the whole directory should be searched.
</span><span class="cx">             This is provided by L{recordsFromExpression} when it has already
</span><span class="lines">@@ -201,7 +213,9 @@
</span><span class="cx">             returnValue(())
</span><span class="cx"> 
</span><span class="cx">         results = set((
</span><del>-            yield self.recordsFromExpression(subExpression, records=records)
</del><ins>+            yield self.recordsFromExpression(
+                subExpression, recordTypes=recordTypes, records=records
+            )
</ins><span class="cx">         ))
</span><span class="cx"> 
</span><span class="cx">         for subExpression in subExpressions:
</span><span class="lines">@@ -216,7 +230,7 @@
</span><span class="cx"> 
</span><span class="cx">             recordsMatchingExpression = frozenset((
</span><span class="cx">                 yield self.recordsFromExpression(
</span><del>-                    subExpression, records=records
</del><ins>+                    subExpression, recordTypes=recordTypes, records=records
</ins><span class="cx">                 )
</span><span class="cx">             ))
</span><span class="cx"> 
</span><span class="lines">@@ -232,16 +246,20 @@
</span><span class="cx">         returnValue(results)
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def recordsFromExpression(self, expression, records=None):
</del><ins>+    def recordsFromExpression(self, expression, recordTypes=None, records=None):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         @note: This interface is the same as
</span><span class="cx">             L{IDirectoryService.recordsFromExpression}, except for the
</span><span class="cx">             additional C{records} argument.
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         if isinstance(expression, CompoundExpression):
</span><del>-            return self.recordsFromCompoundExpression(expression)
</del><ins>+            return self.recordsFromCompoundExpression(
+                expression, recordTypes=recordTypes
+            )
</ins><span class="cx">         else:
</span><del>-            return self.recordsFromNonCompoundExpression(expression)
</del><ins>+            return self.recordsFromNonCompoundExpression(
+                expression, recordTypes=recordTypes
+            )
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def recordsWithFieldValue(self, fieldName, value):
</span></span></pre></div>
<a id="twexttrunktwextwhoidirectorypy"></a>
<div class="modfile"><h4>Modified: twext/trunk/twext/who/idirectory.py (13659 => 13660)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/twext/who/idirectory.py        2014-06-18 21:13:12 UTC (rev 13659)
+++ twext/trunk/twext/who/idirectory.py        2014-06-18 21:13:47 UTC (rev 13660)
</span><span class="lines">@@ -278,13 +278,17 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def recordsFromExpression(expression):
</del><ins>+    def recordsFromExpression(expression, recordTypes=None):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Find records matching an expression.
</span><span class="cx"> 
</span><span class="cx">         @param expression: an expression to apply
</span><span class="cx">         @type expression: L{object}
</span><span class="cx"> 
</span><ins>+        @param recordTypes: the record types to match
+        @type recordTypes: an iterable of L{NamedConstant}, or None for no
+            filtering
+
</ins><span class="cx">         @return: The matching records.
</span><span class="cx">         @rtype: deferred iterable of L{IDirectoryRecord}s
</span><span class="cx"> 
</span></span></pre></div>
<a id="twexttrunktwextwhoindexpy"></a>
<div class="modfile"><h4>Modified: twext/trunk/twext/who/index.py (13659 => 13660)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/twext/who/index.py        2014-06-18 21:13:12 UTC (rev 13659)
+++ twext/trunk/twext/who/index.py        2014-06-18 21:13:47 UTC (rev 13660)
</span><span class="lines">@@ -226,7 +226,9 @@
</span><span class="cx">         self._index = index
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def indexedRecordsFromMatchExpression(self, expression, records=None):
</del><ins>+    def indexedRecordsFromMatchExpression(
+        self, expression, recordTypes=None, records=None
+    ):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Finds records in the internal indexes matching a single expression.
</span><span class="cx"> 
</span><span class="lines">@@ -286,10 +288,17 @@
</span><span class="cx">         # if records is not None:
</span><span class="cx">         #     matchingRecords &amp;= records
</span><span class="cx"> 
</span><ins>+        if recordTypes is not None:
+            for record in list(matchingRecords):
+                if record.recordType not in recordTypes:
+                    matchingRecords.remove(record)
+
</ins><span class="cx">         return succeed(matchingRecords)
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def unIndexedRecordsFromMatchExpression(self, expression, records=None):
</del><ins>+    def unIndexedRecordsFromMatchExpression(
+        self, expression, recordTypes=None, records=None
+    ):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Finds records not in the internal indexes matching a single expression.
</span><span class="cx"> 
</span><span class="lines">@@ -312,6 +321,11 @@
</span><span class="cx">             )
</span><span class="cx"> 
</span><span class="cx">         for record in records:
</span><ins>+
+            if recordTypes is not None:
+                if record.recordType not in recordTypes:
+                    continue
+
</ins><span class="cx">             fieldValues = record.fields.get(expression.fieldName, None)
</span><span class="cx"> 
</span><span class="cx">             if fieldValues is None:
</span><span class="lines">@@ -324,7 +338,9 @@
</span><span class="cx">         return succeed(result)
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def recordsFromNonCompoundExpression(self, expression, records=None):
</del><ins>+    def recordsFromNonCompoundExpression(
+        self, expression, recordTypes=None, records=None
+    ):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         This implementation can handle L{MatchExpression} expressions; other
</span><span class="cx">         expressions are passed up to the superclass.
</span><span class="lines">@@ -332,15 +348,15 @@
</span><span class="cx">         if isinstance(expression, MatchExpression):
</span><span class="cx">             if expression.fieldName in self.indexedFields:
</span><span class="cx">                 return self.indexedRecordsFromMatchExpression(
</span><del>-                    expression, records=records
</del><ins>+                    expression, recordTypes=recordTypes, records=records
</ins><span class="cx">                 )
</span><span class="cx">             else:
</span><span class="cx">                 return self.unIndexedRecordsFromMatchExpression(
</span><del>-                    expression, records=records
</del><ins>+                    expression, recordTypes=recordTypes, records=records
</ins><span class="cx">                 )
</span><span class="cx">         else:
</span><span class="cx">             return BaseDirectoryService.recordsFromNonCompoundExpression(
</span><del>-                self, expression, records=records
</del><ins>+                self, expression, recordTypes=recordTypes, records=records
</ins><span class="cx">             )
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="twexttrunktwextwholdap_servicepy"></a>
<div class="modfile"><h4>Modified: twext/trunk/twext/who/ldap/_service.py (13659 => 13660)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/twext/who/ldap/_service.py        2014-06-18 21:13:12 UTC (rev 13659)
+++ twext/trunk/twext/who/ldap/_service.py        2014-06-18 21:13:47 UTC (rev 13660)
</span><span class="lines">@@ -408,7 +408,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><del>-    def _recordsFromQueryString(self, queryString):
</del><ins>+    def _recordsFromQueryString(self, queryString, recordTypes=None):
</ins><span class="cx">         connection = yield self._connect()
</span><span class="cx"> 
</span><span class="cx">         self.log.info(&quot;Performing LDAP query: {query}&quot;, query=queryString)
</span><span class="lines">@@ -428,7 +428,7 @@
</span><span class="cx">             )
</span><span class="cx">             raise LDAPQueryError(&quot;Unable to perform query&quot;, e)
</span><span class="cx"> 
</span><del>-        records = yield self._recordsFromReply(reply)
</del><ins>+        records = yield self._recordsFromReply(reply, recordTypes=recordTypes)
</ins><span class="cx">         returnValue(records)
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -455,7 +455,7 @@
</span><span class="cx">             returnValue(None)
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def _recordsFromReply(self, reply):
</del><ins>+    def _recordsFromReply(self, reply, recordTypes=None):
</ins><span class="cx">         records = []
</span><span class="cx"> 
</span><span class="cx">         for dn, recordData in reply:
</span><span class="lines">@@ -474,6 +474,9 @@
</span><span class="cx">                 )
</span><span class="cx">                 continue
</span><span class="cx"> 
</span><ins>+            if recordTypes is not None and recordType not in recordTypes:
+                continue
+
</ins><span class="cx">             # Populate a fields dictionary
</span><span class="cx"> 
</span><span class="cx">             fields = {}
</span><span class="lines">@@ -527,20 +530,26 @@
</span><span class="cx">         return records
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def recordsFromNonCompoundExpression(self, expression, records=None):
</del><ins>+    def recordsFromNonCompoundExpression(
+        self, expression, recordTypes=None, records=None
+    ):
</ins><span class="cx">         if isinstance(expression, MatchExpression):
</span><span class="cx">             queryString = ldapQueryStringFromMatchExpression(
</span><span class="cx">                 expression,
</span><span class="cx">                 self._fieldNameToAttributesMap, self._recordTypeSchemas
</span><span class="cx">             )
</span><del>-            return self._recordsFromQueryString(queryString)
</del><ins>+            return self._recordsFromQueryString(
+                queryString, recordTypes=recordTypes
+            )
</ins><span class="cx"> 
</span><span class="cx">         return BaseDirectoryService.recordsFromNonCompoundExpression(
</span><span class="cx">             self, expression, records=records
</span><span class="cx">         )
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def recordsFromCompoundExpression(self, expression, records=None):
</del><ins>+    def recordsFromCompoundExpression(
+        self, expression, recordTypes=None, records=None
+    ):
</ins><span class="cx">         if not expression.expressions:
</span><span class="cx">             return succeed(())
</span><span class="cx"> 
</span><span class="lines">@@ -548,7 +557,9 @@
</span><span class="cx">             expression,
</span><span class="cx">             self._fieldNameToAttributesMap, self._recordTypeSchemas
</span><span class="cx">         )
</span><del>-        return self._recordsFromQueryString(queryString)
</del><ins>+        return self._recordsFromQueryString(
+            queryString, recordTypes=recordTypes
+        )
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     # def updateRecords(self, records, create=False):
</span></span></pre></div>
<a id="twexttrunktwextwhoopendirectory_servicepy"></a>
<div class="modfile"><h4>Modified: twext/trunk/twext/who/opendirectory/_service.py (13659 => 13660)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/twext/who/opendirectory/_service.py        2014-06-18 21:13:12 UTC (rev 13659)
+++ twext/trunk/twext/who/opendirectory/_service.py        2014-06-18 21:13:47 UTC (rev 13660)
</span><span class="lines">@@ -390,7 +390,7 @@
</span><span class="cx">         )
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def _queryFromCompoundExpression(self, expression, local=False):
</del><ins>+    def _queryFromCompoundExpression(self, expression, recordTypes=None, local=False):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Form an OpenDirectory query from a compound expression.
</span><span class="cx"> 
</span><span class="lines">@@ -410,22 +410,24 @@
</span><span class="cx">         else:
</span><span class="cx">             node = self.node
</span><span class="cx"> 
</span><del>-        queryString, recordTypes = (
</del><ins>+        queryString, expressionRecordTypes = (
</ins><span class="cx">             self._queryStringAndRecordTypesFromExpression(expression)
</span><span class="cx">         )
</span><del>-        if not recordTypes:
-            return None
</del><span class="cx"> 
</span><span class="cx">         # Scrub unsupported recordTypes
</span><span class="cx">         supportedODRecordTypes = []
</span><del>-        for rt in self.recordTypes():
-            odRecordType = ODRecordType.fromRecordType(rt)
</del><ins>+        for recordType in self.recordTypes():
+            odRecordType = ODRecordType.fromRecordType(recordType)
</ins><span class="cx">             if odRecordType is not None:
</span><span class="cx">                 supportedODRecordTypes.append(odRecordType.value)
</span><del>-        scrubbedRecordTypes = []
-        for recordType in recordTypes:
-            if recordType in supportedODRecordTypes:
-                scrubbedRecordTypes.append(recordType)
</del><ins>+        if recordTypes is not None:
+            scrubbedRecordTypes = []
+            for recordType in recordTypes:
+                recordType = ODRecordType.fromRecordType(recordType).value
+                if recordType in supportedODRecordTypes:
+                    scrubbedRecordTypes.append(recordType)
+        else:
+            scrubbedRecordTypes = supportedODRecordTypes
</ins><span class="cx"> 
</span><span class="cx">         if not scrubbedRecordTypes:
</span><span class="cx">             # None of the requested recordTypes are supported.
</span><span class="lines">@@ -464,7 +466,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def _queryFromMatchExpression(
</span><del>-        self, expression, recordType=None, local=False
</del><ins>+        self, expression, recordTypes=None, local=False
</ins><span class="cx">     ):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Form an OpenDirectory query from a match expression.
</span><span class="lines">@@ -472,8 +474,8 @@
</span><span class="cx">         @param expression: A match expression.
</span><span class="cx">         @type expression: L{MatchExpression}
</span><span class="cx"> 
</span><del>-        @param recordType: A record type to insert into the query.
-        @type recordType: L{NamedConstant}
</del><ins>+        @param recordTypes: Record types to insert into the query; None for no filtering.
+        @type recordTypes: iterable of L{NamedConstant}, or None
</ins><span class="cx"> 
</span><span class="cx">         @param local: Whether to restrict the query to the local node
</span><span class="cx">         @type local: C{Boolean}
</span><span class="lines">@@ -506,47 +508,27 @@
</span><span class="cx">             expression.fieldName = self.fieldName.guid
</span><span class="cx"> 
</span><span class="cx">         if expression.fieldName is self.fieldName.recordType:
</span><del>-            if (
-                recordType is not None and
-                expression.fieldValue is not recordType
-            ):
-                raise ValueError(
-                    &quot;recordType argument does not match expression&quot;
-                )
</del><ins>+            raise QueryNotSupportedError(&quot;RecordType match not supported&quot;)
</ins><span class="cx"> 
</span><del>-            recordTypes = [
-                ODRecordType.fromRecordType(expression.fieldValue).value
-            ]
-            if MatchFlags.NOT in flags:
-                recordTypes = list(
-                    set([t.value for t in ODRecordType.iterconstants()]) -
-                    recordTypes
-                )
</del><ins>+        if MatchFlags.NOT in flags:
+            raise NotImplementedError()
</ins><span class="cx"> 
</span><del>-            matchType = ODMatchType.any.value
-            queryAttribute = None
-            queryValue = None
-
</del><ins>+        if recordTypes is None:
+            odRecordTypes = [t.value for t in ODRecordType.iterconstants()]
</ins><span class="cx">         else:
</span><del>-            if MatchFlags.NOT in flags:
-                raise NotImplementedError()
</del><ins>+            odRecordTypes = [ODRecordType.fromRecordType(r).value for r in recordTypes]
</ins><span class="cx"> 
</span><del>-            if recordType is None:
-                recordTypes = [t.value for t in ODRecordType.iterconstants()]
-            else:
-                recordTypes = [ODRecordType.fromRecordType(recordType).value]
</del><ins>+        queryAttribute = ODAttribute.fromFieldName(
+            expression.fieldName
+        ).value
</ins><span class="cx"> 
</span><del>-            queryAttribute = ODAttribute.fromFieldName(
-                expression.fieldName
-            ).value
</del><ins>+        # TODO: Add support other value types:
+        valueType = self.fieldName.valueType(expression.fieldName)
+        if valueType == UUID:
+            queryValue = unicode(expression.fieldValue).upper()
+        else:
+            queryValue = unicode(expression.fieldValue)
</ins><span class="cx"> 
</span><del>-            # TODO: Add support other value types:
-            valueType = self.fieldName.valueType(expression.fieldName)
-            if valueType == UUID:
-                queryValue = unicode(expression.fieldValue).upper()
-            else:
-                queryValue = unicode(expression.fieldValue)
-
</del><span class="cx">         if local:
</span><span class="cx">             node = self.localNode
</span><span class="cx">         else:
</span><span class="lines">@@ -559,9 +541,9 @@
</span><span class="cx">             if odRecordType is not None:
</span><span class="cx">                 supportedODRecordTypes.append(odRecordType.value)
</span><span class="cx">         scrubbedRecordTypes = []
</span><del>-        for recordType in recordTypes:
-            if recordType in supportedODRecordTypes:
-                scrubbedRecordTypes.append(recordType)
</del><ins>+        for odRecordType in odRecordTypes:
+            if odRecordType in supportedODRecordTypes:
+                scrubbedRecordTypes.append(odRecordType)
</ins><span class="cx"> 
</span><span class="cx">         if not scrubbedRecordTypes:
</span><span class="cx">             # None of the requested recordTypes are supported.
</span><span class="lines">@@ -704,10 +686,10 @@
</span><span class="cx">         return succeed(result)
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def recordsFromNonCompoundExpression(self, expression, records=None):
</del><ins>+    def recordsFromNonCompoundExpression(self, expression, recordTypes=None, records=None):
</ins><span class="cx">         if isinstance(expression, MatchExpression):
</span><span class="cx">             try:
</span><del>-                query = self._queryFromMatchExpression(expression)
</del><ins>+                query = self._queryFromMatchExpression(expression, recordTypes=recordTypes)
</ins><span class="cx">                 return self._recordsFromQuery(query)
</span><span class="cx"> 
</span><span class="cx">             except QueryNotSupportedError:
</span><span class="lines">@@ -722,7 +704,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><del>-    def recordsFromCompoundExpression(self, expression, records=None):
</del><ins>+    def recordsFromCompoundExpression(self, expression, recordTypes=None, records=None):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Returns records matching the CompoundExpression.  Because the
</span><span class="cx">         local node doesn't perform Compound queries in a case insensitive
</span><span class="lines">@@ -733,13 +715,13 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">         try:
</span><del>-            query = self._queryFromCompoundExpression(expression)
</del><ins>+            query = self._queryFromCompoundExpression(expression, recordTypes=recordTypes)
</ins><span class="cx"> 
</span><span class="cx">         except QueryNotSupportedError:
</span><span class="cx">             returnValue(
</span><span class="cx">                 (
</span><span class="cx">                     yield BaseDirectoryService.recordsFromCompoundExpression(
</span><del>-                        self, expression
</del><ins>+                        self, expression, recordTypes=recordTypes
</ins><span class="cx">                     )
</span><span class="cx">                 )
</span><span class="cx">             )
</span><span class="lines">@@ -749,7 +731,7 @@
</span><span class="cx">         if self.localNode is not None:
</span><span class="cx"> 
</span><span class="cx">             localRecords = yield self.localRecordsFromCompoundExpression(
</span><del>-                expression
</del><ins>+                expression, recordTypes=recordTypes
</ins><span class="cx">             )
</span><span class="cx">             for localRecord in localRecords:
</span><span class="cx">                 if localRecord not in results:
</span><span class="lines">@@ -760,7 +742,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><del>-    def localRecordsFromCompoundExpression(self, expression):
</del><ins>+    def localRecordsFromCompoundExpression(self, expression, recordTypes=None):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Takes a CompoundExpression, and recursively goes through each
</span><span class="cx">         MatchExpression, passing those specifically to the local node, and
</span><span class="lines">@@ -778,13 +760,13 @@
</span><span class="cx"> 
</span><span class="cx">             if isinstance(subExpression, CompoundExpression):
</span><span class="cx">                 subRecords = yield self.localRecordsFromCompoundExpression(
</span><del>-                    subExpression
</del><ins>+                    subExpression, recordTypes=recordTypes
</ins><span class="cx">                 )
</span><span class="cx"> 
</span><span class="cx">             elif isinstance(subExpression, MatchExpression):
</span><span class="cx">                 try:
</span><span class="cx">                     subQuery = self._queryFromMatchExpression(
</span><del>-                        subExpression, local=True
</del><ins>+                        subExpression, recordTypes=recordTypes, local=True
</ins><span class="cx">                     )
</span><span class="cx">                 except UnsupportedRecordTypeError:
</span><span class="cx">                     continue
</span><span class="lines">@@ -857,7 +839,7 @@
</span><span class="cx">         try:
</span><span class="cx">             query = self._queryFromMatchExpression(
</span><span class="cx">                 MatchExpression(self.fieldName.shortNames, shortName),
</span><del>-                recordType=recordType
</del><ins>+                recordTypes=(recordType,)
</ins><span class="cx">             )
</span><span class="cx">             results = yield self._recordsFromQuery(query)
</span><span class="cx"> 
</span></span></pre></div>
<a id="twexttrunktwextwhotesttest_directorypy"></a>
<div class="modfile"><h4>Modified: twext/trunk/twext/who/test/test_directory.py (13659 => 13660)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/twext/who/test/test_directory.py        2014-06-18 21:13:12 UTC (rev 13659)
+++ twext/trunk/twext/who/test/test_directory.py        2014-06-18 21:13:47 UTC (rev 13660)
</span><span class="lines">@@ -62,15 +62,17 @@
</span><span class="cx">         self.seenExpressions = []
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def recordsFromExpression(self, expression, records=None):
</del><ins>+    def recordsFromExpression(self, expression, recordTypes=None, records=None):
</ins><span class="cx">         self.seenExpressions.append(expression)
</span><span class="cx">         return (
</span><span class="cx">             super(StubDirectoryService, self)
</span><del>-            .recordsFromExpression(expression)
</del><ins>+            .recordsFromExpression(expression, recordTypes=recordTypes)
</ins><span class="cx">         )
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def recordsFromNonCompoundExpression(self, expression, records=None):
</del><ins>+    def recordsFromNonCompoundExpression(
+        self, expression, recordTypes=None, records=None
+    ):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         This implementation handles three expressions:
</span><span class="cx"> 
</span><span class="lines">@@ -94,7 +96,9 @@
</span><span class="cx"> 
</span><span class="cx">         return (
</span><span class="cx">             super(StubDirectoryService, self)
</span><del>-            .recordsFromNonCompoundExpression(expression, records=records)
</del><ins>+            .recordsFromNonCompoundExpression(
+                expression, recordTypes=recordTypes, records=records
+            )
</ins><span class="cx">         )
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -1149,7 +1153,23 @@
</span><span class="cx">             ],
</span><span class="cx">         )
</span><span class="cx"> 
</span><ins>+        self.addGroup(
+            shortNames=[u&quot;calendar-dev&quot;],
+            fullNames=[u&quot;Calendar Developers&quot;],
+            emailAddresses=[
+                u&quot;calendar-dev@example.com&quot;,
+            ],
+        )
</ins><span class="cx"> 
</span><ins>+        self.addGroup(
+            shortNames=[u&quot;developers&quot;],
+            fullNames=[u&quot;Developers&quot;],
+            emailAddresses=[
+                u&quot;developers@example.com&quot;,
+            ],
+        )
+
+
</ins><span class="cx">     def addUser(self, shortNames, fullNames, emailAddresses=[]):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Add a user record with the given field information.
</span><span class="lines">@@ -1177,6 +1197,32 @@
</span><span class="cx">         }))
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+    def addGroup(self, shortNames, fullNames, emailAddresses=[]):
+        &quot;&quot;&quot;
+        Add a group record with the given field information.
+
+        @param shortNames: Record short names.
+        @type shortNames: L{list} of L{unicode}s
+
+        @param fullNames: Record full names.
+        @type fullNames: L{list} of L{unicode}s
+
+        @param emailAddresses: Record email addresses.
+        @type emailAddresses: L{list} of L{unicode}s
+        &quot;&quot;&quot;
+        service = self.service
+        fieldName = service.fieldName
+        recordType = service.recordType
+
+        self.records.append(self.recordClass(self.service, {
+            fieldName.recordType: recordType.group,
+            fieldName.uid: u&quot;__{0}__&quot;.format(shortNames[0]),
+            fieldName.shortNames: shortNames,
+            fieldName.fullNames: fullNames,
+            fieldName.emailAddresses: emailAddresses,
+        }))
+
+
</ins><span class="cx">     def __iter__(self):
</span><span class="cx">         return iter(self.records)
</span><span class="cx"> 
</span></span></pre></div>
<a id="twexttrunktwextwhotesttest_indexpy"></a>
<div class="modfile"><h4>Modified: twext/trunk/twext/who/test/test_index.py (13659 => 13660)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/twext/who/test/test_index.py        2014-06-18 21:13:12 UTC (rev 13659)
+++ twext/trunk/twext/who/test/test_index.py        2014-06-18 21:13:47 UTC (rev 13660)
</span><span class="lines">@@ -149,6 +149,7 @@
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def _test_indexedRecordsFromMatchExpression(
</span><span class="cx">         self, inOut, matchType, fieldName=BaseFieldName.shortNames,
</span><ins>+        recordTypes=None
</ins><span class="cx">     ):
</span><span class="cx">         service = self.noLoadServicePopulated()
</span><span class="cx"> 
</span><span class="lines">@@ -157,7 +158,8 @@
</span><span class="cx">                 MatchExpression(
</span><span class="cx">                     fieldName, subString,
</span><span class="cx">                     matchType
</span><del>-                )
</del><ins>+                ),
+                recordTypes=recordTypes,
</ins><span class="cx">             )
</span><span class="cx">             self.assertEquals(
</span><span class="cx">                 set((record.uid for record in records)),
</span><span class="lines">@@ -238,9 +240,25 @@
</span><span class="cx">         self.assertFailure(result, NotImplementedError)
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+    def test_indexedRecordsFromMatchExpression_recordTypes(self):
+        &quot;&quot;&quot;
+        L{DirectoryService.indexedRecordsFromMatchExpression} with recordTypes
+        &quot;&quot;&quot;
+        return self._test_indexedRecordsFromMatchExpression(
+            (
+                (u&quot;c&quot;, (u&quot;__calendar-dev__&quot;,)),  # only groups
+                (u&quot;d&quot;, (u&quot;__developers__&quot;,)),
+                (u&quot;j&quot;, ()),
+            ),
+            MatchType.startsWith,
+            recordTypes=(BaseRecordType.group,)
+        )
+
+
</ins><span class="cx">     @inlineCallbacks
</span><span class="cx">     def _test_unIndexedRecordsFromMatchExpression(
</span><span class="cx">         self, inOut, matchType, fieldName=BaseFieldName.fullNames,
</span><ins>+        recordTypes=None
</ins><span class="cx">     ):
</span><span class="cx">         service = self.noLoadServicePopulated()
</span><span class="cx"> 
</span><span class="lines">@@ -249,7 +267,8 @@
</span><span class="cx">                 MatchExpression(
</span><span class="cx">                     fieldName, subString,
</span><span class="cx">                     matchType
</span><del>-                )
</del><ins>+                ),
+                recordTypes=recordTypes
</ins><span class="cx">             )
</span><span class="cx">             self.assertEquals(
</span><span class="cx">                 set((record.uid for record in records)),
</span></span></pre></div>
<a id="twexttrunktwextwhotesttest_xmlpy"></a>
<div class="modfile"><h4>Modified: twext/trunk/twext/who/test/test_xml.py (13659 => 13660)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/twext/who/test/test_xml.py        2014-06-18 21:13:12 UTC (rev 13659)
+++ twext/trunk/twext/who/test/test_xml.py        2014-06-18 21:13:47 UTC (rev 13660)
</span><span class="lines">@@ -557,7 +557,28 @@
</span><span class="cx">         self.assertRecords(records, (u&quot;__wsanchez__&quot;,))
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+    @inlineCallbacks
+    def test_queryWithRecordTypes(self):
+        &quot;&quot;&quot;
+        Verify that results are limited to the requested recordTypes
+        &quot;&quot;&quot;
+        service = self.service()
+        records = yield service.recordsFromExpression(
+            service.query(
+                u&quot;fullNames&quot;, u&quot;e&quot;,
+                matchType=MatchType.contains,
+            ),
+            recordTypes=(service.recordType.group,)
+        )
+        # Note: only contains groups; the users that would normally match
+        # have been filtered out
+        self.assertRecords(
+            records,
+            (u&quot;__calendar-dev__&quot;, u&quot;__developers__&quot;, u&quot;__twisted__&quot;)
+        )
</ins><span class="cx"> 
</span><ins>+
+
</ins><span class="cx"> class DirectoryServiceMutableTestMixIn(object):
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_updateRecord(self):
</span></span></pre>
</div>
</div>

</body>
</html>