summaryrefslogtreecommitdiff
path: root/doc/examples/inst.py
diff options
context:
space:
mode:
authorBen Finney <ben@benfinney.id.au>2008-05-16 16:11:06 +1000
committerBen Finney <ben@benfinney.id.au>2008-05-16 16:11:06 +1000
commita953d82143f0ec979e18f17e8d9bbacbac954868 (patch)
tree42e76c37d72847d4fe3ca2487e227ae1649ad3c0 /doc/examples/inst.py
parent21ef2ab57d68de87a2b44a23d9a3bfb87d24d46d (diff)
downloadpython-apt-a953d82143f0ec979e18f17e8d9bbacbac954868.tar.gz
Fixes to blank lines, to conform with PEP 8.
Diffstat (limited to 'doc/examples/inst.py')
-rw-r--r--doc/examples/inst.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/doc/examples/inst.py b/doc/examples/inst.py
index ff9d452c..d1e2ff99 100644
--- a/doc/examples/inst.py
+++ b/doc/examples/inst.py
@@ -8,10 +8,13 @@ import time
from apt.progress import InstallProgress
+
class TextInstallProgress(InstallProgress):
+
def __init__(self):
apt.progress.InstallProgress.__init__(self)
self.last = 0.0
+
def updateInterface(self):
InstallProgress.updateInterface(self)
if self.last >= self.percent:
@@ -19,11 +22,14 @@ class TextInstallProgress(InstallProgress):
sys.stdout.write("\r[%s] %s\n" %(self.percent, self.status))
sys.stdout.flush()
self.last = self.percent
+
def conffile(self,current,new):
print "conffile prompt: %s %s" % (current,new)
+
def error(self, errorstr):
print "got dpkg error: '%s'" % errorstr
+
cache = apt.Cache(apt.progress.OpTextProgress())
fprogress = apt.progress.TextFetchProgress()
@@ -42,7 +48,3 @@ res = cache.commit(fprogress, iprogress)
print res
sys.exit(0)
-
-
-
-