From 7c2469a3ca95f933766070e11b55392a906027c4 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sat, 20 Apr 2013 23:22:53 +0000 Subject: [PATCH] [r22026]Remove some imports of locale where nothing it exports was used. svn: r22043 --- gramps/gen/datehandler/_datehandler.py | 1 - gramps/gen/utils/cast.py | 1 - gramps/gen/utils/file.py | 1 - gramps/gui/filters/sidebar/_personsidebarfilter.py | 5 ++--- gramps/gui/viewmanager.py | 1 - gramps/gui/views/treemodels/treebasemodel.py | 4 +--- gramps/plugins/docgen/odfdoc.py | 4 +--- gramps/plugins/view/geoevents.py | 5 ++--- gramps/plugins/view/geofamily.py | 5 ++--- gramps/plugins/view/geoperson.py | 5 ++--- gramps/plugins/view/geoplaces.py | 5 ++--- 11 files changed, 12 insertions(+), 25 deletions(-) diff --git a/gramps/gen/datehandler/_datehandler.py b/gramps/gen/datehandler/_datehandler.py index 04efb249b..e0f0125cf 100644 --- a/gramps/gen/datehandler/_datehandler.py +++ b/gramps/gen/datehandler/_datehandler.py @@ -30,7 +30,6 @@ from __future__ import unicode_literals # Python modules # #------------------------------------------------------------------------- -import locale import os #------------------------------------------------------------------------- diff --git a/gramps/gen/utils/cast.py b/gramps/gen/utils/cast.py index 684137b24..ec6a02065 100644 --- a/gramps/gen/utils/cast.py +++ b/gramps/gen/utils/cast.py @@ -32,7 +32,6 @@ Utility functions to cast types # #------------------------------------------------------------------------- import os -import locale import sys import logging LOG = logging.getLogger(".") diff --git a/gramps/gen/utils/file.py b/gramps/gen/utils/file.py index 154644a4c..63a68d535 100644 --- a/gramps/gen/utils/file.py +++ b/gramps/gen/utils/file.py @@ -33,7 +33,6 @@ File and folder related utility functions #------------------------------------------------------------------------- import os import sys -import locale import shutil import logging LOG = logging.getLogger(".gen.utils.file") diff --git a/gramps/gui/filters/sidebar/_personsidebarfilter.py b/gramps/gui/filters/sidebar/_personsidebarfilter.py index b276b48a6..a8d824145 100644 --- a/gramps/gui/filters/sidebar/_personsidebarfilter.py +++ b/gramps/gui/filters/sidebar/_personsidebarfilter.py @@ -26,9 +26,6 @@ # Python modules # #------------------------------------------------------------------------- -from gramps.gen.const import GRAMPS_LOCALE as glocale -_ = glocale.translation.gettext -import locale #------------------------------------------------------------------------- # @@ -42,6 +39,8 @@ from gi.repository import Gtk # GRAMPS modules # #------------------------------------------------------------------------- +from gramps.gen.const import GRAMPS_LOCALE as glocale +_ = glocale.translation.gettext from ... import widgets from gramps.gen.lib import Date, Event, EventType from gramps.gen.datehandler import displayer diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index 4091c0536..9e68c815e 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -370,7 +370,6 @@ class ViewManager(CLIManager): from urllib2 import urlopen else: from urllib.request import urlopen - import locale LOG.debug("Checking for updated addons...") langs = glocale.get_language_list() langs.append("en") diff --git a/gramps/gui/views/treemodels/treebasemodel.py b/gramps/gui/views/treemodels/treebasemodel.py index a33f8f5d4..caf946f78 100644 --- a/gramps/gui/views/treemodels/treebasemodel.py +++ b/gramps/gui/views/treemodels/treebasemodel.py @@ -35,10 +35,7 @@ This module provides the model that is used for all hierarchical treeviews. # #------------------------------------------------------------------------- import time -import locale import sys -from gramps.gen.const import GRAMPS_LOCALE as glocale -_ = glocale.translation.gettext import logging _LOG = logging.getLogger(".gui.treebasemodel") @@ -57,6 +54,7 @@ from gi.repository import Gtk # #------------------------------------------------------------------------- from gramps.gen.const import GRAMPS_LOCALE as glocale +_ = glocale.translation.gettext import gramps.gui.widgets.progressdialog as progressdlg from gramps.gen.constfunc import cuni, UNITYPE from .lru import LRU diff --git a/gramps/plugins/docgen/odfdoc.py b/gramps/plugins/docgen/odfdoc.py index 5e91f47ba..b65ee1ab4 100644 --- a/gramps/plugins/docgen/odfdoc.py +++ b/gramps/plugins/docgen/odfdoc.py @@ -70,7 +70,6 @@ except ImportError: from md5 import md5 import zipfile import time -import locale import sys if sys.version_info[0] < 3: from cStringIO import StringIO @@ -496,8 +495,7 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc): wrt = self.cntnt.write wrt1, wrt2 = self.cntnt1.write, self.cntnt2.write - current_locale = locale.getlocale() - self.lang = current_locale[0] + self.lang = glocale.lang self.lang = self.lang.replace('_', '-') if self.lang else "en-US" self.StyleList_notes = [] # styles to create depending on styled notes. diff --git a/gramps/plugins/view/geoevents.py b/gramps/plugins/view/geoevents.py index 71452c5e2..a7ab6dd7d 100644 --- a/gramps/plugins/view/geoevents.py +++ b/gramps/plugins/view/geoevents.py @@ -30,12 +30,9 @@ Geography for events # Python modules # #------------------------------------------------------------------------- -from gramps.gen.const import GRAMPS_LOCALE as glocale -_ = glocale.translation.gettext import os import sys import operator -import locale from gi.repository import Gdk KEY_TAB = Gdk.KEY_Tab import socket @@ -54,6 +51,8 @@ _LOG = logging.getLogger("GeoGraphy.geoevents") # Gramps Modules # #------------------------------------------------------------------------- +from gramps.gen.const import GRAMPS_LOCALE as glocale +_ = glocale.translation.gettext from gramps.gen.lib import EventType from gramps.gen.config import config from gramps.gen.datehandler import displayer diff --git a/gramps/plugins/view/geofamily.py b/gramps/plugins/view/geofamily.py index a48ae93ec..ea2b810d8 100644 --- a/gramps/plugins/view/geofamily.py +++ b/gramps/plugins/view/geofamily.py @@ -30,12 +30,9 @@ Geography for one family # Python modules # #------------------------------------------------------------------------- -from gramps.gen.const import GRAMPS_LOCALE as glocale -_ = glocale.translation.gettext import os import sys import operator -import locale from gi.repository import Gdk KEY_TAB = Gdk.KEY_Tab import socket @@ -54,6 +51,8 @@ _LOG = logging.getLogger("GeoGraphy.geofamily") # Gramps Modules # #------------------------------------------------------------------------- +from gramps.gen.const import GRAMPS_LOCALE as glocale +_ = glocale.translation.gettext from gramps.gen.lib import EventRoleType, EventType from gramps.gen.config import config from gramps.gen.datehandler import displayer diff --git a/gramps/plugins/view/geoperson.py b/gramps/plugins/view/geoperson.py index 67dfc4cfc..b62474def 100644 --- a/gramps/plugins/view/geoperson.py +++ b/gramps/plugins/view/geoperson.py @@ -30,12 +30,9 @@ Geography for one person # Python modules # #------------------------------------------------------------------------- -from gramps.gen.const import GRAMPS_LOCALE as glocale -_ = glocale.translation.gettext import os import sys import operator -import locale from gi.repository import Gdk KEY_TAB = Gdk.KEY_Tab import socket @@ -56,6 +53,8 @@ _LOG = logging.getLogger("GeoGraphy.geoperson") # Gramps Modules # #------------------------------------------------------------------------- +from gramps.gen.const import GRAMPS_LOCALE as glocale +_ = glocale.translation.gettext from gramps.gen.lib import EventRoleType, EventType from gramps.gen.config import config from gramps.gen.datehandler import displayer diff --git a/gramps/plugins/view/geoplaces.py b/gramps/plugins/view/geoplaces.py index 322189d7a..d82dbc338 100644 --- a/gramps/plugins/view/geoplaces.py +++ b/gramps/plugins/view/geoplaces.py @@ -30,13 +30,10 @@ Geography for places # Python modules # #------------------------------------------------------------------------- -from gramps.gen.const import GRAMPS_LOCALE as glocale -_ = glocale.translation.gettext import os import sys import time import operator -import locale from gi.repository import Gdk KEY_TAB = Gdk.KEY_Tab import socket @@ -55,6 +52,8 @@ _LOG = logging.getLogger("GeoGraphy.geoplaces") # Gramps Modules # #------------------------------------------------------------------------- +from gramps.gen.const import GRAMPS_LOCALE as glocale +_ = glocale.translation.gettext from gramps.gen.lib import EventType from gramps.gen.config import config from gramps.gen.display.name import displayer as _nd