AlkantarClanX12
Current Path : /usr/lib64/python2.7/Tools/scripts/ |
Current File : //usr/lib64/python2.7/Tools/scripts/pickle2db.pyc |
� �fc @ sB d Z d d l Z y d d l Z Wn e k r; d Z n Xy d d l Z Wn e k re d Z n Xy d d l Z Wn e k r� d Z n Xy d d l Z Wn e k r� d Z n Xd d l Z y d d l Z Wn e k r� d d l Z n Xe j d Z d � Z d � Z e d k r>e j e e j d � � n d S( s, Synopsis: %(prog)s [-h|-b|-g|-r|-a|-d] [ picklefile ] dbfile Read the given picklefile as a series of key/value pairs and write to a new database. If the database already exists, any contents are deleted. The optional flags indicate the type of the output database: -a - open using anydbm -b - open as bsddb btree file -d - open as dbm file -g - open as gdbm file -h - open as bsddb hash file -r - open as bsddb recno file The default is hash. If a pickle file is named it is opened for read access. If no pickle file is named, the pickle input is read from standard input. Note that recno databases can only contain integer keys, so you can't dump a hash or btree database using db2pickle.py and reconstitute it to a recno database with %(prog)s unless your keys are integers. i����Ni c C s t j j t t � � d S( N( t syst stderrt writet __doc__t globals( ( ( s/ /usr/lib64/python2.7/Tools/scripts/pickle2db.pyt usage4 s c C s� y1 t j | d d d d d d d g � \ } } Wn t j k rO t � d SXt | � d k st t | � d k r t � d St | � d k r� t j } | d } nN y t | d d � } Wn* t k r� t j j d | d � d SX| d } d } x�| D]�\ } } | d"