[mousetrap/gnome3-wip: 127/240] Extract mousetrap.plugins.display configuration.
- From: Heidi Ellis <heidiellis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mousetrap/gnome3-wip: 127/240] Extract mousetrap.plugins.display configuration.
- Date: Mon, 8 Sep 2014 15:23:14 +0000 (UTC)
commit 464d2ad2fc81b1f5d0277b6e45d9a18aeb15282f
Author: Stoney Jackson <dr stoney gmail com>
Date: Mon Jun 23 14:52:10 2014 -0400
Extract mousetrap.plugins.display configuration.
src/mousetrap/config.py | 5 ++++-
src/mousetrap/plugins/display.py | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/mousetrap/config.py b/src/mousetrap/config.py
index a466621..7a23f9a 100644
--- a/src/mousetrap/config.py
+++ b/src/mousetrap/config.py
@@ -47,9 +47,12 @@ class Config(dict):
}
self['plugins'] = {
+ 'mousetrap.plugins.display.DisplayPlugin': {
+ 'window_title': 'MouseTrap',
+ }
}
def for_plugin(self, plugin_object):
class_ = plugin_object.__class__
- return self[class_.__module__ + '.' + class_.__name__]
+ return self['plugins'][class_.__module__ + '.' + class_.__name__]
diff --git a/src/mousetrap/plugins/display.py b/src/mousetrap/plugins/display.py
index 2cc6804..e747a7f 100644
--- a/src/mousetrap/plugins/display.py
+++ b/src/mousetrap/plugins/display.py
@@ -5,6 +5,7 @@ import logging
class DisplayPlugin(interface.Plugin):
def __init__(self, config):
self._config = config
+ self._window_title = config.for_plugin(self)['window_title']
def run(self, app):
- app.gui.show_image('MouseTrap', app.image)
+ app.gui.show_image(self._window_title, app.image)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]