ó
č¾bc           @   s!  d  Z  d d l Z d d l Z d d l Z d d l Z d d l Z e j d d k rd d d l Z nz e j d( k  r d d l Z n\ d d l	 Z	 e	 j
   Z e j   z) e	 j d d d	 d
 e d d l Z Wd e j   X[ y d d l m Z Wn! e k
 rd d l m Z n Xd e f d     YZ d e f d     YZ d d) d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d Z d Z d   Z d Z d Z  d Z! d    Z" d!   Z# d"   Z$ d#   Z% d$   Z& d%   Z' d& d* d'     YZ( d S(+   s   $Id$i’’’’Ni    i   i   i   t   ignoret   messages1   the cPickle module has been removed in Python 3.0t   category(   t   dbt   TableDBErrorc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   >   s   t   TableAlreadyExistsc           B   s   e  Z RS(    (   R   R   (    (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   @   s   t   Condc           B   s   e  Z d  Z d   Z RS(   s!   This condition matches everythingc         C   s   d S(   Ni   (    (   t   selft   s(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   __call__F   s    (   R   R   t   __doc__R   (    (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   D   s   t	   ExactCondc           B   s    e  Z d  Z d   Z d   Z RS(   s)   Acts as an exact match condition functionc         C   s   | |  _  d  S(   N(   t
   strtomatch(   R	   R   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   __init__K   s    c         C   s   | |  j  k S(   N(   R   (   R	   R
   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   M   s    (   R   R   R   R   R   (    (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   I   s   	t
   PrefixCondc           B   s    e  Z d  Z d   Z d   Z RS(   s9   Acts as a condition function for matching a string prefixc         C   s   | |  _  d  S(   N(   t   prefix(   R	   R   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   R   s    c         C   s   | t  |  j   |  j k S(   N(   t   lenR   (   R	   R
   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   T   s    (   R   R   R   R   R   (    (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   P   s   	t   PostfixCondc           B   s    e  Z d  Z d   Z d   Z RS(   s:   Acts as a condition function for matching a string postfixc         C   s   | |  _  d  S(   N(   t   postfix(   R	   R   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   Y   s    c         C   s   | t  |  j  |  j k S(   N(   R   R   (   R	   R
   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   [   s    (   R   R   R   R   R   (    (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   W   s   	t   LikeCondc           B   s&   e  Z d  Z e j d  Z d   Z RS(   sĒ   
    Acts as a function that will match using an SQL 'LIKE' style
    string.  Case insensitive and % signs are wild cards.
    This isn't perfect but it should work for the simple common cases.
    c         C   sf   d } x$ | D] } | j  | d |  } q W| j  d d  |  _ t j d |  j d |  |  _ d  S(   Ns   .*+()[]?s   \t   %s   .*t   ^t   $(   t   replacet   likestrt   ret   compile(   R	   R   t   re_flagst   chars_to_escapet   char(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   d   s
    c         C   s   |  j  j |  S(   N(   R   t   match(   R	   R
   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   l   s    (   R   R   R   R   t
   IGNORECASER   R   (    (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   ^   s   t   __TABLE_NAMES__s   ._COLUMNS__c         C   s   |  t  S(   N(   t   _columns(   t   table(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   _columns_keyu   s    s   ._DATA_.s	   ._ROWID_.i   c         C   s   |  t  | t  | S(   N(   t   _data(   R$   t   colt   rowid(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt	   _data_key   s    c         C   s   |  t  | t  S(   N(   R&   (   R$   R'   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   _search_col_data_key   s    c         C   s   |  t  S(   N(   R&   (   R$   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   _search_all_data_key   s    c         C   s   |  t  | t  S(   N(   t   _rowid(   R$   R(   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt
   _rowid_key   s    c         C   s   |  t  S(   N(   R,   (   R$   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   _search_rowid_key   s    c         C   s`   |  j  t  d k sT |  j  t  d k sT |  j  t  d k sT |  j  t  d k rX d Sd Sd S(   s   Verify that the given string does not contain any
    metadata strings that might interfere with dbtables database operation.
    i    i   N(   t   findt   _table_names_keyR#   R&   R,   (   R
   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   contains_metastrings   s    t
   bsdTableDBc           B   sČ   e  Z d  d  d d  d  d  Z d   Z d   Z d  d  Z d   Z d   Z d   Z d	   Z	 d
   Z
 d   Z d   Z d   Z d   Z i  i  d  Z i  d  Z i  d  Z d   Z d   Z RS(   i    i  c            s"  d |  _ t j } | r( | t j O} n  t j t j Bt j Bt j B| B}	 y | t j O} Wn t	 k
 rn n X| r |	 t j
 B}	 n  t j   |  _ |  j j t j  |  j j | | |	 B | rŌ | t j O} n  t j |  j  |  _ |  j j d  |  j j t j  |  j j | t j | | B|  | |  _ t j d d k rd t f d     Y  d t f   f d     Y}
 |
 |  j  |  _ n  |  j j   } yV t |  j d  t |  sót |  j d	 |  j j  t t j g  d  d
 | n  Wn | j      n X| j!   i  |  _" d S(   sÄ   bsdTableDB(filename, dbhome, create=0, truncate=0, mode=0600)

        Open database name in the dbhome Berkeley DB directory.
        Use keyword arguments when calling this constructor.
        i   i    i   t   cursor_py3kc           B   s,   e  Z d    Z d   Z d   Z d   Z RS(   c         S   s   | |  _  d  S(   N(   t	   _dbcursor(   R	   t   dbcursor(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   Ä   s    c         S   s   |  j  j   S(   N(   R4   t   close(   R	   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR6   Ē   s    c         S   sT   |  j  j t | d   } | d  k	 rP | d j d  | d j d  f } n  | S(   Ns	   iso8859-1i    i   (   R4   t	   set_ranget   bytest   Nonet   decode(   R	   t   searcht   v(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR7   Ź   s
    c         S   sN   t  |  j d    } | d  k	 rJ | d j d  | d j d  f } n  | S(   Nt   nexti    s	   iso8859-1i   (   t   getattrR4   R9   R:   (   R	   R<   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   __next__Ń   s
    (   R   R   R   R6   R7   R?   (    (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR3   Ć   s   			t   db_py3kc              s}   e  Z d    Z d
   f d  Z d
 d  Z d d
 d  Z d
 d  Z d
 d d  Z d
 d d  Z	 d
 d  Z
 d	   Z RS(   c         S   s   | |  _  d  S(   N(   t   _db(   R	   R   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR   Ł   s    c            s     |  j  j d |   S(   Nt   txn(   RA   t   cursor(   R	   RB   (   R3   (    s$   /usr/lib/python2.7/bsddb/dbtables.pyRC   Ü   s    c         S   s%   t  |  j d  t | d  d | S(   Nt   has_keys	   iso8859-1RB   (   R>   RA   R8   (   R	   t   keyRB   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyRD   ß   s    i    c         S   sL   t  | d  } | d  k	 r- t  | d  } n  |  j j | | d | d | S(   Ns	   iso8859-1t   flagsRB   (   R8   R9   RA   t   put(   R	   RE   t   valueRF   RB   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyRG   ć   s    c         S   s(   t  | d  } |  j j | | d | S(   Ns	   iso8859-1RB   (   R8   RA   RG   (   R	   RE   RH   RB   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt	   put_bytesé   s    c         S   sO   t  | d  } |  j j | d | d | } | d  k	 rK | j d  } n  | S(   Ns	   iso8859-1RB   RF   (   R8   RA   t   getR9   R:   (   R	   RE   RB   RF   R<   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyRJ   ķ   s
    c         S   s+   t  | d  } |  j j | d | d | S(   Ns	   iso8859-1RB   RF   (   R8   RA   RJ   (   R	   RE   RB   RF   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt	   get_bytesō   s    c         S   s%   t  | d  } |  j j | d | S(   Ns	   iso8859-1RB   (   R8   RA   t   delete(   R	   RE   RB   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyRL   ų   s    c         S   s   |  j  j   S(   N(   RA   R6   (   R	   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR6   ü   s    N(   R   R   R   R9   RC   RD   RG   RI   RJ   RK   RL   R6   (    (   R3   (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR@   Ų   s   	RD   RI   RB   N(#   R9   R   t	   DB_THREADt	   DB_CREATEt   DB_INIT_MPOOLt   DB_INIT_LOCKt   DB_INIT_LOGt   DB_INIT_TXNt   DB_AUTO_COMMITt   AttributeErrort
   DB_RECOVERt   DBEnvt   envt   set_lk_detectt   DB_LOCK_DEFAULTt   opent   DB_TRUNCATEt   DBt   set_get_returns_nonet	   set_flagst   DB_DUPt   DB_BTREEt
   dbfilenamet   syst   version_infot   objectt	   txn_beginR>   R0   RG   t   picklet   dumpst   abortt   committ   _bsdTableDB__tablecolumns(   R	   t   filenamet   dbhomet   createt   truncatet   modet   recovert   dbflagst   myflagst   flagsforenvR@   RB   (    (   R3   s$   /usr/lib/python2.7/bsddb/dbtables.pyR      sF    		" 	'#

c         C   s   |  j    d  S(   N(   R6   (   R	   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   __del__  s    c         C   sT   |  j  d  k	 r( |  j  j   d  |  _  n  |  j d  k	 rP |  j j   d  |  _ n  d  S(   N(   R   R9   R6   RW   (   R	   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR6     s    c         C   s   |  j  j |  d  S(   N(   RW   t   txn_checkpoint(   R	   t   mins(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt
   checkpoint  s    c         C   s   |  j  j   d  S(   N(   R   t   sync(   R	   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyRx      s    c         C   s   d GH|  j  j   } y^ | j   \ } } xE t i | | 6 GH| j   } | r_ | \ } } q, | j   d Sq, WWn t  j k
 r | j   n Xd S(   s*   Print the database to stdout for debuggings5   ******** Printing raw database for debugging ********N(   R   RC   t   firstt   reprR=   R6   t   DBNotFoundError(   R	   t   curRE   t   dataR=   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt	   _db_print#  s    
c         C   sŲ  t  | t  s t  d } y^t |  r9 t d   n  x) | D]! } t |  r@ t d   q@ q@ Wt |  } t |  j d  |  r t	 d  n  |  j
 j   } t |  j d |  j j  | t j | d  d | t j t |  j d |  j j  t d | d	 t j  } | j |  |  j j t d | t |  j d |  j j  t t j | d  d | | j   d } WnX t j k
 rÓ} | r”| j   n  t j d k  rĄt | d  qŌt | j d  n Xd S(   s   CreateTable(table, columns) - Create a new table in the database.

        raises TableDBError if it already exists or for other DB errors.
        s-   bad table name: contains reserved metastringss.   bad column name: contains reserved metastringsRD   s   table already existsRI   i   RB   RK   RF   i   i   N(   i   i   (   t
   isinstancet   listt   AssertionErrorR9   R1   t
   ValueErrorR%   R>   R   R   RW   Re   RG   Rf   Rg   t   loadsRJ   R0   t   DB_RMWt   appendRL   Ri   t   DBErrorRh   Rb   Rc   R   t   args(   R	   R$   t   columnsRB   t   columnt   columnlist_keyt	   tablelistt   dberror(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   CreateTable5  s<    '

c         C   s   t  | t  s t  t |  r- t d  n  t |  } t |  j d  |  sU g  St |  j d |  j j  |  } | r t	 j
 |  Sg  Sd S(   s\   Return a list of columns in the given table.
        [] if the table doesn't exist.
        s-   bad table name: contains reserved metastringsRD   RK   N(   R   t   strR   R1   R   R%   R>   R   RJ   Rf   R   (   R	   R$   R   t   pickledcolumnlist(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   ListTableColumnse  s    c         C   s-   |  j  j t  } | r% t j |  Sg  Sd S(   s)   Return a list of tables in this database.N(   R   t   get_getR0   Rf   R   (   R	   t   pickledtablelist(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt
   ListTablesw  s    c   
      C   sĶ  t  | t  s t  y |  j | |  Wnt k
 rČd } y+t |  } |  j j   } t	 j
 t |  j d |  j j  | d | d t j  } i  } x | D] } | | | <q£ Wt j |  } x* | D]" } | | k rĶ | j |  qĶ qĶ W| | k rL|  j j | d | t |  j d |  j j  | t	 j | d  d | n  | j   d } |  j |  WqÉt j k
 rÄ}	 | r| j   n  t j d	 k  r±t |	 d  qÅt |	 j d  qÉXn Xd S(
   s  CreateOrExtendTable(table, columns)

        Create a new table in the database.

        If a table of this name already exists, extend it to have any
        additional columns present in the given list as well as
        all of its current columns.
        RK   RB   RF   RI   i   i   i   N(   i   i   (   R   R   R   R   R   R9   R%   RW   Re   Rf   R   R>   R   RJ   R   t   copyR   RL   RG   Rg   Ri   t   _bsdTableDB__load_column_infoR   Rh   Rb   Rc   R   R   (
   R	   R$   R   RB   R   t   oldcolumnlistt   oldcolumnhasht   ct   newcolumnlistR   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   CreateOrExtendTable  s@    	'

c         C   s   y+ t  |  j d |  j j  t |   } Wn$ t j k
 rQ t d | f  n X| sk t d | f  n  t j |  |  j | <d S(   s'   initialize the self.__tablecolumns dictRK   s   unknown table: %rN(	   R>   R   RJ   R%   R{   R   Rf   R   Rj   (   R	   R$   t   tcolpickles(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   __load_column_info¹  s    c         C   sŌ   d } xĒ | sĻ g  } x- t  t  D] } | j t j d d   q" Wt j d t |  } t j d d k r | j	 d  } n  y/ |  j
 j t | |  d	 d | d t
 j Wn t
 j k
 rÅ q	 Xd } q	 W| S(
   s"   Create a new unique row identifieri    i’   t   Bi   s	   iso8859-1RB   RF   i   N(   t   xranget   _rowid_str_lenR   t   randomt   randintt   structt   packRb   Rc   R:   R   RG   R-   R9   t   DB_NOOVERWRITEt   DBKeyExistError(   R	   R$   RB   t   uniquet   blistt   xt   newid(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   __new_rowidÅ  s    	!
c   	      C   s  d } yt |  j d  t |   s3 t d  n  | |  j k rR |  j |  n  x= | j   D]/ } |  j | j |  s_ t d | f  q_ q_ W|  j	 j
   } |  j | d | } x? | j   D]1 \ } } |  j j t | | |  | d | qĆ W| j   d } Wn t j k
 r} t j   } | rV| j   |  j j t | |   n  t j d	 k  r|t | d | d  qt | j d | d  n Xd S(
   s   Insert(table, datadict) - Insert a new row into the table
        using the keys+values from rowdict as the column values.
        RD   s   unknown tables   unknown column: %rRB   i   i   i   N(   i   i   (   R9   R>   R   R%   R   Rj   R   t   keyst   countRW   Re   t   _bsdTableDB__new_rowidt   itemsRG   R)   Ri   R   Rb   t   exc_infoRh   RL   R-   Rc   R   (	   R	   R$   t   rowdictRB   R   R(   t   dataitemR   t   info(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   Insertą  s.    )


c         C   s  yA|  j  | g  |  } | j   } x| j   D]} d } yß xŲ | D]Š } |  j j   } yJ |  j j t | | |  d | }	 |  j j t | | |  d | Wn t j	 k
 rĀ d }	 n X| | |	  }	 |	 d k	 r|  j j
 t | | |  |	 d | n  | j   d } qG WWq1 | r5| j   n    q1 Xq1 WWnE t j k
 r}
 t j d k  rut |
 d  qt |
 j d  n Xd S(   s  Modify(table, conditions={}, mappings={}) - Modify items in rows matching 'conditions' using mapping functions in 'mappings'

        * table - the table name
        * conditions - a dictionary keyed on column names containing
          a condition callable expecting the data string as an
          argument and returning a boolean.
        * mappings - a dictionary keyed on column names containing a
          condition callable expecting the data string as an argument and
          returning the new string for that column.
        RB   i   i   i   N(   i   i   (   t   _bsdTableDB__SelectR«   R9   RW   Re   R   RJ   R)   RL   R{   RG   Ri   Rh   R   Rb   Rc   R   R   (   R	   R$   t
   conditionst   mappingst   matching_rowidsR   R(   RB   R   R±   R   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   Modify  s@    			
	
c   	      C   si  y|  j  | g  |  } |  j | } xō | j   D]ę } d } y« |  j j   } xK | D]C } y& |  j j t | | |  d | WqW t j	 k
 r qW XqW Wy# |  j j t
 | |  d | Wn t j	 k
 r× n X| j   d } Wq2 t j k
 r} | r| j   n    q2 Xq2 WWnE t j k
 rd} t j d k  rQt | d  qet | j d  n Xd S(   s  Delete(table, conditions) - Delete items matching the given
        conditions from the table.

        * conditions - a dictionary keyed on column names containing
          condition functions expecting the data string as an
          argument and returning a boolean.
        RB   i   i   i   N(   i   i   (   R“   Rj   R«   R9   RW   Re   R   RL   R)   R{   R-   Ri   R   Rh   Rb   Rc   R   R   (	   R	   R$   Rµ   R·   R   R(   RB   R   R   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   DeleteB  s6    	#

c         C   s¦   yT | |  j  k r" |  j |  n  | d k r> |  j  | } n  |  j | | |  } WnE t j k
 r } t j d k  r t | d  q t | j	 d  n X| j
   S(   s²  Select(table, columns, conditions) - retrieve specific row data
        Returns a list of row column->value mapping dictionaries.

        * columns - a list of which column data to return.  If
          columns is None, all columns will be returned.
        * conditions - a dictionary keyed on column names
          containing callable conditions expecting the data string as an
          argument and returning a boolean.
        i   i   i   N(   i   i   (   Rj   R   R9   R“   R   R   Rb   Rc   R   R   t   values(   R	   R$   R   Rµ   R·   R   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   Selecto  s    
c         C   s  | |  j  k r |  j |  n  | d k r; |  j | } n  xA | | j   D]/ } |  j  | j |  sL t d | f  qL qL Wi  } i  } d   } t j d	 k  ræ | j	   } | j
 |  nv g  } xm | j	   D]_ }	 xV t |  D]; \ }
 } | | |	  } | d k rå | j |
 |	  Pqå qå W| j |	  qŅ W|  j j   } d } xH| D]@\ } } | d } t | |  } | | k rd } n d } yČ | j |  \ } } x¬ | t |   | k rW| t } | | k rB| sģ| |  r| | k ri  | | <n  | r?| | | | <q?qB| | k r5| | =n  | | | <n  | j   \ } } q¬WWqQt j k
 r} | j d t j k rQ  qQqQqQXqQW| j   ~ t |  d k rxŠ | j	   D]æ \ } } x° | D]Ø } | | k rģqŌn  y& |  j j t | | |   | | <WqŌt j k
 r{} t j d
 k  rR| d t j k rn  qnn | j d t j k rn  n  d | | <qŌXqŌWqĮWn  | S(   s  __Select() - Used to implement Select and Delete (above)
        Returns a dictionary keyed on rowids containing dicts
        holding the row data for columns listed in the columns param
        that match the given conditions.
        * conditions is a dictionary keyed on column names
        containing callable conditions expecting the data string as an
        argument and returning a boolean.
        s   unknown column: %rc         S   s  |  d } | d } t  |  t  |  k r³ d   } t | t  rr t | t  rr | t | j  t | j   St | t  rÆ t | t  rÆ | t | j  t | j   Sd St | t  rĘ d St | t  rŁ d St | t  rģ d St | t  r’ d Sd S(   Ni   c         S   s$   |  | k r d S|  | k  r  d Sd S(   Ni    i’’’’i   (    (   t   at   b(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   cmpØ  s
      i    i’’’’(   t   typeR   R   R   R   R   R   R   (   t   atuplet   btupleR¼   R½   R¾   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   cmp_conditions¢  s$    

	i   i   i   i’’’’i    N(   i   i   (   i   i   (   Rj   R   R9   t   tablecolumnsR«   R¬   R   Rb   Rc   R®   t   sortt	   enumeratet   insertR   R   RC   R*   R7   R   R   R=   R   R   t   DB_NOTFOUNDR6   RJ   R)   (   R	   R$   R   Rµ   R   R·   t   rejected_rowidsRĀ   t   conditionlistt   it   jt   kt   rR|   t
   column_numt	   conditiont	   searchkeyt   savethiscolumndataRE   R}   R(   R   t   rowdata(    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   __Select  s    
	
	

		c   	      C   s8  d } yļ|  j j   } |  j j t |  d | |  j j |  } t |  } xY y | j |  \ } } Wn t j	 k
 r Pn X| t
 |   | k r  Pn  | j   qU Wt |  } xY y | j |  \ } } Wn t j	 k
 rķ Pn X| t
 |   | k rPn  | j   q½ W| j   t j t |  j d |  j j  t d | d t j  } y | j |  Wn t k
 r}n X|  j j t d | t |  j d |  j j  t t j | d  d | | j   d } | |  j k rō|  j | =n  Wn< t j k
 r3} | r| j   n  t | j d   n Xd S(   s(   Remove an entire table from the databaseRB   RK   RF   RI   i   N(   R9   RW   Re   R   RL   R%   RC   R+   R7   R{   R   R.   R6   Rf   R   R>   RJ   R0   R   t   removeR   RG   Rg   Ri   Rj   R   Rh   R   R   (	   R	   R$   RB   R|   t	   table_keyRE   R}   R   R   (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   Drop  sT    

(   R   R   R   Rt   R6   Rw   Rx   R~   R   R   R   R   R   R­   R³   Rø   R¹   R»   R“   RÖ   (    (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyR2      s&   	r					0			:			,6-	(   i   i   (    (    ()   t   _cvsidR   Rb   R   R    R¢   Rc   Rf   t   cPicklet   warningst   catch_warningst   wt	   __enter__t   filterwarningst   DeprecationWarningt   __exit__t   bsddb3R   t   ImportErrort   bsddbt   StandardErrorR   R   R   R   R   R   R   R0   R#   R%   R&   R,   R   R)   R*   R+   R-   R.   R1   R2   (    (    (    s$   /usr/lib/python2.7/bsddb/dbtables.pyt   <module>   sV   
							