ó fc@sBdZddlZyddlZWnek r;dZnXyddlZWnek redZnXyddlZWnek rdZnXyddlZWnek r¹dZnXddlZyddl Z Wnek rõddl Z nXej dZ d„Z d„Zedkr>ejeej dƒƒndS(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ÿÿÿÿNicCstjjttƒƒdS(N(tsyststderrtwritet__doc__tglobals(((s//usr/lib64/python2.7/Tools/scripts/pickle2db.pytusage4sc Cs¤y1tj|dddddddgƒ\}}Wntjk rOtƒdSXt|ƒd kstt|ƒd krtƒdSt|ƒdkr§tj}|d }nNyt|d d ƒ}Wn*tk rêtjj d |d ƒdSX|d}d}xš|D]’\}}|d"krOy t j }Wq”t k rKtjj dƒdSXq|d#kry t j}Wq”t k rŒtjj dƒdSXq|d$krÑy t j}Wq”t k rÍtjj dƒdSXq|d%kry tj}Wq”t k rtjj dƒdSXq|d&krSy tj}Wq”t k rOtjj dƒdSXq|d'kry tj}Wq”t k rtjj dƒdSXqqW|dkràt dkrÔtjj dƒtjj dƒdSt j }ny||dƒ}Wn9t jk r.tjj d |ƒtjj d!ƒdSXx|jƒD] }||=q<Wx<ytj|ƒ\} } Wntk r}PnX| || s6              [