summaryrefslogtreecommitdiff
path: root/doc/examples/config.py
diff options
context:
space:
mode:
authorBen Finney <ben@benfinney.id.au>2008-05-16 18:04:01 +1000
committerBen Finney <ben@benfinney.id.au>2008-05-16 18:04:01 +1000
commit0d12af28d4de2745f8831abf0224ceabec693b76 (patch)
tree01f46a2739eebc6676fc70a6ba93a69121e1bea6 /doc/examples/config.py
parentad7bc46acd80451de21ce58450edb0f4367a5c79 (diff)
downloadpython-apt-0d12af28d4de2745f8831abf0224ceabec693b76.tar.gz
Fix spaces adjacent to commas and operators, to conform with PEP 8.
Diffstat (limited to 'doc/examples/config.py')
-rwxr-xr-xdoc/examples/config.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/doc/examples/config.py b/doc/examples/config.py
index 337899f0..cd7bcae0 100755
--- a/doc/examples/config.py
+++ b/doc/examples/config.py
@@ -12,7 +12,7 @@
# This shows how to use the system for configuration and option control.
# The other varient is for ISC object config files. See configisc.py.
-import apt_pkg,sys,posixpath;
+import apt_pkg, sys, posixpath
# Create a new empty Configuration object - there is also the system global
# configuration object apt_pkg.Config which is used interally by apt-pkg
@@ -20,30 +20,30 @@ import apt_pkg,sys,posixpath;
# whenever possible..
Cnf = apt_pkg.newConfiguration();
-print "Command line is",sys.argv
+print "Command line is", sys.argv
# Load the default configuration file, InitConfig() does this better..
-Cnf.Set("config-file","/etc/apt/apt.conf"); # or Cnf["config-file"] = "..";
+Cnf.Set("config-file", "/etc/apt/apt.conf") # or Cnf["config-file"] = ".."
if posixpath.exists(Cnf.FindFile("config-file")):
- apt_pkg.ReadConfigFile(Cnf,"/etc/apt/apt.conf");
+ apt_pkg.ReadConfigFile(Cnf, "/etc/apt/apt.conf")
# Merge the command line arguments into the configuration space
-Arguments = [('h',"help","help"),
- ('v',"version","version"),
- ('q',"quiet","quiet","IntLevel"),
- ('c',"config-file","","ConfigFile"),
- ('o',"option","","ArbItem")]
-print "FileNames",apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
+Arguments = [('h', "help", "help"),
+ ('v', "version", "version"),
+ ('q', "quiet", "quiet", "IntLevel"),
+ ('c', "config-file", "", "ConfigFile"),
+ ('o', "option", "", "ArbItem")]
+print "FileNames", apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv)
-print "Quiet level selected is",Cnf.FindI("quiet",0);
+print "Quiet level selected is", Cnf.FindI("quiet", 0)
# Do some stuff with it
-if Cnf.FindB("version",0) == 1:
+if Cnf.FindB("version", 0) == 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;
+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);
@@ -52,4 +52,4 @@ print "No help for you, try -h";
# Print the configuration space
print "The Configuration space looks like:";
for I in Cnf.keys():
- print "%s \"%s\";"%(I,Cnf[I]);
+ print "%s \"%s\";" % (I, Cnf[I])