[mousetrap/gnome3-wip: 152/240] Fix gettext.install magic.
- From: Heidi Ellis <heidiellis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mousetrap/gnome3-wip: 152/240] Fix gettext.install magic.
- Date: Mon, 8 Sep 2014 15:25:20 +0000 (UTC)
commit 1e32977b008773abccab0c5a2a58c104772472be
Author: Stoney Jackson <dr stoney gmail com>
Date: Tue Jun 24 16:55:51 2014 -0400
Fix gettext.install magic.
src/mousetrap/config.py | 1 +
src/mousetrap/gui.py | 3 +++
src/mousetrap/image.py | 1 +
src/mousetrap/main.py | 4 +---
src/mousetrap/plugins/camera.py | 1 +
src/mousetrap/plugins/display.py | 1 +
src/mousetrap/plugins/eyes.py | 1 +
src/mousetrap/plugins/interface.py | 3 +++
src/mousetrap/plugins/nose.py | 1 +
src/mousetrap/vision.py | 1 +
10 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/mousetrap/config.py b/src/mousetrap/config.py
index 2ecb76f..fcf9445 100644
--- a/src/mousetrap/config.py
+++ b/src/mousetrap/config.py
@@ -2,6 +2,7 @@ from yaml import safe_load
from os.path import dirname, expanduser, exists
from os import getcwd
from copy import deepcopy
+from mousetrap.i18n import _
class Config(dict):
diff --git a/src/mousetrap/gui.py b/src/mousetrap/gui.py
index 1e36cb3..0c77616 100644
--- a/src/mousetrap/gui.py
+++ b/src/mousetrap/gui.py
@@ -16,6 +16,9 @@ from Xlib.ext import xtest
from Xlib import X
+from mousetrap.i18n import _
+
+
class ImageWindow(object):
def __init__(self, config, message):
self._config = config
diff --git a/src/mousetrap/image.py b/src/mousetrap/image.py
index d837a15..02a714b 100644
--- a/src/mousetrap/image.py
+++ b/src/mousetrap/image.py
@@ -4,6 +4,7 @@ All things image manipulation.
import cv2
from gi.repository import GdkPixbuf
+from mousetrap.i18n import _
_GDK_PIXBUF_BIT_PER_SAMPLE = 8
diff --git a/src/mousetrap/main.py b/src/mousetrap/main.py
index 7491214..65db5ad 100644
--- a/src/mousetrap/main.py
+++ b/src/mousetrap/main.py
@@ -2,9 +2,6 @@
Where it all begins.
'''
-import gettext
-gettext.install('mousetrap')
-
from mousetrap.config import Config
CONFIG = Config()
@@ -18,6 +15,7 @@ import yaml
LOGGER.debug(yaml.dump(dict(CONFIG), default_flow_style=False))
+from mousetrap.i18n import _
from gi.repository import GObject, Gdk, Gtk
from mousetrap.gui import Gui, Pointer
from mousetrap.vision import Camera
diff --git a/src/mousetrap/plugins/camera.py b/src/mousetrap/plugins/camera.py
index 516ded4..bd3ba99 100644
--- a/src/mousetrap/plugins/camera.py
+++ b/src/mousetrap/plugins/camera.py
@@ -1,3 +1,4 @@
+from mousetrap.i18n import _
import mousetrap.plugins.interface as interface
diff --git a/src/mousetrap/plugins/display.py b/src/mousetrap/plugins/display.py
index 16f90bc..5da71aa 100644
--- a/src/mousetrap/plugins/display.py
+++ b/src/mousetrap/plugins/display.py
@@ -1,3 +1,4 @@
+from mousetrap.i18n import _
import mousetrap.plugins.interface as interface
import logging
diff --git a/src/mousetrap/plugins/eyes.py b/src/mousetrap/plugins/eyes.py
index e135402..bf380d4 100644
--- a/src/mousetrap/plugins/eyes.py
+++ b/src/mousetrap/plugins/eyes.py
@@ -1,3 +1,4 @@
+from mousetrap.i18n import _
import logging
LOGGER = logging.getLogger(__name__)
diff --git a/src/mousetrap/plugins/interface.py b/src/mousetrap/plugins/interface.py
index a6bfd88..7c2752d 100644
--- a/src/mousetrap/plugins/interface.py
+++ b/src/mousetrap/plugins/interface.py
@@ -1,3 +1,6 @@
+from mousetrap.i18n import _
+
+
class Plugin(object):
def __init__(self, config):
'''Override to initialize and configure yourself.
diff --git a/src/mousetrap/plugins/nose.py b/src/mousetrap/plugins/nose.py
index c4a37ba..4192419 100644
--- a/src/mousetrap/plugins/nose.py
+++ b/src/mousetrap/plugins/nose.py
@@ -1,3 +1,4 @@
+from mousetrap.i18n import _
import mousetrap.plugins.interface as interface
from mousetrap.vision import FeatureDetector, FeatureNotFoundException
from mousetrap.gui import Gui
diff --git a/src/mousetrap/vision.py b/src/mousetrap/vision.py
index 6d376ed..601742c 100644
--- a/src/mousetrap/vision.py
+++ b/src/mousetrap/vision.py
@@ -4,6 +4,7 @@ All things computer vision.
import cv2
import cv
+from mousetrap.i18n import _
from mousetrap.image import Image
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]