%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/pip/_vendor/lockfile/ |
Current File : //usr/lib/python2.7/site-packages/pip/_vendor/lockfile/sqlitelockfile.pyc |
� ��abc @` s� d d l m Z m Z d d l Z d d l Z y e Wn e k rO e Z n Xd d l m Z m Z m Z m Z m Z d e f d � � YZ d S( i ( t absolute_importt divisionNi ( t LockBaset NotLockedt NotMyLockt LockTimeoutt AlreadyLockedt SQLiteLockFilec B` s\ e Z d Z d Z e d d � Z d d � Z d � Z d � Z d � Z d � Z d � Z RS( s Demonstrate SQL-based locking.c C` s t j | | | | � t | j � | _ t | j � | _ t j d k r� d d l } | j � \ } } t j | � t j | � ~ ~ | t _ n d d l } | j t j � | _ | j j � } y | j d � Wn | j k r� n0 X| j j � d d l } | j t j t j � d S( su >>> lock = SQLiteLockFile('somefile') >>> lock = SQLiteLockFile('somefile', threaded=False) i NsG create table locks( lock_file varchar(32), unique_name varchar(32))( R t __init__t unicodet lock_filet unique_nameR t testdbt Nonet tempfilet mkstempt ost closet unlinkt sqlite3t connectt connectiont cursort executet OperationalErrort committ atexitt register( t selft patht threadedt timeoutR t _fdR R t cR ( ( sG /usr/lib/python2.7/site-packages/pip/_vendor/lockfile/sqlitelockfile.pyR s( c C` s� | d k r | n | j } t j � } | d k rL | d k rL | | 7} n | d k ra d } n | d k rv d } n | d } | j j � } x;t r�| j � s.| j d | j | j f � | j j � | j d | j f � | j � } t | � d k r'| j d | j f � | j j � qfd Sn8 | j d | j f � | j � } t | � d k rfd S| d k r�t j � | k r�| d k r�t d | j � � q�t d | j � � n t j | � q� Wd S( Ni g�������?i s; insert into locks (lock_file, unique_name) values (?, ?)s* select * from locks where unique_name = ?i s( delete from locks where unique_name = ?s&