summaryrefslogtreecommitdiff
path: root/doc/examples/gui-inst.py
diff options
context:
space:
mode:
authorBen Finney <ben@benfinney.id.au>2008-05-16 16:50:38 +1000
committerBen Finney <ben@benfinney.id.au>2008-05-16 16:50:38 +1000
commitad7bc46acd80451de21ce58450edb0f4367a5c79 (patch)
tree12775f7901544a709f8d63079f1cd57fef00f5a8 /doc/examples/gui-inst.py
parenta953d82143f0ec979e18f17e8d9bbacbac954868 (diff)
downloadpython-apt-ad7bc46acd80451de21ce58450edb0f4367a5c79.tar.gz
Fix code indentation to 4 spaces, to conform with PEP 8.
Diffstat (limited to 'doc/examples/gui-inst.py')
-rwxr-xr-xdoc/examples/gui-inst.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/doc/examples/gui-inst.py b/doc/examples/gui-inst.py
index 28887d34..edaec455 100755
--- a/doc/examples/gui-inst.py
+++ b/doc/examples/gui-inst.py
@@ -22,51 +22,51 @@ from apt.progress import OpProgress, FetchProgress, InstallProgress
class GuiFetchProgress(gtk.Window, FetchProgress):
def __init__(self):
- gtk.Window.__init__(self)
- self.vbox = gtk.VBox()
- self.vbox.show()
- self.add(self.vbox)
- self.progress = gtk.ProgressBar()
- self.progress.show()
- self.label = gtk.Label()
- self.label.show()
- self.vbox.pack_start(self.progress)
- self.vbox.pack_start(self.label)
- self.resize(300,100)
+ gtk.Window.__init__(self)
+ self.vbox = gtk.VBox()
+ self.vbox.show()
+ self.add(self.vbox)
+ self.progress = gtk.ProgressBar()
+ self.progress.show()
+ self.label = gtk.Label()
+ self.label.show()
+ self.vbox.pack_start(self.progress)
+ self.vbox.pack_start(self.label)
+ self.resize(300,100)
def start(self):
print "start"
- self.progress.set_fraction(0.0)
+ self.progress.set_fraction(0.0)
self.show()
def stop(self):
- self.hide()
+ self.hide()
def pulse(self):
FetchProgress.pulse(self)
self.label.set_text("Speed: %s/s" % apt_pkg.SizeToStr(self.currentCPS))
- #self.progressbar.set_fraction(self.currentBytes/self.totalBytes)
- while gtk.events_pending():
- gtk.main_iteration()
+ #self.progressbar.set_fraction(self.currentBytes/self.totalBytes)
+ while gtk.events_pending():
+ gtk.main_iteration()
return True
class TermInstallProgress(InstallProgress, gtk.Window):
def __init__(self):
- gtk.Window.__init__(self)
+ gtk.Window.__init__(self)
InstallProgress.__init__(self)
- self.show()
+ self.show()
box = gtk.VBox()
box.show()
self.add(box)
- self.term = vte.Terminal()
- self.term.show()
+ self.term = vte.Terminal()
+ self.term.show()
# check for the child
self.reaper = vte.reaper_get()
self.reaper.connect("child-exited",self.child_exited)
self.finished = False
- box.pack_start(self.term)
+ box.pack_start(self.term)
self.progressbar = gtk.ProgressBar()
self.progressbar.show()
box.pack_start(self.progressbar)
@@ -115,16 +115,16 @@ iprogress = TermInstallProgress()
# show the interface
while gtk.events_pending():
- gtk.main_iteration()
+ gtk.main_iteration()
pkg = cache["3dchess"]
print "\n%s"%pkg.name
# install or remove, the importend thing is to keep us busy :)
if pkg.isInstalled:
- pkg.markDelete()
+ pkg.markDelete()
else:
- pkg.markInstall()
+ pkg.markInstall()
cache.commit(fprogress, iprogress)
print "Exiting"