From: Zac Medico Date: Sun, 19 Feb 2006 23:28:14 +0000 (-0000) Subject: Add a tbz2.get_data() method that returns the xpak segment data as a dict. X-Git-Tag: v2.1_pre5_2760~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fb4c9c58095c0a78cf065c2b59ba75e374667a1f;p=portage.git Add a tbz2.get_data() method that returns the xpak segment data as a dict. svn path=/main/trunk/; revision=2751 --- 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)