summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/etc_proposals.py4
-rw-r--r--plugins/gpytage.py4
-rw-r--r--plugins/new_version.py5
-rw-r--r--plugins/notify.py12
-rw-r--r--plugins/package_details.py8
5 files changed, 20 insertions, 13 deletions
diff --git a/plugins/etc_proposals.py b/plugins/etc_proposals.py
index 83b38f7..052f3d3 100644
--- a/plugins/etc_proposals.py
+++ b/plugins/etc_proposals.py
@@ -10,8 +10,6 @@
#
# Written by René 'Necoro' Neumann <necoro@necoro.net>
-from portato.helper import error
-
import os
from subprocess import Popen
@@ -31,7 +29,7 @@ class EtcProposals (WidgetPlugin):
if os.getuid() == 0:
Popen(self.prog+options)
else:
- error("ETC_PROPOSALS :: %s",_("Cannot start etc-proposals. Not root!"))
+ helper.error("ETC_PROPOSALS :: %s",_("Cannot start etc-proposals. Not root!"))
def hook (self, *args, **kwargs):
"""Entry point for this plugin."""
diff --git a/plugins/gpytage.py b/plugins/gpytage.py
index d014f19..b7b48d7 100644
--- a/plugins/gpytage.py
+++ b/plugins/gpytage.py
@@ -12,12 +12,12 @@
from subprocess import Popen
-class GPytage (Plugin):
+class GPytage (WidgetPlugin):
__author__ = "René 'Necoro' Neumann"
__description__ = "Adds a menu entry to directly start <b>gpytage</b>, a config editor."
__dependency__ = ["app-portage/gpytage"]
- def init (self):
+ def widget_init (self):
self.create_widget("Plugin Menu", "Config _Editor", activate = self.menu)
def menu (self, *args):
diff --git a/plugins/new_version.py b/plugins/new_version.py
index f8d5d3c..94e61ca 100644
--- a/plugins/new_version.py
+++ b/plugins/new_version.py
@@ -10,13 +10,16 @@
#
# Written by René 'Necoro' Neumann <necoro@necoro.net>
+from portato.helper import debug, warning
+
try:
from bzrlib import plugin, branch
except ImportError:
plugin = branch = None
+ warning("NEW_VERSION :: Cannot import 'bzrlib'")
+
import gobject
-from portato.helper import debug, warning
from portato import get_listener
from portato.constants import REPOURI, VERSION, APP_ICON, APP
from portato.gui.utils import GtkThread
diff --git a/plugins/notify.py b/plugins/notify.py
index 8f21de5..4aba2c6 100644
--- a/plugins/notify.py
+++ b/plugins/notify.py
@@ -12,15 +12,15 @@
disable = False
+from portato import get_listener
+
+from portato.constants import APP_ICON, APP
+
try:
import pynotify
except ImportError:
disable = True
-
-from portato import get_listener
-
-from portato.helper import warning, error, debug
-from portato.constants import APP_ICON, APP
+ helper.warning("NOTIFY :: %s", _("Cannot import 'pynotify'."))
class Notify (Plugin):
__author__ = "René 'Necoro' Neumann"
@@ -32,7 +32,7 @@ class Notify (Plugin):
def notify (self, retcode, **kwargs):
if retcode is None:
- warning("NOTIFY :: %s", _("Notify called while process is still running!"))
+ helper.warning("NOTIFY :: %s", _("Notify called while process is still running!"))
else:
icon = APP_ICON
if retcode == 0:
diff --git a/plugins/package_details.py b/plugins/package_details.py
index 88dfc6c..19f3126 100644
--- a/plugins/package_details.py
+++ b/plugins/package_details.py
@@ -23,13 +23,19 @@ class Detail (WidgetPlugin):
"""
__author__ = "René 'Necoro' Neumann"
+
_view_ = None
- old_pkg = None
+ _old_pkg = None
+ _widget_ = None
+ _widget_name_ = None
def init(self):
self.add_call("update_table", self._update, type = "after")
def widget_init (self):
+ if (self._widget_ is None) or (self._widget_name_ is None):
+ raise PluginLoadException, ("Has not set _widget_ or _widget_name_.")
+
self.add_widget("Package Notebook", (self._widget_, self._widget_name_))
# if the detail was updated before it was actually initialized, update it again :)