diff options
| author | Ben Finney <ben@benfinney.id.au> | 2008-05-16 19:27:02 +1000 |
|---|---|---|
| committer | Ben Finney <ben@benfinney.id.au> | 2008-05-16 19:27:02 +1000 |
| commit | 04dfb70356fc46a1b4e75f3370a4d64b5cc2d9b4 (patch) | |
| tree | 1cdd5619690ecd19c8c0033740a32332da14a9a9 /doc | |
| parent | 0d12af28d4de2745f8831abf0224ceabec693b76 (diff) | |
| download | python-apt-04dfb70356fc46a1b4e75f3370a4d64b5cc2d9b4.tar.gz | |
Remove redundant semicolons from statements.
Diffstat (limited to 'doc')
| -rwxr-xr-x | doc/examples/config.py | 12 | ||||
| -rwxr-xr-x | doc/examples/configisc.py | 14 | ||||
| -rwxr-xr-x | doc/examples/versiontest.py | 20 |
3 files changed, 23 insertions, 23 deletions
diff --git a/doc/examples/config.py b/doc/examples/config.py index cd7bcae0..3a77301b 100755 --- a/doc/examples/config.py +++ b/doc/examples/config.py @@ -18,7 +18,7 @@ import apt_pkg, sys, posixpath # configuration object apt_pkg.Config which is used interally by apt-pkg # routines to control unusual situations. I recommend using the sytem global # whenever possible.. -Cnf = apt_pkg.newConfiguration(); +Cnf = apt_pkg.newConfiguration() print "Command line is", sys.argv @@ -39,17 +39,17 @@ print "Quiet level selected is", Cnf.FindI("quiet", 0) # Do some stuff with it if Cnf.FindB("version", 0) == 1: - print "Version selected - 1.1"; + print "Version selected - 1.1" if Cnf.FindB("help", 0) == 1: print apt_pkg.Package, apt_pkg.Version, "for", apt_pkg.Architecture, \ "compiled on", apt_pkg.Date, apt_pkg.Time - print "Hi, I am the help text for this program"; - sys.exit(0); + print "Hi, I am the help text for this program" + sys.exit(0) -print "No help for you, try -h"; +print "No help for you, try -h" # Print the configuration space -print "The Configuration space looks like:"; +print "The Configuration space looks like:" for I in Cnf.keys(): print "%s \"%s\";" % (I, Cnf[I]) diff --git a/doc/examples/configisc.py b/doc/examples/configisc.py index 4d0d33d4..9a858657 100755 --- a/doc/examples/configisc.py +++ b/doc/examples/configisc.py @@ -13,14 +13,14 @@ import apt_pkg, sys, posixpath ConfigFile = apt_pkg.ParseCommandLine(apt_pkg.Config, [], sys.argv) if len(ConfigFile) != 1: - print "Must have exactly 1 file name"; - sys.exit(0); + print "Must have exactly 1 file name" + sys.exit(0) -Cnf = apt_pkg.newConfiguration(); +Cnf = apt_pkg.newConfiguration() apt_pkg.ReadConfigFileISC(Cnf, ConfigFile[0]) # Print the configuration space -#print "The Configuration space looks like:"; +#print "The Configuration space looks like:" #for I in Cnf.keys(): # print "%s \"%s\";" % (I, Cnf[I]) @@ -28,12 +28,12 @@ apt_pkg.ReadConfigFileISC(Cnf, ConfigFile[0]) if Cnf.has_key("Zone"): print "Zones: ", Cnf.SubTree("zone").List() for I in Cnf.List("zone"): - SubCnf = Cnf.SubTree(I); + SubCnf = Cnf.SubTree(I) if SubCnf.Find("type") == "slave": print "Masters for %s: %s" % (SubCnf.MyTag(), SubCnf.ValueList("masters")) else: - print "Tree definitions:"; + print "Tree definitions:" for I in Cnf.List("tree"): - SubCnf = Cnf.SubTree(I); + SubCnf = Cnf.SubTree(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"]) diff --git a/doc/examples/versiontest.py b/doc/examples/versiontest.py index 29da3b8f..732eafac 100755 --- a/doc/examples/versiontest.py +++ b/doc/examples/versiontest.py @@ -2,25 +2,25 @@ # This is a simple clone of tests/versiontest.cc import apt_pkg, sys, re, string -apt_pkg.InitConfig(); -apt_pkg.InitSystem(); +apt_pkg.InitConfig() +apt_pkg.InitSystem() TestFile = apt_pkg.ParseCommandLine(apt_pkg.Config, [], sys.argv) if len(TestFile) != 1: - print "Must have exactly 1 file name"; - sys.exit(0); + print "Must have exactly 1 file name" + sys.exit(0) # Go over the file.. List = open(TestFile[0], "r") -CurLine = 0; +CurLine = 0 while(1): - Line = List.readline(); - CurLine = CurLine + 1; + Line = List.readline() + CurLine = CurLine + 1 if Line == "": - break; - Line = string.strip(Line); + break + Line = string.strip(Line) if len(Line) == 0 or Line[0] == '#': - continue; + continue Split = re.split("[ \n]", Line) |
