[CalendarServer-changes] [11870] CalendarServer/trunk/twext/who
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 11:18:42 PDT 2014
Revision: 11870
http://trac.calendarserver.org//changeset/11870
Author: wsanchez at apple.com
Date: 2013-11-01 14:46:19 -0700 (Fri, 01 Nov 2013)
Log Message:
-----------
cosmetic
Modified Paths:
--------------
CalendarServer/trunk/twext/who/idirectory.py
CalendarServer/trunk/twext/who/util.py
Modified: CalendarServer/trunk/twext/who/idirectory.py
===================================================================
--- CalendarServer/trunk/twext/who/idirectory.py 2013-11-01 19:14:17 UTC (rev 11869)
+++ CalendarServer/trunk/twext/who/idirectory.py 2013-11-01 21:46:19 UTC (rev 11870)
@@ -185,9 +185,12 @@
def recordsFromExpression(self, expression):
"""
Find records matching an expression.
+
@param expression: an expression to apply
@type expression: L{object}
+
@return: a deferred iterable of matching L{IDirectoryRecord}s.
+
@raises: L{QueryNotSupportedError} if the expression is not
supported by this directory service.
"""
@@ -197,11 +200,15 @@
"""
Find records by composing a query consisting of an iterable of
expressions and an operand.
+
@param expressions: expressions to query against
@type expressions: iterable of L{object}s
+
@param operand: an operand
@type operand: a L{NamedConstant}
+
@return: a deferred iterable of matching L{IDirectoryRecord}s.
+
@raises: L{QueryNotSupportedError} if the query is not
supported by this directory service.
"""
@@ -211,10 +218,13 @@
"""
Find records that have the given field name with the given
value.
+
@param fieldName: a field name
@type fieldName: L{NamedConstant}
+
@param value: a value to match
@type value: L{bytes}
+
@return: a deferred iterable of L{IDirectoryRecord}s.
"""
@@ -222,8 +232,10 @@
def recordWithUID(uid):
"""
Find the record that has the given UID.
+
@param uid: a UID
@type uid: L{bytes}
+
@return: a deferred iterable of L{IDirectoryRecord}s, or
C{None} if there is no such record.
"""
@@ -232,8 +244,10 @@
def recordWithGUID(guid):
"""
Find the record that has the given GUID.
+
@param guid: a GUID
@type guid: L{bytes}
+
@return: a deferred iterable of L{IDirectoryRecord}s, or
C{None} if there is no such record.
"""
@@ -242,8 +256,10 @@
def recordsWithRecordType(recordType):
"""
Find the records that have the given record type.
+
@param recordType: a record type
@type recordType: L{NamedConstant}
+
@return: a deferred iterable of L{IDirectoryRecord}s.
"""
@@ -251,10 +267,13 @@
def recordWithShortName(recordType, shortName):
"""
Find the record that has the given record type and short name.
+
@param recordType: a record type
@type recordType: L{NamedConstant}
+
@param shortName: a short name
@type shortName: L{bytes}
+
@return: a deferred iterable of L{IDirectoryRecord}s, or
C{None} if there is no such record.
"""
@@ -263,8 +282,10 @@
def recordsWithEmailAddress(emailAddress):
"""
Find the records that have the given email address.
+
@param emailAddress: an email address
@type emailAddress: L{bytes}
+
@return: a deferred iterable of L{IDirectoryRecord}s, or
C{None} if there is no such record.
"""
@@ -273,8 +294,10 @@
def updateRecords(records, create=False):
"""
Updates existing directory records.
+
@param records: the records to update
@type records: iterable of L{IDirectoryRecord}s
+
@param create: if true, create records if necessary
@type create: boolean
"""
@@ -283,6 +306,7 @@
def removeRecords(uids):
"""
Removes the records with the given UIDs.
+
@param uids: the UIDs of the records to remove
@type uids: iterable of L{bytes}
"""
Modified: CalendarServer/trunk/twext/who/util.py
===================================================================
--- CalendarServer/trunk/twext/who/util.py 2013-11-01 19:14:17 UTC (rev 11869)
+++ CalendarServer/trunk/twext/who/util.py 2013-11-01 21:46:19 UTC (rev 11870)
@@ -45,15 +45,18 @@
self._constants = myConstants
+
def __getattr__(self, name):
try:
return self._constants[name]
except KeyError:
raise AttributeError(name)
+
def iterconstants(self):
return self._constants.itervalues()
+
def lookupByName(self, name):
try:
return self._constants[name]
@@ -61,6 +64,7 @@
raise ValueError(name)
+
def uniqueResult(values):
result = None
for value in values:
@@ -73,6 +77,7 @@
return result
+
def describe(constant):
if isinstance(constant, FlagConstant):
parts = []
@@ -83,6 +88,7 @@
return getattr(constant, "description", constant.name)
+
def iterFlags(flags):
if hasattr(flags, "__iter__"):
return flags
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/d32e61f7/attachment.html>
More information about the calendarserver-changes
mailing list