summaryrefslogtreecommitdiff
path: root/plugins/pythonconsole
diff options
context:
space:
mode:
authormbkma <[email protected]>2021-02-12 11:31:23 +0100
committerraveit65 <[email protected]>2021-03-04 22:00:30 +0100
commitf4ed7690bff4021051f11fbe851b604d69caef2f (patch)
tree77d5d439779373c08cc10dcb668460437d42732d /plugins/pythonconsole
parent0d91cd7289dfc1e59658ea4a946a843a576496c8 (diff)
downloadpluma-f4ed7690bff4021051f11fbe851b604d69caef2f.tar.bz2
pluma-f4ed7690bff4021051f11fbe851b604d69caef2f.tar.xz
port plugins to use the window-construct property.
pluma-file-browser-plugin.c: rename "data" to "priv".
Diffstat (limited to 'plugins/pythonconsole')
-rwxr-xr-xplugins/pythonconsole/pythonconsole/__init__.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/plugins/pythonconsole/pythonconsole/__init__.py b/plugins/pythonconsole/pythonconsole/__init__.py
index 171b3672..0bab533d 100755
--- a/plugins/pythonconsole/pythonconsole/__init__.py
+++ b/plugins/pythonconsole/pythonconsole/__init__.py
@@ -32,33 +32,29 @@ from .config import PythonConsoleConfig
PYTHON_ICON = 'text-x-python'
-class PythonConsolePlugin(GObject.Object, Peas.Activatable, PeasGtk.Configurable):
+class PythonConsolePlugin(GObject.Object, Pluma.WindowActivatable, PeasGtk.Configurable):
__gtype_name__ = "PythonConsolePlugin"
- object = GObject.Property(type=GObject.Object)
+ window = GObject.Property(type=Pluma.Window)
def __init__(self):
GObject.Object.__init__(self)
self.config_widget = None
def do_activate(self):
- window = self.object
-
self._console = PythonConsole(namespace = {'__builtins__' : __builtins__,
'pluma' : Pluma,
- 'window' : window})
+ 'window' : self.window})
self._console.eval('print("You can access the main window through ' \
'\'window\' :\\n%s" % window)', False)
- bottom = window.get_bottom_panel()
+ bottom = self.window.get_bottom_panel()
image = Gtk.Image()
image.set_from_icon_name(PYTHON_ICON, Gtk.IconSize.MENU)
bottom.add_item(self._console, _('Python Console'), image)
def do_deactivate(self):
- window = self.object
-
self._console.stop()
- bottom = window.get_bottom_panel()
+ bottom = self.window.get_bottom_panel()
bottom.remove_item(self._console)
def do_create_configure_widget(self):