GEPS008: Re-structure Gramps locale files

svn: r19727
This commit is contained in:
Nick Hall 2012-05-31 15:50:40 +00:00
parent e2fc155240
commit 40ca28cd60
17 changed files with 41 additions and 40 deletions

View File

@ -110,6 +110,7 @@ src/gen/filters/rules/repository/Makefile
src/gen/filters/rules/note/Makefile
src/gen/filters/rules/citation/Makefile
src/gen/lib/Makefile
src/gen/locale/Makefile
src/gen/merge/Makefile
src/gen/mime/Makefile
src/gen/plug/Makefile
@ -135,7 +136,6 @@ src/gui/views/treemodels/Makefile
src/gui/widgets/Makefile
src/docgen/Makefile
src/Simple/Makefile
src/GrampsLocale/Makefile
src/plugins/Makefile
src/plugins/docgen/Makefile
src/plugins/drawreport/Makefile

View File

@ -407,6 +407,10 @@ src/gui/filters/sidebar/_mediasidebarfilter.py
src/gui/filters/sidebar/_reposidebarfilter.py
src/gui/filters/sidebar/_notesidebarfilter.py
# gui.logger package
src/gui/logger/_errorreportassistant.py
src/gui/logger/_errorview.py
# gui.merge package
src/gui/merge/mergecitation.py
src/gui/merge/mergeevent.py
@ -477,10 +481,6 @@ src/config.py
src/docgen/ODSTab.py
src/docgen/TextBufDoc.py
# GrampsLogger package
src/GrampsLogger/_ErrorReportAssistant.py
src/GrampsLogger/_ErrorView.py
# plugins directory
src/plugins/BookReport.py
src/plugins/bookreport.gpr.py

View File

@ -162,6 +162,10 @@ src/gen/lib/url.py
src/gen/lib/urlbase.py
src/gen/lib/witness.py
# gen.locale package
src/gen/locale/__init__.py
src/gen/locale/_grampslocale.py
# gen.merge package
src/gen/merge/__init__.py
src/gen/merge/test/merge_ref_test.py
@ -221,14 +225,6 @@ src/gen/utils/__init__.py
src/gen/utils/callback.py
src/gen/utils/callman.py
# GrampsLocale package
src/GrampsLocale/_GrampsLocale.py
# GrampsLogger package
src/GrampsLogger/__init__.py
src/GrampsLogger/_GtkHandler.py
src/GrampsLogger/_RotateHandler.py
# gui - GUI code
src/gui/__init__.py
src/gui/dbguielement.py
@ -268,6 +264,11 @@ src/gui/filters/_filtercombobox.py
src/gui/filters/_filtermenu.py
src/gui/filters/__init__.py
# gui.logger package
src/gui/logger/__init__.py
src/gui/logger/_gtkhandler.py
src/gui/logger/_rotatehandler.py
# gui.merge package
src/gui/merge/__init__.py

View File

@ -6,7 +6,6 @@ SUBDIRS = \
data \
docgen \
gen \
GrampsLocale \
gui \
images \
plugins \

View File

@ -49,7 +49,7 @@ LOG = logging.getLogger(".")
from gen.display.name import displayer as name_displayer
import gen.lib
import Errors
from GrampsLocale import codeset
from gen.locale import codeset
from Date import Date
import gen.datehandler

View File

@ -10,6 +10,7 @@ SUBDIRS = \
display \
filters \
lib \
locale \
merge \
mime \
plug \

View File

