Commit 8d721ad5 authored by Tres Seaver's avatar Tres Seaver

  - Removed spurious 'self' argument from scarecrow interfaces;  suppressed
    'self' in interface methods created from actual method objects.
parent 24194aba
...@@ -53,6 +53,10 @@ Zope Changes ...@@ -53,6 +53,10 @@ Zope Changes
Bugs: Bugs:
- Removed spurious 'self' from scarecrow interfaces; updated
method-generation in Interface package to ignore self when
source is a method (rather than a function).
- Collector #32: Use difflib instead of ndiff - Collector #32: Use difflib instead of ndiff
- Fixed long standing bug in PythonScript where get_size returned - Fixed long standing bug in PythonScript where get_size returned
......
...@@ -10,7 +10,7 @@ CO_VARKEYWORDS = 8 ...@@ -10,7 +10,7 @@ CO_VARKEYWORDS = 8
class MethodClass: class MethodClass:
def fromFunction(self, func, interface=''): def fromFunction(self, func, interface='', strip_first=0):
m=Method(func.__name__, func.__doc__) m=Method(func.__name__, func.__doc__)
defaults=func.func_defaults or () defaults=func.func_defaults or ()
c=func.func_code c=func.func_code
...@@ -18,15 +18,17 @@ class MethodClass: ...@@ -18,15 +18,17 @@ class MethodClass:
names=c.co_varnames names=c.co_varnames
d={} d={}
nr=na-len(defaults) nr=na-len(defaults)
if nr==0:
if strip_first and nr==0: # 'strip_first' implies method, has 'self'
defaults=defaults[1:] defaults=defaults[1:]
nr=1 nr=1
for i in range(len(defaults)): for i in range(len(defaults)):
d[names[i+nr]]=defaults[i] d[names[i+nr]]=defaults[i]
m.positional=names[1:na] start_index = strip_first and 1 or 0
m.required=names[1:nr] m.positional=names[start_index:na]
m.required=names[start_index:nr]
m.optional=d m.optional=d
argno = na argno = na
...@@ -45,7 +47,7 @@ class MethodClass: ...@@ -45,7 +47,7 @@ class MethodClass:
def fromMethod(self, meth, interface=''): def fromMethod(self, meth, interface=''):
func = meth.im_func func = meth.im_func
return self.fromFunction(func, interface) return self.fromFunction(func, interface, strip_first=1)
class Method(Attribute): class Method(Attribute):
"""Method interfaces """Method interfaces
......
...@@ -34,7 +34,7 @@ class BrowserIdManagerInterface( ...@@ -34,7 +34,7 @@ class BrowserIdManagerInterface(
visitors, and for servicing requests from Session Data Managers visitors, and for servicing requests from Session Data Managers
related to the browser id. related to the browser id.
""" """
def encodeUrl(self, url): def encodeUrl(url):
""" """
Encodes a provided URL with the current request's browser id Encodes a provided URL with the current request's browser id
and returns the result. For example, the call and returns the result. For example, the call
...@@ -46,7 +46,7 @@ class BrowserIdManagerInterface( ...@@ -46,7 +46,7 @@ class BrowserIdManagerInterface(
Raises: BrowserIdManagerErr. If there is no current browser id. Raises: BrowserIdManagerErr. If there is no current browser id.
""" """
def getBrowserIdName(self): def getBrowserIdName():
""" """
Returns a string with the name of the cookie/form variable which is Returns a string with the name of the cookie/form variable which is
used by the current browser id manager as the name to look up when used by the current browser id manager as the name to look up when
...@@ -55,7 +55,7 @@ class BrowserIdManagerInterface( ...@@ -55,7 +55,7 @@ class BrowserIdManagerInterface(
Permission required: Access contents information Permission required: Access contents information
""" """
def getBrowserId(self, create=1): def getBrowserId(create=1):
""" """
If create=0, returns a the current browser id or None if there If create=0, returns a the current browser id or None if there
is no browser id associated with the current request. If create=1, is no browser id associated with the current request. If create=1,
...@@ -72,14 +72,14 @@ class BrowserIdManagerInterface( ...@@ -72,14 +72,14 @@ class BrowserIdManagerInterface(
is found in REQUEST. is found in REQUEST.
""" """
def hasBrowserId(self): def hasBrowserId():
""" """
Returns true if there is a browser id for this request. Returns true if there is a browser id for this request.
Permission required: Access contents information Permission required: Access contents information
""" """
def isBrowserIdNew(self): def isBrowserIdNew():
""" """
Returns true if browser id is 'new'. A browser id is 'new' Returns true if browser id is 'new'. A browser id is 'new'
when it is first created and the client has therefore not sent it when it is first created and the client has therefore not sent it
...@@ -90,7 +90,7 @@ class BrowserIdManagerInterface( ...@@ -90,7 +90,7 @@ class BrowserIdManagerInterface(
Raises: BrowserIdManagerErr. If there is no current browser id. Raises: BrowserIdManagerErr. If there is no current browser id.
""" """
def isBrowserIdFromForm(self): def isBrowserIdFromForm():
""" """
Returns true if browser id comes from a form variable (query Returns true if browser id comes from a form variable (query
string or post). string or post).
...@@ -100,7 +100,7 @@ class BrowserIdManagerInterface( ...@@ -100,7 +100,7 @@ class BrowserIdManagerInterface(
Raises: BrowserIdManagerErr. If there is no current browser id. Raises: BrowserIdManagerErr. If there is no current browser id.
""" """
def isBrowserIdFromCookie(self): def isBrowserIdFromCookie():
""" """
Returns true if browser id comes from a cookie. Returns true if browser id comes from a cookie.
...@@ -109,7 +109,7 @@ class BrowserIdManagerInterface( ...@@ -109,7 +109,7 @@ class BrowserIdManagerInterface(
Raises: BrowserIdManagerErr. If there is no current browser id. Raises: BrowserIdManagerErr. If there is no current browser id.
""" """
def flushBrowserIdCookie(self): def flushBrowserIdCookie():
""" """
Deletes the browser id cookie from the client browser, iff the Deletes the browser id cookie from the client browser, iff the
'cookies' browser id namespace is being used. 'cookies' browser id namespace is being used.
...@@ -120,7 +120,7 @@ class BrowserIdManagerInterface( ...@@ -120,7 +120,7 @@ class BrowserIdManagerInterface(
a browser id namespace at the time of the call. a browser id namespace at the time of the call.
""" """
def setBrowserIdCookieByForce(self, bid): def setBrowserIdCookieByForce(bid):
""" """
Sets the browser id cookie to browser id 'bid' by force. Sets the browser id cookie to browser id 'bid' by force.
Useful when you need to 'chain' browser id cookies across domains Useful when you need to 'chain' browser id cookies across domains
...@@ -143,7 +143,7 @@ class SessionDataManagerInterface( ...@@ -143,7 +143,7 @@ class SessionDataManagerInterface(
related to Session Data Objects. It also communicates with a Browser related to Session Data Objects. It also communicates with a Browser
Id Manager to provide information about browser ids. Id Manager to provide information about browser ids.
""" """
def getBrowserIdManager(self): def getBrowserIdManager():
""" """
Returns the nearest acquirable browser id manager. Returns the nearest acquirable browser id manager.
...@@ -152,7 +152,7 @@ class SessionDataManagerInterface( ...@@ -152,7 +152,7 @@ class SessionDataManagerInterface(
Permission required: Access session data Permission required: Access session data
""" """
def getSessionData(self, create=1): def getSessionData(create=1):
""" """
Returns a Session Data Object associated with the current Returns a Session Data Object associated with the current
browser id. If there is no current browser id, and create is true, browser id. If there is no current browser id, and create is true,
...@@ -162,7 +162,7 @@ class SessionDataManagerInterface( ...@@ -162,7 +162,7 @@ class SessionDataManagerInterface(
Permission required: Access session data Permission required: Access session data
""" """
def hasSessionData(self): def hasSessionData():
""" """
Returns true if a Session Data Object associated with the Returns true if a Session Data Object associated with the
current browser id is found in the Session Data Container. Does current browser id is found in the Session Data Container. Does
...@@ -171,7 +171,7 @@ class SessionDataManagerInterface( ...@@ -171,7 +171,7 @@ class SessionDataManagerInterface(
Permission required: Access session data Permission required: Access session data
""" """
def getSessionDataByKey(self, key): def getSessionDataByKey(key):
""" """
Returns a Session Data Object associated with 'key'. If there is Returns a Session Data Object associated with 'key'. If there is
no Session Data Object associated with 'key' return None. no Session Data Object associated with 'key' return None.
......
...@@ -77,7 +77,7 @@ Transient Objects ...@@ -77,7 +77,7 @@ Transient Objects
import Interface import Interface
class Transient(Interface.Base): class Transient(Interface.Base):
def invalidate(self): def invalidate():
""" """
Invalidate (expire) the transient object. Invalidate (expire) the transient object.
...@@ -85,69 +85,69 @@ class Transient(Interface.Base): ...@@ -85,69 +85,69 @@ class Transient(Interface.Base):
related to this object to be called as a side effect. related to this object to be called as a side effect.
""" """
def isValid(self): def isValid():
""" """
Return true if transient object is still valid, false if not. Return true if transient object is still valid, false if not.
A transient object is valid if its invalidate method has not been A transient object is valid if its invalidate method has not been
called. called.
""" """
def getLastAccessed(self): def getLastAccessed():
""" """
Return the time the transient object was last accessed in Return the time the transient object was last accessed in
integer seconds-since-the-epoch form. integer seconds-since-the-epoch form.
""" """
def setLastAccessed(self): def setLastAccessed():
""" """
Cause the last accessed time to be set to now. Cause the last accessed time to be set to now.
""" """
def getCreated(self): def getCreated():
""" """
Return the time the transient object was created in integer Return the time the transient object was created in integer
seconds-since-the-epoch form. seconds-since-the-epoch form.
""" """
def getContainerKey(self): def getContainerKey():
""" """
Return the key under which the object was placed in its Return the key under which the object was placed in its
container. container.
""" """
class DictionaryLike(Interface.Base): class DictionaryLike(Interface.Base):
def keys(self): def keys():
""" """
Return sequence of key elements. Return sequence of key elements.
""" """
def values(self): def values():
""" """
Return sequence of value elements. Return sequence of value elements.
""" """
def items(self): def items():
""" """
Return sequence of (key, value) elements. Return sequence of (key, value) elements.
""" """
def get(self, k, default='marker'): def get(k, default='marker'):
""" """
Return value associated with key k. If k does not exist and default Return value associated with key k. If k does not exist and default
is not marker, return default, else raise KeyError. is not marker, return default, else raise KeyError.
""" """
def has_key(self, k): def has_key(k):
""" """
Return true if item referenced by key k exists. Return true if item referenced by key k exists.
""" """
def clear(self): def clear():
""" """
Remove all key/value pairs. Remove all key/value pairs.
""" """
def update(self, d): def update(d):
""" """
Merge dictionary d into ourselves. Merge dictionary d into ourselves.
""" """
...@@ -155,36 +155,36 @@ class DictionaryLike(Interface.Base): ...@@ -155,36 +155,36 @@ class DictionaryLike(Interface.Base):
# DictionaryLike does NOT support copy() # DictionaryLike does NOT support copy()
class ItemWithId(Interface.Base): class ItemWithId(Interface.Base):
def getId(self): def getId():
""" """
Returns a meaningful unique id for the object. Note that this id Returns a meaningful unique id for the object. Note that this id
need not the key under which the object is stored in its container. need not the key under which the object is stored in its container.
""" """
class TTWDictionary(DictionaryLike, ItemWithId): class TTWDictionary(DictionaryLike, ItemWithId):
def set(self, k, v): def set(k, v):
""" """
Call __setitem__ with key k, value v. Call __setitem__ with key k, value v.
""" """
def delete(self, k): def delete(k):
""" """
Call __delitem__ with key k. Call __delitem__ with key k.
""" """
def __guarded_setitem__(self, k, v): def __guarded_setitem__(k, v):
""" """
Call __setitem__ with key k, value v. Call __setitem__ with key k, value v.
""" """
class ImmutablyValuedMappingOfPickleableObjects(Interface.Base): class ImmutablyValuedMappingOfPickleableObjects(Interface.Base):
def __setitem__(self, k, v): def __setitem__(k, v):
""" """
Sets key k to value v, if k is both hashable and pickleable and Sets key k to value v, if k is both hashable and pickleable and
v is pickleable, else raise TypeError. v is pickleable, else raise TypeError.
""" """
def __getitem__(self, k): def __getitem__(k):
""" """
Returns the value associated with key k. Returns the value associated with key k.
...@@ -195,7 +195,7 @@ class ImmutablyValuedMappingOfPickleableObjects(Interface.Base): ...@@ -195,7 +195,7 @@ class ImmutablyValuedMappingOfPickleableObjects(Interface.Base):
to the mapping via __setitem__. to the mapping via __setitem__.
""" """
def __delitem__(self, k): def __delitem__(k):
""" """
Remove the key/value pair related to key k. Remove the key/value pair related to key k.
""" """
...@@ -207,7 +207,7 @@ class HomogeneousItemContainer(Interface.Base): ...@@ -207,7 +207,7 @@ class HomogeneousItemContainer(Interface.Base):
2. Is responsible for the creation of its subobjects. 2. Is responsible for the creation of its subobjects.
3. Allows for the access of a subobject by key. 3. Allows for the access of a subobject by key.
""" """
def get(self, k, default=None): def get(k, default=None):
""" """
Return value associated with key k via __getitem__. If value Return value associated with key k via __getitem__. If value
associated with k does not exist, return default. associated with k does not exist, return default.
...@@ -216,14 +216,14 @@ class HomogeneousItemContainer(Interface.Base): ...@@ -216,14 +216,14 @@ class HomogeneousItemContainer(Interface.Base):
is passed in and returned. is passed in and returned.
""" """
def has_key(self, k): def has_key(k):
""" """
Return true if container has value associated with key k, else Return true if container has value associated with key k, else
return false. return false.
""" """
class StringKeyedHomogeneousItemContainer(HomogeneousItemContainer): class StringKeyedHomogeneousItemContainer(HomogeneousItemContainer):
def new(self, k): def new(k):
""" """
Creates a new subobject of the type supported by this container Creates a new subobject of the type supported by this container
with key "k" and returns it. with key "k" and returns it.
...@@ -239,7 +239,7 @@ class StringKeyedHomogeneousItemContainer(HomogeneousItemContainer): ...@@ -239,7 +239,7 @@ class StringKeyedHomogeneousItemContainer(HomogeneousItemContainer):
Returned object is acquisition-wrapped in self. Returned object is acquisition-wrapped in self.
""" """
def new_or_existing(self, k): def new_or_existing(k):
""" """
If an object already exists in the container with key "k", it If an object already exists in the container with key "k", it
is returned. is returned.
...@@ -256,24 +256,24 @@ class StringKeyedHomogeneousItemContainer(HomogeneousItemContainer): ...@@ -256,24 +256,24 @@ class StringKeyedHomogeneousItemContainer(HomogeneousItemContainer):
""" """
class TransientItemContainer(Interface.Base): class TransientItemContainer(Interface.Base):
def setTimeoutMinutes(self, timeout_mins): def setTimeoutMinutes(timeout_mins):
""" """
Set the number of minutes of inactivity allowable for subobjects Set the number of minutes of inactivity allowable for subobjects
before they expire. before they expire.
""" """
def getTimeoutMinutes(self): def getTimeoutMinutes():
""" """
Return the number of minutes allowed for subobject inactivity Return the number of minutes allowed for subobject inactivity
before expiration. before expiration.
""" """
def getAddNotificationTarget(self): def getAddNotificationTarget():
""" """
Returns the currently registered 'add notification' value, or None. Returns the currently registered 'add notification' value, or None.
""" """
def setAddNotificationTarget(self, f): def setAddNotificationTarget(f):
""" """
Cause the 'add notification' function to be 'f'. Cause the 'add notification' function to be 'f'.
...@@ -290,13 +290,13 @@ class TransientItemContainer(Interface.Base): ...@@ -290,13 +290,13 @@ class TransientItemContainer(Interface.Base):
print "id of 'item' arg was %s" % item.getId() print "id of 'item' arg was %s" % item.getId()
""" """
def getDelNotificationTarget(self): def getDelNotificationTarget():
""" """
Returns the currently registered 'delete notification' value, or Returns the currently registered 'delete notification' value, or
None. None.
""" """
def setDelNotificationTarget(self, f): def setDelNotificationTarget(f):
""" """
Cause the 'delete notification' function to be 'f'. Cause the 'delete notification' function to be 'f'.
......
...@@ -5,7 +5,7 @@ class CatalogAware: ...@@ -5,7 +5,7 @@ class CatalogAware:
Description of the Item interface Description of the Item interface
""" """
def creator(self): def creator():
""" """
Return a sequence of user names who have the local Owner role Return a sequence of user names who have the local Owner role
...@@ -14,7 +14,7 @@ class CatalogAware: ...@@ -14,7 +14,7 @@ class CatalogAware:
""" """
def summary(self, num=200): def summary(num=200):
""" """
Returns the summary of the text contents of the object (if Returns the summary of the text contents of the object (if
...@@ -22,7 +22,7 @@ class CatalogAware: ...@@ -22,7 +22,7 @@ class CatalogAware:
""" """
def index_object(self): def index_object():
""" """
This object will try and catalog itself when this method is This object will try and catalog itself when this method is
...@@ -30,7 +30,7 @@ class CatalogAware: ...@@ -30,7 +30,7 @@ class CatalogAware:
""" """
def unindex_object(self): def unindex_object():
""" """
This object will try and uncatalog itself when this method is This object will try and uncatalog itself when this method is
...@@ -38,7 +38,7 @@ class CatalogAware: ...@@ -38,7 +38,7 @@ class CatalogAware:
""" """
def reindex_all(self, obj=None): def reindex_all(obj=None):
""" """
This method will cause this object to get reindexed. If this This method will cause this object to get reindexed. If this
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
############################################################################## ##############################################################################
__version__ = "$Revision: 1.5 $"[11:-2] __version__ = "$Revision: 1.6 $"[11:-2]
import time, Interface, re import time, Interface, re
...@@ -21,7 +21,7 @@ class EtagBaseInterface(Interface.Base): ...@@ -21,7 +21,7 @@ class EtagBaseInterface(Interface.Base):
Basic Etag support interface, meaning the object supports generating Basic Etag support interface, meaning the object supports generating
an Etag that can be used by certain HTTP and WebDAV Requests. an Etag that can be used by certain HTTP and WebDAV Requests.
""" """
def http__etag(self): def http__etag():
"""\ """\
Entity tags are used for comparing two or more entities from Entity tags are used for comparing two or more entities from
the same requested resource. Predominantly used for Caching, the same requested resource. Predominantly used for Caching,
...@@ -37,7 +37,7 @@ class EtagBaseInterface(Interface.Base): ...@@ -37,7 +37,7 @@ class EtagBaseInterface(Interface.Base):
match the current Etag). match the current Etag).
""" """
def http__refreshEtag(self): def http__refreshEtag():
"""\ """\
While it may make sense to use the ZODB Object Id or While it may make sense to use the ZODB Object Id or
bobobase_modification_time to generate an Etag, this could bobobase_modification_time to generate an Etag, this could
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
############################################################################## ##############################################################################
__version__='$Revision: 1.4 $'[11:-2] __version__='$Revision: 1.5 $'[11:-2]
import Interface import Interface
...@@ -35,6 +35,7 @@ class LockItemInterface(Interface.Base): ...@@ -35,6 +35,7 @@ class LockItemInterface(Interface.Base):
""" """
# XXX: WAAAA! What is a ctor doing in the interface?
def __init__(self, creator, owner, depth=0, timeout='Infinity', def __init__(self, creator, owner, depth=0, timeout='Infinity',
locktype='write', lockscope='exclusive', token=None): locktype='write', lockscope='exclusive', token=None):
"""\ """\
...@@ -68,36 +69,36 @@ class LockItemInterface(Interface.Base): ...@@ -68,36 +69,36 @@ class LockItemInterface(Interface.Base):
the object. the object.
""" """
def getCreator(self): def getCreator():
""" Returns the Zope user who created the lock. This is returned """ Returns the Zope user who created the lock. This is returned
in a tuple containing the Users ID and the path to the user folder in a tuple containing the Users ID and the path to the user folder
they came from.""" they came from."""
def getCreatorPath(self): def getCreatorPath():
""" Returns a string of the path to the user object in the user """ Returns a string of the path to the user object in the user
folder they were found in. """ folder they were found in. """
def getOwner(self): def getOwner():
""" Returns the string value of the 'owner' property sent """ Returns the string value of the 'owner' property sent
in by WebDAV """ in by WebDAV """
def getLockToken(self): def getLockToken():
""" returns the opaque lock token """ """ returns the opaque lock token """
def getDepth(self): def getDepth():
""" returns the depth of the lock """ """ returns the depth of the lock """
def getTimeout(self): def getTimeout():
""" returns an integer value of the timeout setting """ """ returns an integer value of the timeout setting """
def getTimeoutString(self): def getTimeoutString():
""" returns the timeout value in a form acceptable by """ returns the timeout value in a form acceptable by
WebDAV (ie - 'Seconds-40800') """ WebDAV (ie - 'Seconds-40800') """
def setTimeout(self, newtimeout): def setTimeout(newtimeout):
""" refreshes the timeout information """ """ refreshes the timeout information """
def getModifiedTime(self): def getModifiedTime():
""" returns a time.time value of the last time the Lock was """ returns a time.time value of the last time the Lock was
modified. From RFC 2518: modified. From RFC 2518:
...@@ -108,13 +109,13 @@ class LockItemInterface(Interface.Base): ...@@ -108,13 +109,13 @@ class LockItemInterface(Interface.Base):
The modified time is used to calculate the refreshed value """ The modified time is used to calculate the refreshed value """
def refresh(self): def refresh():
""" Tickles the locks modified time by setting it to the current """ Tickles the locks modified time by setting it to the current
time.time() value. (As stated in the RFC, the timeout counter time.time() value. (As stated in the RFC, the timeout counter
SHOULD be restarted for any HTTP method called by the lock owner SHOULD be restarted for any HTTP method called by the lock owner
on the locked object). """ on the locked object). """
def isValid(self): def isValid():
""" Returns true if (self.getModifiedTime() + self.getTimeout()) """ Returns true if (self.getModifiedTime() + self.getTimeout())
is greater than the current time.time() value. """ is greater than the current time.time() value. """
# now = time.time() # now = time.time()
...@@ -123,18 +124,18 @@ class LockItemInterface(Interface.Base): ...@@ -123,18 +124,18 @@ class LockItemInterface(Interface.Base):
# #
# return (modified + timeout > now) # there's time remaining # return (modified + timeout > now) # there's time remaining
def getLockType(self): def getLockType():
""" returns the lock type ('write') """ """ returns the lock type ('write') """
def getLockScope(self): def getLockScope():
""" returns the lock scope ('exclusive') """ """ returns the lock scope ('exclusive') """
def asLockDiscoveryProperty(self, ns='d'): def asLockDiscoveryProperty(ns='d'):
""" Return the lock rendered as an XML representation of a """ Return the lock rendered as an XML representation of a
WebDAV 'lockdiscovery' property. 'ns' is the namespace identifier WebDAV 'lockdiscovery' property. 'ns' is the namespace identifier
used on the XML elements.""" used on the XML elements."""
def asXML(self): def asXML():
""" Render a full XML representation of a lock for WebDAV, """ Render a full XML representation of a lock for WebDAV,
used when returning the value of a newly created lock. """ used when returning the value of a newly created lock. """
...@@ -173,41 +174,41 @@ class WriteLockInterface(Interface.Base): ...@@ -173,41 +174,41 @@ class WriteLockInterface(Interface.Base):
""" """
def wl_lockItems(self, killinvalids=0): def wl_lockItems(killinvalids=0):
""" Returns (key, value) pairs of locktoken, lock. """ Returns (key, value) pairs of locktoken, lock.
if 'killinvalids' is true, invalid locks (locks whose timeout if 'killinvalids' is true, invalid locks (locks whose timeout
has been exceeded) will be deleted""" has been exceeded) will be deleted"""
def wl_lockValues(self, killinvalids=0): def wl_lockValues(killinvalids=0):
""" Returns a sequence of locks. if 'killinvalids' is true, """ Returns a sequence of locks. if 'killinvalids' is true,
invalid locks will be deleted""" invalid locks will be deleted"""
def wl_lockTokens(self, killinvalids=0): def wl_lockTokens(killinvalids=0):
""" Returns a sequence of lock tokens. if 'killinvalids' is true, """ Returns a sequence of lock tokens. if 'killinvalids' is true,
invalid locks will be deleted""" invalid locks will be deleted"""
def wl_hasLock(self, token, killinvalids=0): def wl_hasLock(token, killinvalids=0):
""" Returns true if the lock identified by the token is attached """ Returns true if the lock identified by the token is attached
to the object. """ to the object. """
def wl_isLocked(self): def wl_isLocked():
""" Returns true if 'self' is locked at all. If invalid locks """ Returns true if 'self' is locked at all. If invalid locks
still exist, they should be deleted.""" still exist, they should be deleted."""
def wl_setLock(self, locktoken, lock): def wl_setLock(locktoken, lock):
""" Store the LockItem, 'lock'. The locktoken will be used to fetch """ Store the LockItem, 'lock'. The locktoken will be used to fetch
and delete the lock. If the lock exists, this MUST and delete the lock. If the lock exists, this MUST
overwrite it if all of the values except for the 'timeout' on the overwrite it if all of the values except for the 'timeout' on the
old and new lock are the same. """ old and new lock are the same. """
def wl_getLock(self, locktoken): def wl_getLock(locktoken):
""" Returns the locktoken identified by the locktokenuri """ """ Returns the locktoken identified by the locktokenuri """
def wl_delLock(self, locktoken): def wl_delLock(locktoken):
""" Deletes the locktoken identified by the locktokenuri """ """ Deletes the locktoken identified by the locktokenuri """
def wl_clearLocks(self): def wl_clearLocks():
""" Deletes ALL DAV locks on the object - should only be called """ Deletes ALL DAV locks on the object - should only be called
by lock management machinery. """ by lock management machinery. """
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment