From ad7bc46acd80451de21ce58450edb0f4367a5c79 Mon Sep 17 00:00:00 2001 From: Ben Finney Date: Fri, 16 May 2008 16:50:38 +1000 Subject: Fix code indentation to 4 spaces, to conform with PEP 8. --- doc/examples/inst.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'doc/examples/inst.py') diff --git a/doc/examples/inst.py b/doc/examples/inst.py index d1e2ff99..b37ab4cd 100644 --- a/doc/examples/inst.py +++ b/doc/examples/inst.py @@ -11,23 +11,23 @@ from apt.progress import InstallProgress class TextInstallProgress(InstallProgress): - def __init__(self): - apt.progress.InstallProgress.__init__(self) - self.last = 0.0 + def __init__(self): + apt.progress.InstallProgress.__init__(self) + self.last = 0.0 - def updateInterface(self): - InstallProgress.updateInterface(self) - if self.last >= self.percent: - return - sys.stdout.write("\r[%s] %s\n" %(self.percent, self.status)) - sys.stdout.flush() - self.last = self.percent + def updateInterface(self): + InstallProgress.updateInterface(self) + if self.last >= self.percent: + return + 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 conffile(self,current,new): + print "conffile prompt: %s %s" % (current,new) - def error(self, errorstr): - print "got dpkg error: '%s'" % errorstr + def error(self, errorstr): + print "got dpkg error: '%s'" % errorstr cache = apt.Cache(apt.progress.OpTextProgress()) @@ -39,11 +39,11 @@ pkg = cache["3dchess"] # install or remove, the importend thing is to keep us busy :) if pkg.isInstalled: - print "Going to delete %s" % pkg.name - pkg.markDelete() + print "Going to delete %s" % pkg.name + pkg.markDelete() else: - print "Going to install %s" % pkg.name - pkg.markInstall() + print "Going to install %s" % pkg.name + pkg.markInstall() res = cache.commit(fprogress, iprogress) print res -- cgit v1.2.3