summaryrefslogtreecommitdiffstats
path: root/debian/lib/python/debian_linux/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'debian/lib/python/debian_linux/utils.py')
-rw-r--r--debian/lib/python/debian_linux/utils.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/debian/lib/python/debian_linux/utils.py b/debian/lib/python/debian_linux/utils.py
index 0c6569b5a0..661a730476 100644
--- a/debian/lib/python/debian_linux/utils.py
+++ b/debian/lib/python/debian_linux/utils.py
@@ -6,6 +6,7 @@ import typing
import jinja2
+from .dataclasses_deb822 import read_deb822
from .debian import SourcePackage, BinaryPackage, TestsControl
@@ -60,14 +61,20 @@ class Templates(object):
return value[0]
- def get_control(self, key: str, context: dict[str, str] = {}) -> BinaryPackage:
- return BinaryPackage.read_rfc822(io.StringIO(self.get(key, context)))
+ def get_control(
+ self, key: str, context: dict[str, str] = {},
+ ) -> typing.Iterable[BinaryPackage]:
+ return read_deb822(BinaryPackage, io.StringIO(self.get(key, context)))
- def get_source_control(self, key: str, context: dict[str, str] = {}) -> SourcePackage:
- return SourcePackage.read_rfc822(io.StringIO(self.get(key, context)))
+ def get_source_control(
+ self, key: str, context: dict[str, str] = {},
+ ) -> typing.Iterable[SourcePackage]:
+ return read_deb822(SourcePackage, io.StringIO(self.get(key, context)))
- def get_tests_control(self, key: str, context: dict[str, str] = {}) -> TestsControl:
- return TestsControl.read_rfc822(io.StringIO(self.get(key, context)))
+ def get_tests_control(
+ self, key: str, context: dict[str, str] = {},
+ ) -> typing.Iterable[TestsControl]:
+ return read_deb822(TestsControl, io.StringIO(self.get(key, context)))
class TextWrapper(textwrap.TextWrapper):