[kernel-sec-discuss] r935 - scripts

keescook-guest at alioth.debian.org keescook-guest at alioth.debian.org
Fri Aug 31 18:12:26 UTC 2007


Author: keescook-guest
Date: 2007-08-31 18:12:26 +0000 (Fri, 31 Aug 2007)
New Revision: 935

Modified:
   scripts/deb822.py
Log:
add __getitem__ to extract stored fields and handle multiline data

Modified: scripts/deb822.py
===================================================================
--- scripts/deb822.py	2007-08-31 00:17:38 UTC (rev 934)
+++ scripts/deb822.py	2007-08-31 18:12:26 UTC (rev 935)
@@ -144,6 +144,16 @@
             self.keys.append(key)
             self.map[key] = value
 
+    def __getitem__(self, item):
+        str = ""
+        for line in self.map[item].strip().splitlines():
+            if line == ' .':
+                line = ''
+            if line.startswith(' '):
+                line=line[1:]
+            str += line + '\n'
+        return str
+
 ## methods that changes and dsc files have in common
 class _dscchanges(deb822):
     """A base class; not intended for direct use"""




More information about the kernel-sec-discuss mailing list