%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/utils/ |
Current File : //usr/lib/python2.7/site-packages/salt/utils/lazy.pyc |
� ���^c @@ s� d Z d d l m Z m Z d d l Z d d l Z y d d l m Z Wn! e k rk d d l m Z n Xe j e � Z d � Z d e f d � � YZ d S( uC Lazily-evaluated data structures, primarily used by Salt's loader i ( t absolute_importt unicode_literalsN( t MutableMappingc C@ sI | s t j j d � � n | | k rE t j j | j | � � � n d S( u6 Check that the function passed really exists u- Must specify a function to run! ex: manage.upN( t saltt exceptionst SaltInvocationErrort CommandExecutionErrort missing_fun_string( t lazy_objt fun( ( s3 /usr/lib/python2.7/site-packages/salt/utils/lazy.pyt verify_fun s t LazyDictc B@ s� e Z d Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( u A base class of dict which will lazily load keys once they are needed TODO: negative caching? If you ask for 'foo' and it doesn't exist it will look EVERY time unless someone calls load_all() As of now this is left to the class which inherits from this base c C@ s | j � d S( N( t clear( t self( ( s3 /usr/lib/python2.7/site-packages/salt/utils/lazy.pyt __init__) s c C@ s t | j p | j � S( N( t boolt _dictt loaded( R ( ( s3 /usr/lib/python2.7/site-packages/salt/utils/lazy.pyt __nonzero__, s c C@ s | j � S( N( R ( R ( ( s3 /usr/lib/python2.7/site-packages/salt/utils/lazy.pyt __bool__0 s c C@ s% t | d t � � | _ t | _ d S( u Clear the dict u mod_dict_classN( t getattrt dictR t FalseR ( R ( ( s3 /usr/lib/python2.7/site-packages/salt/utils/lazy.pyR 4 s c C@ s t � � d S( u3 Load a single item if you have it N( t NotImplementedError( R t key( ( s3 /usr/lib/python2.7/site-packages/salt/utils/lazy.pyt _load>