Esempio n. 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
Esempio n. 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
Esempio n. 3
0
 def lock_is_stealable(self):
     """Find out if the lock is stealable
     """
     lockable = ILockable(self.context)
     return lockable.stealable()
Esempio n. 4
0
 def lock_is_stealable(self):
     """Find out if the lock is stealable
     """
     lockable = ILockable(self.context)
     return lockable.stealable()