Current File : //usr/lib/python2.7/site-packages/vdo/vdomgmnt/CommandLock.pyc
�
.�t_c@sRdZddlmZmZmZdefd��YZdefd��YZdS(sy
  CommandLock - simple process locking

  $Id: //eng/vdo-releases/magnesium/src/python/vdo/vdomgmnt/CommandLock.py#1 $

i����(tCommandtFileLocktLoggertCommandLockErrorcBs eZdZd�Zd�ZRS(s>Exception raised to indicate an error acquiring a CommandLock.cGs)tt|�j�|j|�|_dS(N(tsuperRt__init__tformatt_message(tselftmessagetargs((s</usr/lib/python2.7/site-packages/vdo/vdomgmnt/CommandLock.pyR!scCs|jS(N(R(R((s</usr/lib/python2.7/site-packages/vdo/vdomgmnt/CommandLock.pyt__str__&s(t__name__t
__module__t__doc__RR(((s</usr/lib/python2.7/site-packages/vdo/vdomgmnt/CommandLock.pyRs	tCommandLockcBsTeZdZejejd�Zd�Zed�Z	d�Z
d�Zd�ZRS(sSimple process locking.
  s.CommandLockcCs7ytt|�j�Wntd|j��nX|S(NsCould not lock file {0}(RRt	__enter__Rtpath(R((s</usr/lib/python2.7/site-packages/vdo/vdomgmnt/CommandLock.pyR2s
cCs/tt|�j||rdnddd�dS(Ntrsr+ttimeouti(RRR(RtfilePathtreadonly((s</usr/lib/python2.7/site-packages/vdo/vdomgmnt/CommandLock.pyR:scsUt��dg}|jdj�fd��jD���|jd�dj|�S(Nt[t,c3s3|])}dj|tt�|��g�VqdS(t=N(tjointstrtgetattr(t.0tkey(R(s</usr/lib/python2.7/site-packages/vdo/vdomgmnt/CommandLock.pys	<genexpr>Bst]t(RtappendRt__dict__(Rtlst((Rs</usr/lib/python2.7/site-packages/vdo/vdomgmnt/CommandLock.pyt__repr__@s

cCsdjt|�j|j�S(Ns{0}({1})(RttypeRR(R((s</usr/lib/python2.7/site-packages/vdo/vdomgmnt/CommandLock.pyRHscCs9tt|�j�tdd|jg�}|j�dS(Ntchmodt644(RRt_createFileRRtrun(Rtcmd((s</usr/lib/python2.7/site-packages/vdo/vdomgmnt/CommandLock.pyR'Ls(
RR
RRt	getLoggertmynametlogRtTrueRR#RR'(((s</usr/lib/python2.7/site-packages/vdo/vdomgmnt/CommandLock.pyR*s			N(RtutilsRRRt	ExceptionRR(((s</usr/lib/python2.7/site-packages/vdo/vdomgmnt/CommandLock.pyt<module>s