From c8fa835540d60393f2a1168625bf5d5ae01c4538 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 13 Feb 2010 15:34:24 +0100 Subject: python/tagfile.cc: Implement the iterator protocol in TagFile. --- apt/debfile.py | 3 +-- apt/utils.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'apt') diff --git a/apt/debfile.py b/apt/debfile.py index 65f43f20..e27917d5 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -448,9 +448,8 @@ class DscSrcPackage(DebPackage): fobj = open(file) tagfile = apt_pkg.TagFile(fobj) - sec = tagfile.section try: - while tagfile.step() == 1: + for sec in tagfile: for tag in depends_tags: if not tag in sec: continue diff --git a/apt/utils.py b/apt/utils.py index 8949c2ab..61d5d54f 100644 --- a/apt/utils.py +++ b/apt/utils.py @@ -39,10 +39,10 @@ def get_release_date_from_release_file(path): if not path or not os.path.exists(path): return None tag = apt_pkg.TagFile(open(path)) - tag.step() - if not "Date" in tag.section: + section = tag.next() + if not "Date" in section: return None - date = tag.section["Date"] + date = section["Date"] return apt_pkg.str_to_time(date) def get_release_filename_for_pkg(cache, pkgname, label, release): -- cgit v1.2.3