summaryrefslogtreecommitdiff
path: root/nephilim/plugin.py
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2009-06-19 15:16:04 +0200
committerAnton Khirnov <wyskas@gmail.com>2009-06-19 15:16:04 +0200
commite7e7093a12fb5eb52fd0bb3071a7c85c7d8aefbd (patch)
tree2213730940de919569aa9306bdd1a9df214cf6b1 /nephilim/plugin.py
parent4264cea8e446cd5cb5f01c9749b201d5c57ecff6 (diff)
make plugin name a var instead of a function.
Diffstat (limited to 'nephilim/plugin.py')
-rw-r--r--nephilim/plugin.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/nephilim/plugin.py b/nephilim/plugin.py
index 539cd5d..b443167 100644
--- a/nephilim/plugin.py
+++ b/nephilim/plugin.py
@@ -23,7 +23,10 @@ import logging
import plugins
class Plugin(QtCore.QObject):
- _name = None
+ # public, const
+ name = None
+ logger = None
+
_dock_widget = None
_settings = None
_loaded = None
@@ -31,18 +34,17 @@ class Plugin(QtCore.QObject):
_mpclient = None
o = None
- logger = None
DEFAULTS = {}
def __init__(self, parent, mpclient, name):
QtCore.QObject.__init__(self)
- self._name = name
+ self.name = name
self._parent = parent
self._mpclient = mpclient
self._loaded = False
self._settings = QtCore.QSettings()
- self.logger = logging.getLogger(self.name())
+ self.logger = logging.getLogger(self.name)
#init settings
self.logger.debug('Initializing default settings.')
@@ -52,9 +54,6 @@ class Plugin(QtCore.QObject):
self._settings.setValue(key, QVariant(self.DEFAULTS[key]))
self._settings.endGroup()
-
- def name(self):
- return self._name
def info(self):
return ''
def parent(self):
@@ -135,8 +134,8 @@ class Plugin(QtCore.QObject):
return None
def _create_dock(self, widget):
"""Creates a QDockWidget with _parent $_parent containing widget $widget."""
- dock=QtGui.QDockWidget(self._name, QtGui.QApplication.instance().main_win)
- dock.setObjectName(self._name)
+ dock=QtGui.QDockWidget(self.name, QtGui.QApplication.instance().main_win)
+ dock.setObjectName(self.name)
dock.setWidget(widget)
return dock