~eLdZddlmZ ddlZdZy#e$r ddlmZYdZywxYw)z+Functions used by all sqlite-backed stores.wrapsN)dbapi2c.tfd}|S)aDecorator 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|js4tj|j|_|j  |jj } ||g|i|}|j |jj|S#|j wxYw#t$r|jjwxYw)N) _dbsqlite3connect _filename_ensure_schemacursorclosecommit BaseExceptionrollback)selfargskwargsr resultmethods 5/usr/lib/python3/dist-packages/landscape/lib/store.pyinnerzwith_cursor..innersxx t~~6DH    ! XX__&F f>t>v>  HHOO     HH     s$B, B+*B,B))B,,%Cr)rrs` r with_cursorr s" 6]* L)__doc__ functoolsrr ImportError pysqlite2rrrrr s11,  ,+  ,s  ##