• File: contextmanager.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python2.7/site-packages/redhat_support_lib/infrastructure/contextmanager.pyc
  • Date Modified: 03/28/2024 3:28 PM
  • File size: 3.85 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

fc@sddlmZddlZiZejZdefdYZdefdYZej	dZ
edZed	Z
dS(
i(tImmutableErrorNt__ItemcBsMeZdZdZdZeedddZeedddZRS(cCs||_||_dS(N(t
_Item__valt_Item__mode(tselftvaltmode((sT/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/contextmanager.pyt__init__s	cCs|jS(N(R(R((sT/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/contextmanager.pytget_valscCs|jS(N(R(R((sT/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/contextmanager.pytget_mode sN(	t__name__t
__module__RRR	tpropertytNoneRR(((sT/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/contextmanager.pyRs
			tModecBs5eZed\ZZdZdZdZRS(icCs
||_dS(N(tvalue(RtType((sT/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/contextmanager.pyR*scCs0|jtjkrdS|jtjkr,dSdS(Nt	ReadWritetRead(RRtRWtR(R((sT/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/contextmanager.pyt__str__-scCs|j|jkS(N(R(Rty((sT/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/contextmanager.pyt__eq__3s(R
RtrangeRRRRR(((sT/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/contextmanager.pyR's		cCsczQtjt|tjkr=tj|r=t|nt||t|<Wdtj	XdS(s
    stores the value in cache

    Keyword arguments:
    key    -- is the cache key
    val    -- is the cache value
    mode   -- is the access mode [r|rw]
    N(
tlocktacquiretTrueRRtcachethas_keyRRtrelease(tkeyRR((sT/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/contextmanager.pytadd7s	
cCszytjttj|rt|rft|}|jtjkrWtj|}|j	St
|qtt|j	SndSWdtjXdS(s
    retrieves the value from the cache

    Keyword arguments:
    key     --  is the cache key
    remove  --  removes the value from cache [true|false]
    N(
RRRRRRRRtpopRRR
R(Rtremovetitem((sT/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/contextmanager.pytgetJs

cCsszatjttj|r`t|}|jtjksA|rQtj|q`t	|nWdtj
XdS(s
    removes the value from cache

    Keyword arguments:
    key   --   is the cache key
    force --   force remove regardless cache mode
    N(RRRRRRRRR!RR(RtforceR#((sT/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/contextmanager.pyt_removecs

(t(redhat_support_lib.infrastructure.errorsRt	threadingRtRLockRtobjectRRRR tFalseR$R&(((sT/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/contextmanager.pyt<module>s