summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-07-05 04:05:31 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-07-05 04:05:31 +0200
commitf6facfb4193a582b94fa884f4bd2c4b70c862250 (patch)
tree5feb62db91cc3c9ff5051d209a92eae761986dc2 /plugins
parent1c9dfd130bf317afe6c78a3d0bdea6001f67a060 (diff)
downloadportato-f6facfb4193a582b94fa884f4bd2c4b70c862250.tar.gz
portato-f6facfb4193a582b94fa884f4bd2c4b70c862250.tar.bz2
portato-f6facfb4193a582b94fa884f4bd2c4b70c862250.zip
Doc
Diffstat (limited to '')
-rw-r--r--plugins/package_details.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/package_details.py b/plugins/package_details.py
index 3c96cf6..88dfc6c 100644
--- a/plugins/package_details.py
+++ b/plugins/package_details.py
@@ -17,6 +17,11 @@ from portato.gui import views
from portato.backend import system
class Detail (WidgetPlugin):
+ """
+ The baseclass for a detail.
+ This inherits from `WidgetPlugin` and manages the basic things, like adding to the Notebook.
+ """
+
__author__ = "René 'Necoro' Neumann"
_view_ = None
old_pkg = None
@@ -27,6 +32,7 @@ class Detail (WidgetPlugin):
def widget_init (self):
self.add_widget("Package Notebook", (self._widget_, self._widget_name_))
+ # if the detail was updated before it was actually initialized, update it again :)
if self._old_pkg is not None:
self._update(self._old_pkg)
@@ -39,14 +45,19 @@ class Detail (WidgetPlugin):
self._view_.update(pkg, force = force)
self._old_pkg = None
- else:
+
+ else: # save
self._old_pkg = pkg
class ScrolledDetail (Detail):
+ """
+ Add a ScrolledWindow.
+ """
def widget_init (self):
self._widget_ = gtk.ScrolledWindow()
self._widget_.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+
if self._view_ is not None:
self._widget_.add(self._view_)
@@ -67,6 +78,7 @@ class ChangelogDetail (ScrolledDetail):
class EbuildDetail (ScrolledDetail):
__description__ = _("Shows the ebuild of a package")
__name__ = "Detail: Ebuild"
+ __dependency__ = [">=dev-python/pygtksourceview-2.4.0"]
_widget_name_ = _("Ebuild")
def widget_init(self):
@@ -196,6 +208,7 @@ class DependencyDetail (ScrolledDetail):
return store
+# register them
register(DependencyDetail)
register(EbuildDetail)
register(FilesDetail)