예제 #1
0
def lock_info(obj):
    """Returns lock information about the given object."""
    lockable = ILockable(obj, None)
    if lockable is not None:
        info = {"locked": lockable.locked(), "stealable": lockable.stealable()}
        lock_info = lockable.lock_info()
        if len(lock_info) > 0:
            info["creator"] = lock_info[0]["creator"]
            info["time"] = lock_info[0]["time"]
            info["token"] = lock_info[0]["token"]
            lock_type = lock_info[0]["type"]
            if lock_type:
                info["name"] = lock_info[0]["type"].__name__
            lock_item = webdav_lock(obj)
            if lock_item:
                info["timeout"] = lock_item.getTimeout()
        return info
예제 #2
0
def lock_info(obj):
    """Returns lock information about the given object."""
    lockable = ILockable(obj, None)
    if lockable is not None:
        info = {
            'locked': lockable.locked(),
            'stealable': lockable.stealable(),
        }
        lock_info = lockable.lock_info()
        if len(lock_info) > 0:
            info['creator'] = lock_info[0]['creator']
            info['time'] = lock_info[0]['time']
            info['token'] = lock_info[0]['token']
            lock_type = lock_info[0]['type']
            if lock_type:
                info['name'] = lock_info[0]['type'].__name__
            lock_item = webdav_lock(obj)
            if lock_item:
                info['timeout'] = lock_item.getTimeout()
        return info
예제 #3
0
파일: locking.py 프로젝트: Vinsurya/Plone
 def lock_is_stealable(self):
     """Find out if the lock is stealable
     """
     lockable = ILockable(self.context)
     return lockable.stealable()
예제 #4
0
 def lock_is_stealable(self):
     """Find out if the lock is stealable
     """
     lockable = ILockable(self.context)
     return lockable.stealable()