summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKees Cook <kees@outflux.net>2007-08-31 18:12:26 +0000
committerKees Cook <kees@outflux.net>2007-08-31 18:12:26 +0000
commit1998e9b1cdebdf4bc58a2750132000b0720f2d1e (patch)
treee8bf30c1793c23756ff54e1379011c7595a7486b /scripts
parent8c7612d90ac6760060bd527f378aa36aa844f1b1 (diff)
add __getitem__ to extract stored fields and handle multiline data
git-svn-id: svn+ssh://svn.debian.org/svn/kernel-sec@935 e094ebfe-e918-0410-adfb-c712417f3574
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/deb822.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/deb822.py b/scripts/deb822.py
index a6432cc5..d006ec1d 100755
--- a/scripts/deb822.py
+++ b/scripts/deb822.py
@@ -144,6 +144,16 @@ class deb822:
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"""

© 2014-2024 Faster IT GmbH | imprint | privacy policy