@ -26,5 +26,5 @@ The gen module provides packages that are common to all gramps
interfaces (gui, cli and web).
"""
__all__ = [ "datehandler", "db", "display", "filters", "lib", "merge", "mime",
"plug", "proxy", "utils" ]
__all__ = [ "datehandler", "db", "display", "filters", "lib", "locale", "merge",
"mime", "plug", "proxy", "utils" ]

View File

@ -270,8 +270,8 @@ class DateDisplayFR(DateDisplay):
# Replace the previous "Numérique" by a string which
# do have an explicit meaning: "System default (format)"
import GrampsLocale
_locale_tformat = GrampsLocale.tformat
import gen.locale
_locale_tformat = gen.locale.tformat
_locale_tformat = _locale_tformat.replace('%d', "J")
_locale_tformat = _locale_tformat.replace('%m', "M")
_locale_tformat = _locale_tformat.replace('%Y', "A")

View File

@ -39,7 +39,7 @@ log = logging.getLogger(".DateDisplay")
#
#-------------------------------------------------------------------------
from gen.lib import Date
import GrampsLocale
import gen.locale
#-------------------------------------------------------------------------
#
@ -57,7 +57,7 @@ class DateDisplay(object):
short_months = ( u"", u"Jan", u"Feb", u"Mar", u"Apr", u"May", u"Jun",
u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" )
_tformat = GrampsLocale.tformat
_tformat = gen.locale.tformat
hebrew = (
"", "Tishri", "Heshvan", "Kislev", "Tevet", "Shevat",

View File

@ -49,7 +49,7 @@ log = logging.getLogger(".DateParser")
#
#-------------------------------------------------------------------------
from gen.lib import Date, DateError
import GrampsLocale
import gen.locale
#-------------------------------------------------------------------------
#
@ -140,7 +140,7 @@ class DateParser(object):
'Sep' : 9, 'Oct' : 10, 'Nov' : 11, 'Dec' : 12,
}
month_to_int = GrampsLocale.month_to_int
month_to_int = gen.locale.month_to_int
# modifiers before the date
modifier_to_int = {
@ -272,7 +272,7 @@ class DateParser(object):
Date.CAL_SWEDISH : self._parse_swedish,
}
fmt = GrampsLocale.tformat
fmt = gen.locale.tformat
match = self._fmt_parse.match(fmt.lower())
if match:
self.dmy = (match.groups() == ('d', 'm', 'y') or \

View File

@ -1,24 +1,24 @@
# This is the src/GrampsLocale level Makefile for Gramps
# This is the src/gen/locale level Makefile for Gramps
# $Id$
# We could use GNU make's ':=' syntax for nice wildcard use,
# but that is not necessarily portable.
# If not using GNU make, then list all .py files individually
pkgpythondir = $(datadir)/@PACKAGE@/GrampsLocale
pkgpythondir = $(datadir)/@PACKAGE@/gen/locale
pkgpython_PYTHON = \
_GrampsLocale.py\
_grampslocale.py\
__init__.py
pkgpyexecdir = @pkgpyexecdir@/GrampsLocale
pkgpyexecdir = @pkgpyexecdir@/gen/locale
dist_pkgdata_DATA =
# Clean up all the byte-compiled files
MOSTLYCLEANFILES = *pyc *pyo
GRAMPS_PY_MODPATH = "../"
GRAMPS_PY_MODPATH = "../../"
pycheck:
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \

View File

@ -20,4 +20,4 @@
# $Id$
from _GrampsLocale import *
from _grampslocale import *

View File

@ -1,4 +1,4 @@
# This is the src/GrampsLogger level Makefile for Gramps
# This is the src/gui/logger level Makefile for Gramps
# $Id$
# We could use GNU make's ':=' syntax for nice wildcard use,
# but that is not necessarily portable.

View File

@ -50,7 +50,7 @@ from gen.plug.report import utils as ReportUtils
from gen.plug.report import MenuReportOptions
from Utils import probably_alive
from gen.datehandler import displayer as _dd
import GrampsLocale
import gen.locale
import gen.lib
import libholiday
@ -206,7 +206,7 @@ class Calendar(Report):
for day_col in range(7):
font_height = pt2cm(pdaynames.get_font().get_size())
self.doc.center_text("CAL-Daynames",
GrampsLocale.long_days[(day_col+
gen.locale.long_days[(day_col+
g2iso(self.start_dow + 1))
% 7 + 1].capitalize(),
day_col * cell_width + cell_width/2,
@ -447,7 +447,7 @@ class CalendarOptions(MenuReportOptions):
start_dow = EnumeratedListOption(_("First day of week"), 1)
for count in range(1, 8):
# conversion between gramps numbering (sun=1) and iso numbering (mon=1) of weekdays below
start_dow.add_item((count+5) % 7 + 1, GrampsLocale.long_days[count].capitalize())
start_dow.add_item((count+5) % 7 + 1, gen.locale.long_days[count].capitalize())
start_dow.set_help(_("Select the first day of the week for the calendar"))
add_option("start_dow", start_dow)

View File

@ -50,7 +50,7 @@ from gen.plug.report import Report
from gen.plug.report import utils as ReportUtils
from gen.plug.report import MenuReportOptions
from Utils import probably_alive
import GrampsLocale
import gen.locale
from gen.datehandler import displayer as _dd
import libholiday
@ -399,7 +399,7 @@ class CalendarOptions(MenuReportOptions):
start_dow = EnumeratedListOption(_("First day of week"), 1)
for count in range(1, 8):
# conversion between gramps numbering (sun=1) and iso numbering (mon=1) of weekdays below
start_dow.add_item((count+5) % 7 + 1, GrampsLocale.long_days[count].capitalize())
start_dow.add_item((count+5) % 7 + 1, gen.locale.long_days[count].capitalize())
start_dow.set_help(_("Select the first day of the week for the calendar"))
menu.add_option(category_name, "start_dow", start_dow)

View File

@ -58,7 +58,7 @@ from gen.plug.report import MenuReportOptions
from gen.plug.menu import BooleanOption, NumberOption, StringOption, \
EnumeratedListOption, FilterOption, PersonOption, \
DestinationOption, NoteOption
import GrampsLocale
import gen.locale
from Utils import probably_alive, xml_lang, get_researcher
from gen.datehandler import displayer as _dd
@ -605,9 +605,9 @@ class WebCalReport(Report):
day = col2day[col]
return day_names[day]
# Note. GrampsLocale has sunday => 1, monday => 2, etc
# Note. gen.locale has sunday => 1, monday => 2, etc
# We slice out the first empty element.
day_names = GrampsLocale.long_days
day_names = gen.locale.long_days
def __get_previous_month_day(year, month, day_col):
@ -1417,7 +1417,7 @@ class WebCalOptions(MenuReportOptions):
# Default selection ????
start_dow = EnumeratedListOption(_("First day of week"), 1)
for count in range(1, 8):
start_dow.add_item(count, GrampsLocale.long_days[count].capitalize())
start_dow.add_item(count, gen.locale.long_days[count].capitalize())
start_dow.set_help(_("Select the first day of the week for the calendar"))
menu.add_option(category_name, "start_dow", start_dow)