<!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>[12916] CalendarServer/branches/users/sagen/move2who-4/txdav/who</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/12916">12916</a></dd>
<dt>Author</dt> <dd>wsanchez@apple.com</dd>
<dt>Date</dt> <dd>2014-03-14 15:43:31 -0700 (Fri, 14 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Minor cleanup</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesuserssagenmove2who4txdavwhoaugmentpy">CalendarServer/branches/users/sagen/move2who-4/txdav/who/augment.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who4txdavwhodelegatespy">CalendarServer/branches/users/sagen/move2who-4/txdav/who/delegates.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who4txdavwhodirectorypy">CalendarServer/branches/users/sagen/move2who-4/txdav/who/directory.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who4txdavwhoidirectorypy">CalendarServer/branches/users/sagen/move2who-4/txdav/who/idirectory.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who4txdavwhoutilpy">CalendarServer/branches/users/sagen/move2who-4/txdav/who/util.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesuserssagenmove2who4txdavwhoaugmentpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-4/txdav/who/augment.py (12915 => 12916)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-4/txdav/who/augment.py        2014-03-14 20:39:02 UTC (rev 12915)
+++ CalendarServer/branches/users/sagen/move2who-4/txdav/who/augment.py        2014-03-14 22:43:31 UTC (rev 12916)
</span><span class="lines">@@ -19,65 +19,41 @@
</span><span class="cx"> Augmenting Directory Service
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="cx"> 
</span><ins>+__all__ = [
+    &quot;AugmentedDirectoryService&quot;,
+]
+
+from zope.interface import implementer
+
+from twisted.internet.defer import inlineCallbacks, returnValue
+
</ins><span class="cx"> from twext.python.log import Logger
</span><span class="cx"> from twext.who.directory import DirectoryRecord
</span><span class="cx"> from twext.who.directory import DirectoryService as BaseDirectoryService
</span><span class="cx"> from twext.who.idirectory import IDirectoryService, RecordType
</span><span class="cx"> from twext.who.util import ConstantsContainer
</span><del>-from twisted.internet.defer import inlineCallbacks, returnValue
</del><ins>+
</ins><span class="cx"> from txdav.common.idirectoryservice import IStoreDirectoryService
</span><span class="cx"> from txdav.who.directory import (
</span><span class="cx">     CalendarDirectoryRecordMixin, CalendarDirectoryServiceMixin
</span><span class="cx"> )
</span><span class="cx"> from txdav.who.idirectory import AutoScheduleMode, FieldName
</span><del>-from zope.interface import implementer
</del><span class="cx"> 
</span><del>-
</del><span class="cx"> log = Logger()
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class AugmentedDirectoryRecord(DirectoryRecord, CalendarDirectoryRecordMixin):
</del><span class="cx"> 
</span><del>-    def __init__(self, service, baseRecord, augmentedFields):
-        DirectoryRecord.__init__(self, service, augmentedFields)
-        self._baseRecord = baseRecord
</del><ins>+@implementer(IDirectoryService, IStoreDirectoryService)
+class AugmentedDirectoryService(
+    BaseDirectoryService, CalendarDirectoryServiceMixin
+):
+    &quot;&quot;&quot;
+    Augmented directory service.
</ins><span class="cx"> 
</span><ins>+    This is a directory service that wraps an L{IDirectoryService} and augments
+    directory records with additional or modified fields.
+    &quot;&quot;&quot;
</ins><span class="cx"> 
</span><del>-    @inlineCallbacks
-    def members(self):
-        augmented = []
-        records = yield self._baseRecord.members()
-        for record in records:
-            augmented.append((yield self.service.augment(record)))
-        returnValue(augmented)
-
-
-    @inlineCallbacks
-    def groups(self):
-        augmented = []
-        txn = self.service._store.newTransaction()
-        groupUIDs = yield txn.groupsFor(self.uid)
-        for groupUID in groupUIDs:
-            groupRecord = yield self.service.recordWithShortName(
-                RecordType.group, groupUID
-            )
-            if groupRecord:
-                augmented.append((yield self.service.augment(groupRecord)))
-        returnValue(augmented)
-
-
-    def verifyPlaintextPassword(self, password):
-        return self._baseRecord.verifyPlaintextPassword(password)
-
-
-    def verifyHTTPDigest(self, *args):
-        return self._baseRecord.verifyHTTPDigest(*args)
-
-
-@implementer(IDirectoryService, IStoreDirectoryService)
-class AugmentedDirectoryService(BaseDirectoryService,
-                                CalendarDirectoryServiceMixin):
-
</del><span class="cx">     fieldName = ConstantsContainer((
</span><span class="cx">         BaseDirectoryService.fieldName,
</span><span class="cx">         FieldName,
</span><span class="lines">@@ -86,9 +62,7 @@
</span><span class="cx"> 
</span><span class="cx">     @property
</span><span class="cx">     def recordType(self):
</span><del>-        &quot;&quot;&quot;
-        Defer to the directory service we're augmenting
-        &quot;&quot;&quot;
</del><ins>+        # Defer to the directory service we're augmenting
</ins><span class="cx">         return self._directory.recordType
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -100,6 +74,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def recordTypes(self):
</span><ins>+        # Defer to the directory service we're augmenting
</ins><span class="cx">         return self._directory.recordTypes()
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -108,7 +83,7 @@
</span><span class="cx">         records = yield self._directory.recordsFromExpression(expression)
</span><span class="cx">         augmented = []
</span><span class="cx">         for record in records:
</span><del>-            record = yield self.augment(record)
</del><ins>+            record = yield self._augment(record)
</ins><span class="cx">             augmented.append(record)
</span><span class="cx">         returnValue(augmented)
</span><span class="cx"> 
</span><span class="lines">@@ -120,7 +95,7 @@
</span><span class="cx">         )
</span><span class="cx">         augmented = []
</span><span class="cx">         for record in records:
</span><del>-            record = yield self.augment(record)
</del><ins>+            record = yield self._augment(record)
</ins><span class="cx">             augmented.append(record)
</span><span class="cx">         returnValue(augmented)
</span><span class="cx"> 
</span><span class="lines">@@ -133,14 +108,14 @@
</span><span class="cx">             uid = uid.decode(&quot;utf-8&quot;)
</span><span class="cx"> 
</span><span class="cx">         record = yield self._directory.recordWithUID(uid)
</span><del>-        record = yield self.augment(record)
</del><ins>+        record = yield self._augment(record)
</ins><span class="cx">         returnValue(record)
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def recordWithGUID(self, guid):
</span><span class="cx">         record = yield self._directory.recordWithGUID(guid)
</span><del>-        record = yield self.augment(record)
</del><ins>+        record = yield self._augment(record)
</ins><span class="cx">         returnValue(record)
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -149,7 +124,7 @@
</span><span class="cx">         records = yield self._directory.recordsWithRecordType(recordType)
</span><span class="cx">         augmented = []
</span><span class="cx">         for record in records:
</span><del>-            record = yield self.augment(record)
</del><ins>+            record = yield self._augment(record)
</ins><span class="cx">             augmented.append(record)
</span><span class="cx">         returnValue(augmented)
</span><span class="cx"> 
</span><span class="lines">@@ -166,8 +141,10 @@
</span><span class="cx">             log.warn(&quot;Need to change shortName to unicode&quot;)
</span><span class="cx">             shortName = shortName.decode(&quot;utf-8&quot;)
</span><span class="cx"> 
</span><del>-        record = yield self._directory.recordWithShortName(recordType, shortName)
-        record = yield self.augment(record)
</del><ins>+        record = yield self._directory.recordWithShortName(
+            recordType, shortName
+        )
+        record = yield self._augment(record)
</ins><span class="cx">         # log.debug(
</span><span class="cx">         #     &quot;Augment - recordWithShortName {rt}, {n} returned {r}, {u}&quot;,
</span><span class="cx">         #     rt=recordType.name,
</span><span class="lines">@@ -188,17 +165,18 @@
</span><span class="cx">         records = yield self._directory.recordsWithEmailAddress(emailAddress)
</span><span class="cx">         augmented = []
</span><span class="cx">         for record in records:
</span><del>-            record = yield self.augment(record)
</del><ins>+            record = yield self._augment(record)
</ins><span class="cx">             augmented.append(record)
</span><span class="cx">         returnValue(augmented)
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+    # FIXME: This shouldn't be here; we have recordsWithRecordType() above
</ins><span class="cx">     @inlineCallbacks
</span><span class="cx">     def listRecords(self, recordType):
</span><span class="cx">         records = yield self._directory.listRecords(recordType)
</span><span class="cx">         augmented = []
</span><span class="cx">         for record in records:
</span><del>-            record = yield self.augment(record)
</del><ins>+            record = yield self._augment(record)
</ins><span class="cx">             augmented.append(record)
</span><span class="cx">         returnValue(augmented)
</span><span class="cx"> 
</span><span class="lines">@@ -213,13 +191,13 @@
</span><span class="cx">         return self._directory.removeRecords(uids)
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def assignToField(self, fields, name, value):
</del><ins>+    def _assignToField(self, fields, name, value):
</ins><span class="cx">         field = self.fieldName.lookupByName(name)
</span><span class="cx">         fields[field] = value
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><del>-    def augment(self, record):
</del><ins>+    def _augment(self, record):
</ins><span class="cx">         if record is None:
</span><span class="cx">             returnValue(None)
</span><span class="cx"> 
</span><span class="lines">@@ -240,14 +218,15 @@
</span><span class="cx">         if augmentRecord:
</span><span class="cx">             # record.enabled = augmentRecord.enabled
</span><span class="cx">             # record.serverID = augmentRecord.serverID
</span><del>-            self.assignToField(
</del><ins>+            self._assignToField(
</ins><span class="cx">                 fields, &quot;hasCalendars&quot;,
</span><span class="cx">                 augmentRecord.enabledForCalendaring
</span><span class="cx">             )
</span><del>-            self.assignToField(
</del><ins>+            self._assignToField(
</ins><span class="cx">                 fields, &quot;hasContacts&quot;,
</span><span class="cx">                 augmentRecord.enabledForAddressBooks
</span><span class="cx">             )
</span><ins>+
</ins><span class="cx">             autoScheduleMode = {
</span><span class="cx">                 &quot;none&quot;: AutoScheduleMode.none,
</span><span class="cx">                 &quot;accept-always&quot;: AutoScheduleMode.accept,
</span><span class="lines">@@ -256,42 +235,101 @@
</span><span class="cx">                 &quot;decline-if-busy&quot;: AutoScheduleMode.declineIfBusy,
</span><span class="cx">                 &quot;automatic&quot;: AutoScheduleMode.acceptIfFreeDeclineIfBusy,
</span><span class="cx">             }.get(augmentRecord.autoScheduleMode, None)
</span><del>-            self.assignToField(
</del><ins>+
+            self._assignToField(
</ins><span class="cx">                 fields, &quot;autoScheduleMode&quot;,
</span><span class="cx">                 autoScheduleMode
</span><span class="cx">             )
</span><del>-            self.assignToField(
</del><ins>+            self._assignToField(
</ins><span class="cx">                 fields, &quot;autoAcceptGroup&quot;,
</span><span class="cx">                 unicode(augmentRecord.autoAcceptGroup)
</span><span class="cx">             )
</span><del>-            self.assignToField(
</del><ins>+            self._assignToField(
</ins><span class="cx">                 fields, &quot;loginAllowed&quot;,
</span><span class="cx">                 augmentRecord.enabledForLogin
</span><span class="cx">             )
</span><span class="cx"> 
</span><span class="cx">             if (
</span><span class="cx">                 (
</span><del>-                    fields.get(self.fieldName.lookupByName(&quot;hasCalendars&quot;), False) or
-                    fields.get(self.fieldName.lookupByName(&quot;hasContacts&quot;), False)
-                ) and record.recordType == RecordType.group
</del><ins>+                    fields.get(
+                        self.fieldName.lookupByName(&quot;hasCalendars&quot;), False
+                    ) or
+                    fields.get(
+                        self.fieldName.lookupByName(&quot;hasContacts&quot;), False
+                    )
+                ) and
+                record.recordType == RecordType.group
</ins><span class="cx">             ):
</span><del>-                self.assignToField(fields, &quot;hasCalendars&quot;, False)
-                self.assignToField(fields, &quot;hasContacts&quot;, False)
</del><ins>+                self._assignToField(fields, &quot;hasCalendars&quot;, False)
+                self._assignToField(fields, &quot;hasContacts&quot;, False)
</ins><span class="cx"> 
</span><span class="cx">                 # For augment records cloned from the Default augment record,
</span><span class="cx">                 # don't emit this message:
</span><span class="cx">                 if not augmentRecord.clonedFromDefault:
</span><del>-                    log.error(&quot;Group '%s(%s)' cannot be enabled for calendaring or address books&quot; % (record.guid, record.shortNames[0],))
</del><ins>+                    log.error(
+                        &quot;Group {record} cannot be enabled for &quot;
+                        &quot;calendaring or address books&quot;,
+                        record=record
+                    )
</ins><span class="cx"> 
</span><span class="cx">         else:
</span><span class="cx">             # Groups are by default always enabled
</span><del>-            # record.enabled = (record.recordType == record.service.recordType_groups)
</del><ins>+            # record.enabled = (
+            #     record.recordType == record.service.recordType_groups
+            # )
</ins><span class="cx">             # record.serverID = &quot;&quot;
</span><del>-            self.assignToField(fields, &quot;hasCalendars&quot;, False)
-            self.assignToField(fields, &quot;hasContacts&quot;, False)
-            self.assignToField(fields, &quot;loginAllowed&quot;, False)
</del><ins>+            self._assignToField(fields, &quot;hasCalendars&quot;, False)
+            self._assignToField(fields, &quot;hasContacts&quot;, False)
+            self._assignToField(fields, &quot;loginAllowed&quot;, False)
</ins><span class="cx"> 
</span><span class="cx">         # print(&quot;Augmented fields&quot;, fields)
</span><span class="cx"> 
</span><span class="cx">         # Clone to a new record with the augmented fields
</span><span class="cx">         returnValue(AugmentedDirectoryRecord(self, record, fields))
</span><ins>+
+
+
+class AugmentedDirectoryRecord(DirectoryRecord, CalendarDirectoryRecordMixin):
+    &quot;&quot;&quot;
+    Augmented directory record.
+    &quot;&quot;&quot;
+
+    def __init__(self, service, baseRecord, augmentedFields):
+        DirectoryRecord.__init__(self, service, augmentedFields)
+        self._baseRecord = baseRecord
+
+
+    @inlineCallbacks
+    def members(self):
+        augmented = []
+        records = yield self._baseRecord.members()
+
+        for record in records:
+            augmented.append((yield self.service._augment(record)))
+
+        returnValue(augmented)
+
+
+    @inlineCallbacks
+    def groups(self):
+        augmented = []
+
+        txn = self.service._store.newTransaction()
+        groupUIDs = yield txn.groupsFor(self.uid)
+
+        for groupUID in groupUIDs:
+            groupRecord = yield self.service.recordWithShortName(
+                RecordType.group, groupUID
+            )
+            if groupRecord:
+                augmented.append((yield self.service._augment(groupRecord)))
+
+        returnValue(augmented)
+
+
+    def verifyPlaintextPassword(self, password):
+        return self._baseRecord.verifyPlaintextPassword(password)
+
+
+    def verifyHTTPDigest(self, *args):
+        return self._baseRecord.verifyHTTPDigest(*args)
</ins></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who4txdavwhodelegatespy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-4/txdav/who/delegates.py (12915 => 12916)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-4/txdav/who/delegates.py        2014-03-14 20:39:02 UTC (rev 12915)
+++ CalendarServer/branches/users/sagen/move2who-4/txdav/who/delegates.py        2014-03-14 22:43:31 UTC (rev 12916)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue, succeed
</span><span class="cx"> from twisted.python.constants import Names, NamedConstant
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> log = Logger()
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -54,9 +53,9 @@
</span><span class="cx">     writeDelegatorGroup.description = u&quot;write-delegator-group&quot;
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> class DirectoryRecord(BaseDirectoryRecord):
</span><span class="cx"> 
</span><del>-
</del><span class="cx">     @inlineCallbacks
</span><span class="cx">     def members(self, expanded=False):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="lines">@@ -66,7 +65,7 @@
</span><span class="cx">         the members will consist of the records who have delegated *to*
</span><span class="cx">         this record.
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        parentUID, proxyType = self.uid.split(&quot;#&quot;)
</del><ins>+        parentUID, proxyType = self.uid.split(u&quot;#&quot;)
</ins><span class="cx"> 
</span><span class="cx">         txn = self.service._store.newTransaction()
</span><span class="cx"> 
</span><span class="lines">@@ -87,7 +86,7 @@
</span><span class="cx">         records = []
</span><span class="cx">         for uid in delegateUIDs:
</span><span class="cx">             if uid != parentUID:
</span><del>-                record = (yield self.service._masterDirectory.recordWithUID(uid))
</del><ins>+                record = yield self.service._masterDirectory.recordWithUID(uid)
</ins><span class="cx">                 if record is not None:
</span><span class="cx">                     records.append(record)
</span><span class="cx">         yield txn.commit()
</span><span class="lines">@@ -109,14 +108,13 @@
</span><span class="cx">         ):
</span><span class="cx">             raise NotAllowedError(&quot;Setting members not supported&quot;)
</span><span class="cx"> 
</span><del>-        parentUID, proxyType = self.uid.split(&quot;#&quot;)
</del><ins>+        parentUID, proxyType = self.uid.split(u&quot;#&quot;)
</ins><span class="cx">         readWrite = (self.recordType is RecordType.writeDelegateGroup)
</span><span class="cx"> 
</span><span class="cx">         log.debug(
</span><del>-            &quot;Setting delegate assignments for {u} ({rw}) to {m}&quot;.format(
-                u=parentUID, rw=(&quot;write&quot; if readWrite else &quot;read&quot;),
-                m=[r.uid for r in memberRecords]
-            )
</del><ins>+            &quot;Setting delegate assignments for {u} ({rw}) to {m}&quot;,
+            u=parentUID, rw=(&quot;write&quot; if readWrite else &quot;read&quot;),
+            m=[r.uid for r in memberRecords]
</ins><span class="cx">         )
</span><span class="cx"> 
</span><span class="cx">         txn = self.service._store.newTransaction()
</span><span class="lines">@@ -124,7 +122,9 @@
</span><span class="cx">         yield txn.removeDelegates(parentUID, readWrite)
</span><span class="cx">         yield txn.removeDelegateGroups(parentUID, readWrite)
</span><span class="cx"> 
</span><del>-        delegator = yield self.service._masterDirectory.recordWithUID(parentUID)
</del><ins>+        delegator = (
+            yield self.service._masterDirectory.recordWithUID(parentUID)
+        )
</ins><span class="cx"> 
</span><span class="cx">         for delegate in memberRecords:
</span><span class="cx">             yield addDelegate(txn, delegator, delegate, readWrite)
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who4txdavwhodirectorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-4/txdav/who/directory.py (12915 => 12916)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-4/txdav/who/directory.py        2014-03-14 20:39:02 UTC (rev 12915)
+++ CalendarServer/branches/users/sagen/move2who-4/txdav/who/directory.py        2014-03-14 22:43:31 UTC (rev 12916)
</span><span class="lines">@@ -18,7 +18,6 @@
</span><span class="cx"> Calendar/Contacts specific methods for DirectoryRecord
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> import uuid
</span><span class="cx"> 
</span><span class="cx"> from twext.python.log import Logger
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who4txdavwhoidirectorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-4/txdav/who/idirectory.py (12915 => 12916)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-4/txdav/who/idirectory.py        2014-03-14 20:39:02 UTC (rev 12915)
+++ CalendarServer/branches/users/sagen/move2who-4/txdav/who/idirectory.py        2014-03-14 22:43:31 UTC (rev 12916)
</span><span class="lines">@@ -23,6 +23,9 @@
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> __all__ = [
</span><ins>+    &quot;AutoScheduleMode&quot;,
+    &quot;RecordType&quot;,
+    &quot;FieldName&quot;,
</ins><span class="cx"> ]
</span><span class="cx"> 
</span><span class="cx"> from twisted.python.constants import Names, NamedConstant
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who4txdavwhoutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-4/txdav/who/util.py (12915 => 12916)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-4/txdav/who/util.py        2014-03-14 20:39:02 UTC (rev 12915)
+++ CalendarServer/branches/users/sagen/move2who-4/txdav/who/util.py        2014-03-14 22:43:31 UTC (rev 12916)
</span><span class="lines">@@ -42,8 +42,8 @@
</span><span class="cx">     txdav.dps.client.DirectoryService
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-    # MOVE2WHO FIXME: this needs to talk to its own separate database.  In fact,
-    # don't pass store=None if you already have called storeFromConfig()
</del><ins>+    # MOVE2WHO FIXME: this needs to talk to its own separate database.  In
+    # fact, don't pass store=None if you already have called storeFromConfig()
</ins><span class="cx">     # within this process.  Pass the existing store in here.
</span><span class="cx">     if store is None:
</span><span class="cx">         pool, txnFactory = getDBPool(config)
</span><span class="lines">@@ -70,13 +70,17 @@
</span><span class="cx">             directory = XMLDirectoryService(fp)
</span><span class="cx"> 
</span><span class="cx">         elif &quot;opendirectory&quot; in directoryType:
</span><del>-            from twext.who.opendirectory import DirectoryService as ODDirectoryService
</del><ins>+            from twext.who.opendirectory import (
+                DirectoryService as ODDirectoryService
+            )
</ins><span class="cx">             directory = ODDirectoryService()
</span><span class="cx"> 
</span><span class="cx">         elif &quot;ldap&quot; in directoryType:
</span><span class="cx">             if params.credentials.dn and params.credentials.password:
</span><del>-                creds = UsernamePassword(params.credentials.dn,
-                                         params.credentials.password)
</del><ins>+                creds = UsernamePassword(
+                    params.credentials.dn,
+                    params.credentials.password
+                )
</ins><span class="cx">             else:
</span><span class="cx">                 creds = None
</span><span class="cx">             directory = LDAPDirectoryService(
</span><span class="lines">@@ -99,12 +103,15 @@
</span><span class="cx">                 &quot;resources&quot;: CalRecordType.resource,
</span><span class="cx">                 &quot;addresses&quot;: CalRecordType.address,
</span><span class="cx">             }.get(recordTypeName, None)
</span><ins>+
</ins><span class="cx">             if recordType is None:
</span><span class="cx">                 log.error(&quot;Invalid Record Type: {rt}&quot;, rt=recordTypeName)
</span><span class="cx">                 raise DirectoryConfigurationError
</span><ins>+
</ins><span class="cx">             if recordType in types:
</span><span class="cx">                 log.error(&quot;Duplicate Record Type: {rt}&quot;, rt=recordTypeName)
</span><span class="cx">                 raise DirectoryConfigurationError
</span><ins>+
</ins><span class="cx">             types.append(recordType)
</span><span class="cx"> 
</span><span class="cx">         directory.recordType = ConstantsContainer(types)
</span></span></pre>
</div>
</div>

</body>
</html>