diff options
| author | Julian Andres Klode <jak@debian.org> | 2010-02-13 15:34:24 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2010-02-13 15:34:24 +0100 |
| commit | c8fa835540d60393f2a1168625bf5d5ae01c4538 (patch) | |
| tree | b99415fbe2d2bfe2249c3beb5083c2b0587734c9 /apt | |
| parent | 0401747854d7fc26eb097663822e26a988cf4aa4 (diff) | |
| download | python-apt-c8fa835540d60393f2a1168625bf5d5ae01c4538.tar.gz | |
python/tagfile.cc: Implement the iterator protocol in TagFile.
Diffstat (limited to 'apt')
| -rw-r--r-- | apt/debfile.py | 3 | ||||
| -rw-r--r-- | apt/utils.py | 6 |
2 files changed, 4 insertions, 5 deletions
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): |
