diff options
| author | Julian Andres Klode <jak@debian.org> | 2013-10-21 14:35:33 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2013-10-21 14:35:33 +0200 |
| commit | abc9feb18b268cbc4ddb79aabb30ce352e31b44a (patch) | |
| tree | 5f910a1634905d2b5b2246f48c18451e04785ae5 /doc/examples/configisc.py | |
| parent | ce50049ebd837697c947ed332a8a81bc56c75fb4 (diff) | |
| download | python-apt-abc9feb18b268cbc4ddb79aabb30ce352e31b44a.tar.gz | |
doc/examples: Start updating to new API
Diffstat (limited to 'doc/examples/configisc.py')
| -rwxr-xr-x | doc/examples/configisc.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/doc/examples/configisc.py b/doc/examples/configisc.py index fe3d161b..fea5893e 100755 --- a/doc/examples/configisc.py +++ b/doc/examples/configisc.py @@ -11,14 +11,14 @@ import apt_pkg import sys -ConfigFile = apt_pkg.ParseCommandLine(apt_pkg.Config, [], sys.argv) +ConfigFile = apt_pkg.parse_commandLine(apt_pkg.config, [], sys.argv) if len(ConfigFile) != 1: print "Must have exactly 1 file name" sys.exit(0) Cnf = apt_pkg.Configuration() -apt_pkg.ReadConfigFileISC(Cnf, ConfigFile[0]) +apt_pkg.read_config_file_isc(Cnf, ConfigFile[0]) # Print the configuration space #print "The Configuration space looks like:" @@ -26,18 +26,18 @@ apt_pkg.ReadConfigFileISC(Cnf, ConfigFile[0]) # print "%s \"%s\";" % (I, Cnf[I]) # bind8 config file.. -if Cnf.Exists("Zone"): - print "Zones: ", Cnf.SubTree("zone").List() - for I in Cnf.List("zone"): - SubCnf = Cnf.SubTree(I) - if SubCnf.Find("type") == "slave": +if "Zone" in Cnf: + print "Zones: ", Cnf.sub_tree("zone").list() + for I in Cnf.list("zone"): + SubCnf = Cnf.sub_tree(I) + if SubCnf.find("type") == "slave": print "Masters for %s: %s" % ( - SubCnf.MyTag(), SubCnf.ValueList("masters")) + SubCnf.my_tag(), SubCnf.value_list("masters")) else: print "Tree definitions:" - for I in Cnf.List("tree"): - SubCnf = Cnf.SubTree(I) + for I in Cnf.list("tree"): + SubCnf = Cnf.sub_tree(I) # This could use Find which would eliminate the possibility of # exceptions. print "Subtree %s with sections '%s' and architectures '%s'" % ( - SubCnf.MyTag(), SubCnf["Sections"], SubCnf["Architectures"]) + SubCnf.my_tag(), SubCnf["Sections"], SubCnf["Architectures"]) |
