GObject-powered progress classes and a GTK+ status widget.
An InstallProgress for local installations.
Signals:
- status-changed(str: status, int: percent)
- status-started() - Not Implemented yet
- status-finished()
- status-timeout() - When the maintainer script hangs
- status-error() - When an error happens
- status-conffile() - On Conffile
Called periodically to update the interface.
Emits: status-timeout() [When a timeout happens]
A Fetch Progress with GObject signals.
Signals:
- status-changed(str: description, int: percent)
- status-started()
- status-finished()
Installation progress with GObject signals.
Signals:
- status-changed(str: status, int: percent)
- status-started()
- status-finished()
- status-timeout()
- status-error()
- status-conffile()
Called during conffile.
Emits: status-conffile()
Called when an error happens.
Emits: status-error()
Called when the update finished.
Emits: status-finished()
Called when the update starts.
Emits: status-started()
Called when the status changed.
Emits: status-changed(status, percent)
Called periodically to update the interface.
Emits: status-timeout() [When a timeout happens]
Graphical progress for installation/fetch/operations.
This widget provides a progress bar, a terminal and a status bar for showing the progress of package manipulation tasks.
Show the expander for the terminal.
Show an expander with a terminal widget which provides a way to interact with dpkg
#!/usr/bin/python
"""Example for gtk widgets"""
import pygtk
pygtk.require("2.0")
import gtk
import apt.progress.gtk2
def main():
"""Main function."""
win = gtk.Window()
win.connect("destroy", gtk.main_quit)
progress = apt.progress.gtk2.GtkAptProgress()
win.set_title("GtkAptProgress Demo")
win.add(progress)
progress.show()
win.show()
cache = apt.cache.Cache(progress.open)
if cache["xterm"].isInstalled:
cache["xterm"].markDelete()
else:
cache["xterm"].markInstall()
progress.show_terminal(expanded=True)
cache.commit(progress.fetch, progress.install)
gtk.main()
if __name__ == "__main__":
main()