From fb4c9c58095c0a78cf065c2b59ba75e374667a1f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 19 Feb 2006 23:28:14 +0000 Subject: Add a tbz2.get_data() method that returns the xpak segment data as a dict. svn path=/main/trunk/; revision=2751 --- pym/xpak.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'pym') diff --git a/pym/xpak.py b/pym/xpak.py index 9e918801c..c5c487e0a 100644 --- a/pym/xpak.py +++ b/pym/xpak.py @@ -389,6 +389,24 @@ class tbz2: os.chdir(origdir) return 1 + def get_data(self): + """Returns all the files from the dataSegment as a map object.""" + if not self.scan(): + return 0 + a = open(self.file, "r") + mydata = {} + startpos=0 + while ((startpos+8)