HEX
Server: nginx/1.24.0
System: Linux webserver 6.8.0-85-generic #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 15:26:59 UTC 2025 x86_64
User: wpuser (1002)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/landscape/lib/__pycache__/store.cpython-312.pyc
�

�~�e���L�dZddlmZ	ddlZd�Zy#e$rddlmZYd�ZywxYw)z+Functions used by all sqlite-backed stores.���wrapsN)�dbapi2c�.��t���fd��}|S)a�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���|js4tj|j�|_|j	�	|jj�}	�||g|��i|��}|j
�|jj�|S#|j
�wxYw#t$r|jj��wxYw)N)
�_db�sqlite3�connect�	_filename�_ensure_schema�cursor�close�commit�
BaseException�rollback)�self�args�kwargsr
�result�methods     ��5/usr/lib/python3/dist-packages/landscape/lib/store.py�innerzwith_cursor.<locals>.inners�����x�x����t�~�~�6�D�H����!�		��X�X�_�_�&�F�
���f�>�t�>�v�>�������H�H�O�O���
��������	��H�H�����	�s$�B,�
B�+*B,�B)�)B,�,%Cr)rrs` r�with_cursorr
s"����6�]����*�L�)�__doc__�	functoolsrr	�ImportError�	pysqlite2rr�rr�<module>r s1��1��,��
 ��	�,�+� �	,�s��#�#