mò /á¸Ec@s¥dZdkZdklZdklZdklZdkl Z dk l Z dk l Z dklZd d d Zd d Zd„Zdefd„ƒYZdS(sWWebDAV support - lock item. $Id: LockItem.py 40218 2005-11-18 14:39:19Z andreasjung $ N(sClassSecurityInfo(s ownerInfo(s Persistent(s implements(sgenerateLockToken(s ILockItem(sLockItemInterfaceli ii l<cCs›g}yFt|ƒidƒd}|iƒdjo t}n t|ƒ}Wn tj o|i dƒnX|t jo|i dt ƒn||fS(Nt-iÿÿÿÿtinfinitesBad timeout values"Timeout request is greater than %s( terrorststrttimeouttsplittttlowertDEFAULTTIMEOUTtlongt ValueErrortappendt MAXTIMEOUT(RRR((t./data/zmath/zope/lib/python/webdav/LockItem.pytvalidateTimeout s  tLockItemc BstZeeƒefZeƒZeiddddddddd ƒ ei d d d ƒei d ddƒddddddd„Z d„Z d„Z d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd „Zd!„Zd"„Zd#dd$„Zd%„ZRS(&NtgetOwnert getLockTokentgetDeptht getTimeouttgetTimeoutStringtgetModifiedTimetisValidt getLockScopet getLockTypesChange Lock Informationt setTimeouttrefreshsAccess contents informationt getCreatortgetCreatorPathtitInfinitetwritet exclusivec CsIg}t|ddƒp|idƒnt|ƒiƒd jo|idƒn|iƒdjo|id|ƒn|iƒdjo|id |ƒnt |ƒ\}} || }|o t |‚nt|ƒ|_||_||_||_||_||_tiƒ|_|djotƒ|_n ||_dS( Nt getUserNamesCreator not a user objectt0tinfinitysDepth must be 0 or infinityRsLock type '%s' not supportedR sLock scope '%s' not supported(R"R#(RtgetattrtcreatortNoneR RtdepthRtlocktypet lockscopeRRteR t ownerInfotselft_creatortownert_ownert_deptht_timeoutt _locktypet _lockscopettimet _modifiedtimettokentgenerateLockTokent_token( R,R%R.R'RR(R)R6RR*((R t__init__@s.        cCs|iS(N(R,R-(R,((R RdscCs,|i\}}di|ƒ}d||fS(Nt/s/%s/%s(R,R-tdbtnametjointpath(R,R>R;R<((R RgscCs|iS(N(R,R/(R,((R RlscCs|iS(N(R,R8(R,((R RoscCs|iS(N(R,R0(R,((R RrscCs|iS(N(R,R1(R,((R RuscCs6t|iƒ}|ddjo|d }nd|S(NiÿÿÿÿtLs Second-%s(RR,R1R(R,R((R RxscCsBt|ƒ\}}|o t|‚n||_tiƒ|_dS(N( Rt newtimeoutRRR R,R1R4R5(R,R@RR((R R}s   cCs|iS(N(R,R5(R,((R R…scCstiƒ|_dS(N(R4R,R5(R,((R RˆscCs,tiƒ}|i}|i}|||jS(N(R4tnowR,R5tmodifiedR1R(R,RARBR((R R‹s   cCs|iS(N(R,R2(R,((R R’scCs|iS(N(R,R3(R,((R R•stdcCsy|o d}n |i}dhd|<d|i<d|i<d|i<d|i<d|i ƒ<d |<}|S( Ns#this-is-a-faked-no-permission-tokensŽ <%(ns)s:activelock> <%(ns)s:locktype><%(ns)s:%(locktype)s/> <%(ns)s:lockscope><%(ns)s:%(lockscope)s/> <%(ns)s:depth>%(depth)s <%(ns)s:owner>%(owner)s <%(ns)s:timeout>%(timeout)s <%(ns)s:locktoken> <%(ns)s:href>opaquelocktoken:%(locktoken)s tnsR(R)R'R.Rt locktoken( tfakeR6R,R8RDR2R3R0R/Rts(R,RDRFRGR6((R tasLockDiscoveryProperty˜s   [cCsd|iddƒ}|S(Nsu %s RDRC(R,RHRG(R,RG((R tasXML±s(t__name__t __module__t implementst ILockItemtLockItemInterfacet__implements__tClassSecurityInfotsecurityt declarePublictdeclareProtectedR&R9RRRRRRRRRRRRRRHRI(((R R0s6        $             (t__doc__R4t AccessControlRPtAccessControl.OwnedR+tGlobalst Persistenttzope.interfaceRLtcommonR7t interfacesRMtWriteLockInterfaceRNR RRR( RLRMRR+R RPRXR7RNRR4R((R t?s