mς TγΈEc@sqdkZdklZlZlZlZdklZdk l Z d„Z dd„Z de fd„ƒYZdS( N(sget_pickle_metadatasp64soid_reprstid_repr(sget_refs(s TimeStampcCsdt|ƒS(Ns%s.%s(tget_pickle_metadatatpickle(R((t6/data/zmath/zope/lib/python/ZODB/FileStorage/fsoids.pyt get_classsi2cCsNt|ƒ|jo|Sn|d}|d}||}|| d|| S(Niis ... (tlentstsizetnavailtnleadingt ntrailing(RRRR R((Rtshortens    tTracercBsVtZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( sƒTrace all occurrences of a set of oids in a FileStorage. Create passing a path to an existing FileStorage. Call register_oids(oid, ...) one or more times to specify which oids to investigate. Call run() to do the analysis. This isn't swift -- it has to read every byte in the database, in order to find all references. Call report() to display the results. cCs]dk}|ii|ƒptdƒ‚n||_h|_g|_h|_h|_dS(Ns$must specify an existing FileStorage( tostpathtisfilet ValueErrortselfttid2infotmsgstoidstoid2name(RR R ((Rt__init__-s     cGs\xU|D]M}t|tƒot|ƒdjpt‚n t|ƒ}d|i|tt|ƒ}|ii||di|ƒfƒt |_ dS(Nt ( tmapRtargsRRtappendRttidtjointTruet _produced_msg(RRR R((Rt_msgRs"cCs£|i}|i}|i}d}x5|D]-} | |jo|i| d |fƒq(q(W|iƒd } }x/|D]'\} }}| | jo–|| }d|djodpd} |i| dƒ}dGt| ƒG|G|G| GH| } d }||jo$|d jpt‚dG|GHqtq&n||jo_|}|i|\} }} }d t|ƒ|t|ƒfGHd t|ƒGHd t| ƒGHnd G|GHqtWd S(s5Show all msgs, grouped by oid and sub-grouped by tid.s6this oid was not defined (no data record for it found)trevisioniRts Rs s tid %s offset=%d %ss tid user=%rs tid description=%rs N(RRRRtNOT_SEENRRtNonetsortt current_oidt current_tidR tmsgtnrevR%tgettnametoid_reprRRtstatustusert descriptiontposttid_reprt TimeStampR (RR2RR'R4R+RRR R%R1R3RR*R-R,R/((RtreportWs>            cCs:h|_x*tii|iƒD]}|i|ƒqWdS(s<Find all occurrences of the registered oids in the database.N(Rt _ref2nametZODBt FileStoraget FileIteratorR ttxnt _check_trec(RR<((Rtrun}s  cCs”t|_h|_g|_x|D]}|i|ƒq"Wx|iD]}|i|ƒqCW|io,|i |i |i |i f|i |is%s.%st references(RBR RRGR4RHRR8tref2nameR.t ref2name_getR@trecords_map_getRt oid_in_oidstget_refstrefRIR(toidclassRR$R0trRttuple(RRBRNRQRRRR4RKRLRIRHR RMRP((RRD§s4*         ( t__name__t __module__t__doc__RRR$R7R>R=RCRD(((RR "s     &  (tZODB.FileStorageR9t ZODB.utilsRRR0R5tZODB.serializeROtZODB.TimeStampR6RR tobjectR ( RRRR6R R9R0R5R RO((Rt?s