Viewing File: /usr/lib64/python2.7/Tools/scripts/pickle2db.pyo

ó
ó—sjc@sBdZddlZyddlZWnek
r;dZnXyddlZWnek
redZnXyddlZWnek
rdZnXyddlZWnek
r¹dZnXddlZyddl	Z
Wnek
rõddl
Z
nXejdZd„Z
d„Zedkr>ejeejdƒƒ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
tj}Wq”t
k
rKtjj	dƒdSXq|d#kry
tj}Wq”t
k
rŒtjj	dƒdSXq|d$krŃy
tj}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
rtjj	dƒdSXqqW|dkrątdkrŌtjj	dƒtjj	dƒdStj}ny||dƒ}Wn9tjk
r.tjj	d |ƒtjj	d!ƒdSXx|jƒD]
}||=q<Wx;ytj|ƒ\}	}
Wntk
r}PnX|
||	<qP|jƒ|jƒd	S((NthbrdagthashtbtreetrecnotdbmtanydbmtgdbmiiitrbsUnable to open %s
s-hs--hashsbsddb module unavailable.
s-bs--btrees-rs--recnos-as--anydbmsanydbm module unavailable.
s-gs--gdbmsgdbm module unavailable.
s-ds--dbmsdbm module unavailable.
sbsddb module unavailable - smust specify dbtype.
tcsUnable to open %s.  s&Check for format or version mismatch.
(s-hs--hash(s-bs--btree(s-rs--recno(s-as--anydbm(s-gs--gdbm(s-ds--dbm(tgetoptterrorRtlenRtstdintopentIOErrorRRtNonetbsddbthashopentAttributeErrortbtopentrnopenRRR
tkeystpickletloadtEOFErrortclose(targstoptstpfiletdbfiletdbopentopttargtdbtktkeytval((s//usr/lib64/python2.7/Tools/scripts/pickle2db.pytmain7s $	


















t__main__i(RRRtImportErrorRR
RRRtcPickleRtargvtprogRR+t__name__texit(((s//usr/lib64/python2.7/Tools/scripts/pickle2db.pyt<module>s6









		[
Back to Directory File Manager