Current Path : /usr/lib/python2.7/dist-packages/landscape/lib/ |
Current File : //usr/lib/python2.7/dist-packages/landscape/lib/store.pyc |
Tc @ sG d Z y d d l Z Wn! e k r9 d d l m Z n Xd Z d S( s+ Functions used by all sqlite-backed stores.iN( t dbapi2c s f d } | S( s Decorator that encloses the method in a database transaction. Even though SQLite is supposed to be useful in autocommit mode, we've found cases where the database continued to be locked for writing until the cursor was closed. With this in mind, instead of using the autocommit mode, we explicitly terminate transactions and enforce cursor closing with this decorator. c s | j s+ t j | j | _ | j n yG | j j } z | | | | } Wd | j X| j j Wn | j j n X| S( N( t _dbt sqlite3t connectt _filenamet _ensure_schemat cursort closet committ rollback( t selft argst kwargsR t result( t method( s7 /usr/lib/python2.7/dist-packages/landscape/lib/store.pyt inner s ( ( R R ( ( R s7 /usr/lib/python2.7/dist-packages/landscape/lib/store.pyt with_cursor s ( t __doc__R t ImportErrort pysqlite2R R ( ( ( s7 /usr/lib/python2.7/dist-packages/landscape/lib/store.pyt <module> s