summaryrefslogtreecommitdiff
path: root/doc/examples/gui-inst.py
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/gui-inst.py')
-rwxr-xr-xdoc/examples/gui-inst.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/doc/examples/gui-inst.py b/doc/examples/gui-inst.py
index feefd6ed..8138d922 100755
--- a/doc/examples/gui-inst.py
+++ b/doc/examples/gui-inst.py
@@ -1,20 +1,13 @@
#!/usr/bin/python
# example how to install in a custom terminal widget
# see also gnome bug: #169201
-
-import apt
-import apt_pkg
-import sys, os, fcntl
-import copy
-import string
-import fcntl
-
import pygtk
pygtk.require('2.0')
import gtk
import apt.gtk.widgets
+
if __name__ == "__main__":
win = gtk.Window()
@@ -23,14 +16,12 @@ if __name__ == "__main__":
win.add(progress)
progress.show()
win.show()
-
+
cache = apt.cache.Cache(progress.open)
if cache["2vcard"].isInstalled:
cache["2vcard"].markDelete()
else:
cache["2vcard"].markInstall()
progress.show_terminal(expanded=True)
- cache.commit(progress.fetch,
- progress.install)
-
+ cache.commit(progress.fetch, progress.install)
gtk.main()