%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/modules/inspectlib/ |
Current File : //usr/lib/python2.7/site-packages/salt/modules/inspectlib/fsdb.pyc |
� ���^c @� s� d Z d d l m Z m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d e f d � � YZ d e f d � � YZ d S( s+ :codeauthor: Bo Maryniuk <bo@suse.de> i ( t absolute_importt with_statementN( t OrderedDict( t zipt CsvDBEntityc B� s e Z d Z d � Z RS( s, Serializable object for the table. c C� s g | D] } t | | � ^ q S( sm Serialize the object to a row for CSV according to the table description. :return: ( t getattr( t selft descriptiont attr( ( s@ /usr/lib/python2.7/site-packages/salt/modules/inspectlib/fsdb.pyt _serialize% s ( t __name__t __module__t __doc__R ( ( ( s@ /usr/lib/python2.7/site-packages/salt/modules/inspectlib/fsdb.pyR ! s t CsvDBc 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 d � Z d � Z d � Z d � Z e d � Z d d d d d � Z d d d d d � Z d � Z d d d d d � Z d d d d d � Z d � Z RS( sr File-based CSV database. This database is in-memory operating relatively small plain text csv files. c C� s5 | j | � t | _ d | _ t | _ i | _ d S( sP Constructor to store the database files. :param path: N( t _preparet Falset _openedt Nonet db_patht _tables( R t path( ( s@ /usr/lib/python2.7/site-packages/salt/modules/inspectlib/fsdb.pyt __init__3 s c C� s5 | | _ t j j | j � s1 t j | j � n d S( N( R t ost existst makedirs( R R ( ( s@ /usr/lib/python2.7/site-packages/salt/modules/inspectlib/fsdb.pyR ? s c C� s t j j � j d � S( sY Create label of the database, based on the date-time. :return: s %Y%m%d-%H%M%S( t datetimet utcnowt strftime( R ( ( s@ /usr/lib/python2.7/site-packages/salt/modules/inspectlib/fsdb.pyt _labelD s c C� sf | j � } t j j | j | � | _ t j j | j � sO t j | j � n t | _ | j � | S( sG Create a new database and opens it. :return: ( R R R t joinR R R t TrueR t list_tables( R t dbname( ( s@ /usr/lib/python2.7/site-packages/salt/modules/inspectlib/fsdb.pyt newL s c C� sE t j j | j | � } t j j | � rA t j | d t �t St S( sL Purge the database. :param dbid: :return: t ignore_errors( R R R R t shutilt rmtreeR R ( R t dbidR ( ( s@ /usr/lib/python2.7/site-packages/salt/modules/inspectlib/fsdb.pyt purge[ s c C� s>