diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/examples/all_deps.py | 4 | ||||
| -rwxr-xr-x | doc/examples/configisc.py | 2 | ||||
| -rwxr-xr-x | doc/examples/records.py | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/doc/examples/all_deps.py b/doc/examples/all_deps.py index e8c9eaaf..0a2f3157 100644 --- a/doc/examples/all_deps.py +++ b/doc/examples/all_deps.py @@ -10,10 +10,10 @@ def dependencies(cache, pkg, deps, key="Depends"): if candver == None: return deps dependslist = candver.DependsList - if dependslist.has_key(key): + if key in dependslist: for depVerList in dependslist[key]: for dep in depVerList: - if cache.has_key(dep.TargetPkg.Name): + if dep.TargetPkg.Name in cache: if pkg.name != dep.TargetPkg.Name and \ not dep.TargetPkg.Name in deps: deps.add(dep.TargetPkg.Name) diff --git a/doc/examples/configisc.py b/doc/examples/configisc.py index 1d5965f5..de8ec6be 100755 --- a/doc/examples/configisc.py +++ b/doc/examples/configisc.py @@ -27,7 +27,7 @@ apt_pkg.ReadConfigFileISC(Cnf, ConfigFile[0]) # print "%s \"%s\";" % (I, Cnf[I]) # bind8 config file.. -if Cnf.has_key("Zone"): +if Cnf.Exists("Zone"): print "Zones: ", Cnf.SubTree("zone").List() for I in Cnf.List("zone"): SubCnf = Cnf.SubTree(I) diff --git a/doc/examples/records.py b/doc/examples/records.py index a7a87727..a0fc8dc4 100755 --- a/doc/examples/records.py +++ b/doc/examples/records.py @@ -7,7 +7,7 @@ cache = apt.Cache() for pkg in cache: if not pkg.candidateRecord: continue - if pkg.candidateRecord.has_key("Task"): + if "Task" in pkg.candidateRecord: print "Pkg %s is part of '%s'" % ( pkg.name, pkg.candidateRecord["Task"].split()) #print pkg.candidateRecord |
