diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 099f28022..b9e222190 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -4,6 +4,9 @@ 2006-03-10 Alex Roitman * src/Plugins.py, src/PluginMgr.py: Move to ReportUtils. * various: use ReportUtils instead of PluginMgr. + * DateHandler/_DateHandler.py: Rename __init__; remove dependency + on load_plugins. + * DateHandler/__init__.py: Add new file. 2006-03-10 Don Allingham * src/Mime/PythonMime.py: import gtk diff --git a/gramps2/src/DateHandler/Makefile.am b/gramps2/src/DateHandler/Makefile.am index de1afdc51..65893010e 100644 --- a/gramps2/src/DateHandler/Makefile.am +++ b/gramps2/src/DateHandler/Makefile.am @@ -16,6 +16,7 @@ pkgdata_PYTHON = \ _Date_nl.py\ _DateDisplay.py\ _DateParser.py\ + _DateHandler.py\ __init__.py pkgpyexecdir = @pkgpyexecdir@/DateHandler diff --git a/gramps2/src/DateHandler/__init__.py b/gramps2/src/DateHandler/_DateHandler.py similarity index 95% rename from gramps2/src/DateHandler/__init__.py rename to gramps2/src/DateHandler/_DateHandler.py index 23b6c4b72..7acc0d0fe 100644 --- a/gramps2/src/DateHandler/__init__.py +++ b/gramps2/src/DateHandler/_DateHandler.py @@ -108,16 +108,6 @@ def register_datehandler(locales,parse_class,display_class): _lang_to_parser[lang_str] = parse_class _lang_to_display[lang_str] = display_class - -#------------------------------------------------------------------------- -# -# Import localized date classes -# -#------------------------------------------------------------------------- -from PluginUtils import load_plugins -from const import datesDir -load_plugins(datesDir) - #------------------------------------------------------------------------- # # Initialize global parser diff --git a/gramps2/src/DateHandler/_Date_de.py b/gramps2/src/DateHandler/_Date_de.py index 09143b693..55dc253a8 100644 --- a/gramps2/src/DateHandler/_Date_de.py +++ b/gramps2/src/DateHandler/_Date_de.py @@ -38,8 +38,9 @@ import re # #------------------------------------------------------------------------- from RelLib import Date -from DateParser import DateParser -from DateDisplay import DateDisplay +from _DateParser import DateParser +from _DateDisplay import DateDisplay +from _DateHandler import register_datehandler #------------------------------------------------------------------------- # @@ -223,6 +224,6 @@ class DateDisplayDE(DateDisplay): # Register classes # #------------------------------------------------------------------------- -from DateHandler import register_datehandler register_datehandler(('de_DE','german','de_AT','de_CH', - 'de_LI','de_LU','de_BE','de'),DateParserDE, DateDisplayDE) + 'de_LI','de_LU','de_BE','de'), + DateParserDE, DateDisplayDE) diff --git a/gramps2/src/DateHandler/_Date_es.py b/gramps2/src/DateHandler/_Date_es.py index 429f1eee4..fe6f6c501 100644 --- a/gramps2/src/DateHandler/_Date_es.py +++ b/gramps2/src/DateHandler/_Date_es.py @@ -38,8 +38,9 @@ import re # #------------------------------------------------------------------------- from RelLib import Date -from DateParser import DateParser -from DateDisplay import DateDisplay +from _DateParser import DateParser +from _DateDisplay import DateDisplay +from _DateHandler import register_datehandler #------------------------------------------------------------------------- # @@ -158,5 +159,4 @@ class DateDisplayES(DateDisplay): # Register classes # #------------------------------------------------------------------------- -from DateHandler import register_datehandler register_datehandler(('es_ES','es','spanish'),DateParserES, DateDisplayES) diff --git a/gramps2/src/DateHandler/_Date_fi.py b/gramps2/src/DateHandler/_Date_fi.py index 65d5141b2..db2dd20f7 100644 --- a/gramps2/src/DateHandler/_Date_fi.py +++ b/gramps2/src/DateHandler/_Date_fi.py @@ -38,8 +38,9 @@ import re # #------------------------------------------------------------------------- from RelLib import Date -from DateParser import DateParser -from DateDisplay import DateDisplay +from _DateParser import DateParser +from _DateDisplay import DateDisplay +from _DateHandler import register_datehandler #------------------------------------------------------------------------- # @@ -180,6 +181,4 @@ class DateDisplayFI(DateDisplay): # Register classes # #------------------------------------------------------------------------- -from DateHandler import register_datehandler register_datehandler(('fi_FI','fi','finnish'), DateParserFI, DateDisplayFI) - diff --git a/gramps2/src/DateHandler/_Date_fr.py b/gramps2/src/DateHandler/_Date_fr.py index a87864846..2b5cab0de 100644 --- a/gramps2/src/DateHandler/_Date_fr.py +++ b/gramps2/src/DateHandler/_Date_fr.py @@ -38,8 +38,9 @@ import re # #------------------------------------------------------------------------- from RelLib import Date -from DateParser import DateParser -from DateDisplay import DateDisplay +from _DateParser import DateParser +from _DateDisplay import DateDisplay +from _DateHandler import register_datehandler #------------------------------------------------------------------------- # @@ -242,5 +243,5 @@ class DateDisplayFR(DateDisplay): # Register classes # #------------------------------------------------------------------------- -from DateHandler import register_datehandler -register_datehandler(('fr_FR','fr','french','fr_CA','fr_BE','fr_CH'),DateParserFR,DateDisplayFR) +register_datehandler(('fr_FR','fr','french','fr_CA','fr_BE','fr_CH'), + DateParserFR,DateDisplayFR) diff --git a/gramps2/src/DateHandler/_Date_lt.py b/gramps2/src/DateHandler/_Date_lt.py index 8f671defa..f23c27554 100644 --- a/gramps2/src/DateHandler/_Date_lt.py +++ b/gramps2/src/DateHandler/_Date_lt.py @@ -2,7 +2,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2004-2005 Donald N. Allingham +# Copyright (C) 2004-2006 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -37,9 +37,10 @@ import re # GRAMPS modules # #------------------------------------------------------------------------- -import Date -from DateParser import DateParser -from DateDisplay import DateDisplay +from RelLib import Date +from _DateParser import DateParser +from _DateDisplay import DateDisplay +from _DateHandler import register_datehandler #------------------------------------------------------------------------- # @@ -145,5 +146,4 @@ class DateDisplayLT(DateDisplay): # Register classes # #------------------------------------------------------------------------- -from DateHandler import register_datehandler register_datehandler(('lt_LT','lt','lithuanian'),DateParserLT, DateDisplayLT) diff --git a/gramps2/src/DateHandler/_Date_nl.py b/gramps2/src/DateHandler/_Date_nl.py index 114b5047a..d1946d306 100644 --- a/gramps2/src/DateHandler/_Date_nl.py +++ b/gramps2/src/DateHandler/_Date_nl.py @@ -44,8 +44,9 @@ import re # #------------------------------------------------------------------------- from RelLib import Date -from DateParser import DateParser -from DateDisplay import DateDisplay +from _DateParser import DateParser +from _DateDisplay import DateDisplay +from _DateHandler import register_datehandler #------------------------------------------------------------------------- # @@ -237,6 +238,5 @@ class DateDisplayNL(DateDisplay): # Register classes # #------------------------------------------------------------------------- -from DateHandler import register_datehandler register_datehandler(('nl_NL','dutch','nl_BE','nl'), DateParserNL, DateDisplayNL) diff --git a/gramps2/src/DateHandler/_Date_ru.py b/gramps2/src/DateHandler/_Date_ru.py index 4f5b5b78e..82fe3a25e 100644 --- a/gramps2/src/DateHandler/_Date_ru.py +++ b/gramps2/src/DateHandler/_Date_ru.py @@ -38,8 +38,9 @@ import re # #------------------------------------------------------------------------- from RelLib import Date -from DateParser import DateParser -from DateDisplay import DateDisplay +from _DateParser import DateParser +from _DateDisplay import DateDisplay +from _DateHandler import register_datehandler #------------------------------------------------------------------------- # @@ -167,5 +168,4 @@ class DateDisplayRU(DateDisplay): # Register classes # #------------------------------------------------------------------------- -from DateHandler import register_datehandler register_datehandler(('ru_RU','ru','russian'),DateParserRU, DateDisplayRU) diff --git a/gramps2/src/DateHandler/_Date_sv.py b/gramps2/src/DateHandler/_Date_sv.py index 04b1cdf19..ff8df7bce 100644 --- a/gramps2/src/DateHandler/_Date_sv.py +++ b/gramps2/src/DateHandler/_Date_sv.py @@ -38,8 +38,9 @@ import re # #------------------------------------------------------------------------- from RelLib import Date -from DateParser import DateParser -from DateDisplay import DateDisplay +from _DateParser import DateParser +from _DateDisplay import DateDisplay +from _DateHandler import register_datehandler #------------------------------------------------------------------------- # @@ -164,5 +165,4 @@ class DateDisplaySv(DateDisplay): # Register classes # #------------------------------------------------------------------------- -from DateHandler import register_datehandler register_datehandler(('sv_SE','sv','svensk'),DateParserSv, DateDisplaySv) diff --git a/gramps2/src/DateHandler/___init__.py b/gramps2/src/DateHandler/___init__.py new file mode 100644 index 000000000..288a2a93b --- /dev/null +++ b/gramps2/src/DateHandler/___init__.py @@ -0,0 +1,35 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2004-2006 Donald N. Allingham +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# $Id: __init__.py 6133 2006-03-11 01:12:06Z rshura $ + +""" +Class handling language-specific selection for date parser and displayer. +""" +import _Date_de +import _Date_es +import _Date_fi +import _Date_fr +import _Date_lt +import _Date_nl +import _Date_ru +import _Date_sv + +from _DateHandler import * diff --git a/gramps2/src/PluginUtils/_Plugins.py b/gramps2/src/PluginUtils/_Plugins.py index e5dfa1c4d..bbd5956a5 100644 --- a/gramps2/src/PluginUtils/_Plugins.py +++ b/gramps2/src/PluginUtils/_Plugins.py @@ -318,7 +318,7 @@ class PluginStatus(DisplayState.ManagedWindow): self.state = state self.uistate = uistate - self.glade = gtk.glade.XML(const.pluginsFile,"plugstat","gramps") + self.glade = gtk.glade.XML(const.plugins_glade,"plugstat","gramps") self.window = self.glade.get_widget("plugstat") self.window.set_title("%s - GRAMPS" % _('Plugin status')) window = self.glade.get_widget("text")