Compare commits

..

173 Commits

Author SHA1 Message Date
Jérôme Rapinat
80db60b332 check gettext syntax complains about missing '\n'
svn: r21566
2013-03-06 08:28:01 +00:00
Jérôme Rapinat
c06e8d3b64 update on translations
svn: r21565
2013-03-06 08:18:51 +00:00
Jérôme Rapinat
c19c5e2569 Bump alpha-version to 5
svn: r21564
2013-03-06 08:05:12 +00:00
John Ralls
992b161798 [r21561]get_unicode_path_from_env_var(): make no-op if it's already unicode
svn: r21563
2013-03-06 01:12:07 +00:00
John Ralls
2dee2c4d77 [r21560]Adapt HTMLRenderer NavigationView init args to new signature
svn: r21562
2013-03-06 01:11:59 +00:00
Helge Herz
96440156bd GEexiv2 vor Python 2.7.3 and Win (see 6464)
svn: r21558
2013-03-05 21:55:49 +00:00
Espen Berg
588089954a Some small revision of Norwegian bokmål language file for gramps40
svn: r21556
2013-03-05 19:37:45 +00:00
John Ralls
7e749a9e25 [r21554]GrampsLocale:Move setlocale from _set_from_environment to
__init_first_instance

So that encoding is set for Mac as well.

svn: r21555
2013-03-05 17:26:00 +00:00
Paul Franklin
3e0fd433b5 shorten the report name for easier CLI use
svn: r21553
2013-03-05 04:46:22 +00:00
Paul Franklin
8a4732a5d2 tweak the default format for the report
svn: r21550
2013-03-05 01:02:54 +00:00
Mirko Leonhäuser
8371684a98 updated german translation
svn: r21549
2013-03-04 18:36:58 +00:00
Paul Franklin
2828211c6a 6494: svn_revision module ignores translated SVN stdout value for "exported"
svn: r21547
2013-03-04 05:12:53 +00:00
Paul Franklin
bf67b3e114 skip error msg if no file exists
svn: r21545
2013-03-04 00:42:39 +00:00
John Ralls
d01f7bf7df [r21540]GrampsLocale: Add _win_bindtextdomain
Adapted from init_windows_gettext in Gramps3.
Libintl-8.dll must be on the path, just like all of the other C-library
dependencies.

svn: r21543
2013-03-03 23:59:44 +00:00
John Ralls
1d2b143be9 [r21539]GrampsLocale: Restore setlocale, add GrampsLocale.encoding
encoding to replace translation().info()['encoding'] which isn't
the encoding we're looking for.

svn: r21542
2013-03-03 23:59:39 +00:00
John Ralls
debf8b601a [r21538]Win32:Apply \\ escape to all const paths
svn: r21541
2013-03-03 23:59:32 +00:00
Mirko Leonhäuser
bcef9fc868 updated german translation
svn: r21537
2013-03-03 12:12:37 +00:00
Serge Noiraud
fae194d1a0 Geography : #05742 note 27613 : cairo arguments differ from gtk2 draw arc.
svn: r21535
2013-03-03 10:58:30 +00:00
Jérôme Rapinat
7aa1c2bbde update Portuguese (Europe) translation by Frederico Muñoz
svn: r21532
2013-03-03 09:05:26 +00:00
Paul Franklin
2528da2f2d add ICU/PyICU to "gramps -v"
svn: r21530
2013-03-03 03:19:37 +00:00
Josip Pisoj
8ea29ede81 win32 fix
svn: r21529
2013-03-03 00:08:15 +00:00
John Ralls
4ca0c9f8c9 [r21526]GrampsLocale: Create GrampsTranslation attribute for language
Rather than relying on translators to correctly fill out po files

svn: r21528
2013-03-02 20:28:57 +00:00
John Ralls
5a8a7479dd [r21525]GrampsLocale: Fix glocale without import
svn: r21527
2013-03-02 20:28:49 +00:00
Tim G L Lyons
c3f39e7d40 0005058: Note reference on Attribute for individual is not filtered on Export. Fixed many other note references that are not filtered out.
svn: r21523
2013-03-02 19:30:02 +00:00
Paul Franklin
5235a6a6ac add "Id" property
svn: r21521
2013-03-02 15:52:57 +00:00
Jérôme Rapinat
62475bbc87 6500: relative import
svn: r21520
2013-03-02 14:56:13 +00:00
Jérôme Rapinat
a33eb1d799 6500: missing glocale
svn: r21519
2013-03-02 14:54:29 +00:00
Peter Landgren
6e73fc8924 Better translation for compare events.
svn: r21517
2013-03-02 13:45:02 +00:00
Helge Herz
06b8b291f8 adaption for python version less 3.x (see issue 6465) for details
svn: r21515
2013-03-02 13:42:17 +00:00
Tim G L Lyons
98fa69b717 0003428: When running with pythonw.exe, Windows may crash if you write to stdout. Some more print statements changed to log.warning.
svn: r21511
2013-03-01 13:12:29 +00:00
Tim G L Lyons
7c9ec32d22 Narrative Web: Fix alphabetic navigation bar and sorting in index pages using PyICU where available. Implements most collate contractions for western languages Gramps has been translated into. This fixes the following bugs:
0002933: Problems in Narrative Web Report with surnames beginning with V or W. Use collation primary difference to define index groupings. Special case for 'V' and 'W' in Swedish removed because the default CLDR has a primary difference between them.

0003434: NarrativeWeb new alphabet index sorted incorrectly. Fix Cyrillic sort order, and contractions for Slovak and Czech (among other languages).

0003933: References inside pages in NarWeb report and non-ascii characters. Sorting issues for Polish characters.

0004423: Web report does not handle Czech "CH" character properly. Dz contraction is not present in the CLDR. Slovak is similar.

0005088: Narrated Web Site Report sort order different Windows vs Linux. Resolved by using PyICU (if available).

0005645: can't sort greek names

0005767: Sorting in Narrative Webb does not work correctly. Fix sorting in Individuals, Surnames, Families, Events and Places to use PyICU (if available). This bug covers sorting in the index header (as well as in the body of the index pages).

svn: r21508
2013-03-01 12:41:19 +00:00
John Ralls
e1fb1c5b14 [r21501]RelationshipCalculator: Promote no translation message to warning
And make it more specific.
Thanks to Tim Lyons.

svn: r21505
2013-02-28 20:09:18 +00:00
Serge Noiraud
7541dd5b2e Bug #06459 : change the lock strategy and split transactions in Merge citation.
svn: r21504
2013-02-28 19:57:35 +00:00
John Ralls
e8bad4d4c8 [r21492]grampletpane: Fix typo, naked except.
Warn with the reason when Dashboard file can't be opened or parsed.

svn: r21500
2013-02-28 19:23:15 +00:00
John Ralls
d704d9ac4b [r21491]MacLocale: Handle AppleCollationOrder returning "root"
svn: r21499
2013-02-28 19:23:04 +00:00
John Ralls
d334e0043f [r21490]MacLocale: Allow $LANG to override defaults settings
For currency, calendar, and collation

svn: r21498
2013-02-28 19:22:55 +00:00
John Ralls
dede164e69 [r21489]GrampsLocale: Handle errors in getting collation key from locale module
svn: r21497
2013-02-28 19:22:43 +00:00
John Ralls
f309f210d1 [r21488]GrampsLocale: Restore call to locale.bindtextdomain() for GtkBuilder
Apparently some Linuxes require it for GtkBuilder to find the localization files. It's not supported on Win32, though, so don't try in that case.

svn: r21496
2013-02-28 19:22:35 +00:00
John Ralls
ebe1d0139c [r21487]GrampsLocale: Set collation, currency, and calendar to lang
only on secondary locale objects.

svn: r21495
2013-02-28 19:22:27 +00:00
John Ralls
ebcd0bb119 [r21486]GrampsLocale: Use absolute address for importing grampslocale
so that it works from outside of Gramps itself, in particular gramps-addons/contrib/make.py

svn: r21494
2013-02-28 19:22:21 +00:00
John Ralls
fc8eb4f445 [r21485]GrampsLocale: Fix get_addon_translator path
Add the locale subdirectory.
Also clean out some cruft left over from the old implementation.

svn: r21493
2013-02-28 19:22:14 +00:00
Nick Hall
3ae8e5cc1e 6408: Restore warning message for missing GExiv2 module
svn: r21484
2013-02-28 15:05:03 +00:00
Jérôme Rapinat
a03877e8c9 update Portuguese (Europe) translation by Frederico Muñoz
svn: r21481
2013-02-28 10:20:48 +00:00
Helge Herz
357eb8af19 Python less 3.x uses GdkPixbuf.new_subpixbuf instead dkPixbuf.subpixbuf issue 6487
svn: r21476
2013-02-27 22:21:10 +00:00
Paul Franklin
c91eec3d5f rename .__next__ (formerly .next) as it is "NOT an iterator"
svn: r21475
2013-02-27 18:50:47 +00:00
Jérôme Rapinat
870f80fc83 6385: Three minor grammar issues
svn: r21473
2013-02-27 14:35:10 +00:00
Jérôme Rapinat
3ee5b1dec4 "Delete" label instead of "Remove" on Gtk button
svn: r21472
2013-02-27 14:29:32 +00:00
Jérôme Rapinat
c37bfc9dbe 6385: Three minor grammar issues
svn: r21471
2013-02-27 14:19:30 +00:00
Jérôme Rapinat
bb494a56ca update template and french translation
svn: r21470
2013-02-27 13:39:46 +00:00
Erik De Richter
4a512c7347 updated nl translation
svn: r21469
2013-02-27 10:48:15 +00:00
Paul Franklin
e6034cde4b behave gracefully if no GExiv2 under Python3
svn: r21467
2013-02-26 20:36:18 +00:00
Mirko Leonhäuser
5e9837d484 updated german translation
svn: r21466
2013-02-26 19:05:14 +00:00
Tim G L Lyons
57fcc67498 Fix retrieval of version metadata for python3 Gramps.py -L, reverting inadvertent changes in revision 21463
svn: r21465
2013-02-26 18:44:07 +00:00
Tim G L Lyons
3872899ebc Fix retrieval of version metadata for python3 Gramps.py -L
svn: r21463
2013-02-26 17:34:37 +00:00
Tim G L Lyons
ad20c91b4f Fix type error in "python3 Gramps.py -L"
svn: r21462
2013-02-26 17:28:41 +00:00
Paul Franklin
5df0c7d3ee 6409 and 6447 Python3 changes (possibly not done yet)
svn: r21460
2013-02-26 17:18:23 +00:00
Tim G L Lyons
daae9242bf 0006410: Webcal report crashes and freezes alpha4. For python3 simply opening the file works.
svn: r21457
2013-02-26 17:14:28 +00:00
John Ralls
114a71c13c [r21451]GrampsLocale: Remove all calls to locale.setlocale and locale.bindtextdomain
svn: r21456
2013-02-26 00:24:13 +00:00
John Ralls
7d7cc6f789 [r21450]Addons: Check for two-letter lang as well as 5-char locale
E.g, check fr as well as fr_FR

svn: r21455
2013-02-26 00:23:44 +00:00
John Ralls
b99e2e29df [r21449]grampletpane: Replace diagnostic prints with log warnings.
And improve warning when unable to save the Dashboard layout.

svn: r21454
2013-02-26 00:23:31 +00:00
John Ralls
44f065eabf [r21448]grampletpane: Use __future__.unicode_literals instead of cuni()
And get rid of the silly NL = "\n"

svn: r21453
2013-02-26 00:23:21 +00:00
John Ralls
b126aa1fc3 [r21447]ConfigManager: Ensure key files are loaded and saved as utf-8
svn: r21452
2013-02-26 00:23:10 +00:00
Paul Franklin
e2860c99f6 Python3 changes: __next__ and future division (which is not done yet)
svn: r21445
2013-02-25 18:52:10 +00:00
Paul Franklin
6cd609941f slightly reformat error message
svn: r21444
2013-02-25 16:13:03 +00:00
Jérôme Rapinat
4a23da9500 quick test and update on the french translation
svn: r21442
2013-02-25 14:02:33 +00:00
Jérôme Rapinat
73cdf3d86f update template
svn: r21441
2013-02-25 13:45:25 +00:00
Jérôme Rapinat
d24586eb34 update translation strings index
svn: r21440
2013-02-25 13:39:56 +00:00
Jérôme Rapinat
158a5f93fb 6283: Re-enable optimization flag (-O) for python
svn: r21439
2013-02-25 07:26:36 +00:00
John Ralls
7ff24aa9d1 [r21436]Work around lack of locale.LC_MESSAGES on some Windows pythons
svn: r21437
2013-02-24 17:41:31 +00:00
John Ralls
bb2bcc4185 Fix missed cuni() in save.
svn: r21434
2013-02-24 16:42:58 +00:00
Peter Landgren
c8254b1c68 Fixed a typo, two " was missing.
svn: r21432
2013-02-24 15:27:54 +00:00
Nick Hall
8d06298921 6408: python3 fix
svn: r21431
2013-02-24 13:53:15 +00:00
Paul Franklin
4621970783 revert to the old report name
svn: r21428
2013-02-24 08:39:51 +00:00
Paul Franklin
123a6e0ecf sync gramps40 to trunk (two places)
svn: r21426
2013-02-24 06:06:42 +00:00
John Ralls
3d0fa7a00a Fix Py2 file encoding errors
svn: r21424
2013-02-24 01:49:24 +00:00
John Ralls
400523c7f3 [r21326] GrampsLocale: Correct setting GrampsLocale.languages
Test only first 5 or first 2 characters of the language id against the
list of available translations.

Thanks to Tim Lyons for exposing the error.

svn: r21423
2013-02-24 01:49:15 +00:00
John Ralls
0bbbc76852 [r21287] GrampsLocale: Allow for importing older PyICU packages
svn: r21422
2013-02-24 01:49:07 +00:00
John Ralls
252d2932df [r21282]GrampsLocale: Fix creation of second GrampsLocale
svn: r21421
2013-02-24 01:49:01 +00:00
John Ralls
bffb6767aa [r21281] grampslocale: Pretty up the log messages.
svn: r21420
2013-02-24 01:48:42 +00:00
John Ralls
0c07855f37 [r21280]grampslocale.py: Protect against C.UTF-8 not being installed
svn: r21419
2013-02-24 01:48:29 +00:00
John Ralls
088c97106f [r21279]relationship.py: Fix not registering "en_GB" as english.
Also replace diagnostic print with proper logging.

svn: r21418
2013-02-24 01:48:24 +00:00
John Ralls
bfa28faf55 [r21276]Handle junk at the end of revision strings
svn: r21417
2013-02-24 01:48:16 +00:00
John Ralls
8222d4c04c [r21275]GrampsLocale: Replace locale functions
locale.strcoll, locale.strxfrm, and conv*_tosrtkey

With GrampsLocale.sort_key (for strxfrm and conv*_tosrtkey) and
GrampsLocale.strcoll.

If ICU is available will use the correct ICU::Collator for the locale,
otherwise falls back to locale.strxfrm -- for which it temporarily
changes the LC_COLLATE locale.

svn: r21416
2013-02-24 00:55:46 +00:00
John Ralls
879c48f57d [r21274]GrampsLocale: Introduce new GrampsLocale attributes
currency, calendar, and collate

svn: r21415
2013-02-24 00:55:32 +00:00
John Ralls
7127f8f2da [r21273] GrampsLocale: Directly set glocale attributes
... in maclocale.mac_setup_localization()

svn: r21414
2013-02-24 00:55:23 +00:00
John Ralls
db9daced3c [r21272]GrampsLocale: Extract function __init_from_environment
svn: r21413
2013-02-24 00:55:13 +00:00
John Ralls
c42cb6beee [r21271] Add modules for ICU
svn: r21412
2013-02-24 00:55:06 +00:00
John Ralls
efa53a0537 [r21236]GrampsLocale: Replace use of get_language_string
... with GrampsLocale.get_language_dict

Permits sorting by localized language name.
Also hides the language code, which the user doesn't really care about.
Removes get_language_string from libtranslate.py, no longer needed.

svn: r21411
2013-02-24 00:54:56 +00:00
John Ralls
bbf16cb40c [r21235]GrampsLocale: Use module-specific logger for grampslocale.py
Fixes double-logging problem reported by Tim Lyons.

svn: r21410
2013-02-24 00:54:40 +00:00
John Ralls
d62ff6059e [r21182]GrampsLocale: Restructure so for multiple GrampsLocale objects
Only the first dependent upon the environment. All may be created with
parameters which override environment variables or OS settings. See the
GrampsLocale docstring for details.

svn: r21409
2013-02-24 00:54:35 +00:00
John Ralls
f3361500c0 [r21181]relationship.py: Remove unused import
svn: r21408
2013-02-24 00:54:26 +00:00
John Ralls
df1157e9d4 [r21180]Fix platform detection on OSX
'darwin' is returned by sys.platform, not os.name.

svn: r21407
2013-02-24 00:54:18 +00:00
John Ralls
11ad512f2d [r21179]Fix undefined variable reference, make separate not-loaded
warning

Thanks to Pat Lefebre for reporting the error.

svn: r21406
2013-02-24 00:54:04 +00:00
John Ralls
fd559d0d80 [r21170]GrampsLocale: Convert some late-added translations to
GRAMPS_LOCALE

svn: r21405
2013-02-24 00:53:58 +00:00
John Ralls
7a894d9a41 [r21168]GrampsLocale: get_relationship_calculator: Fix missed variable
name change.

svn: r21404
2013-02-24 00:53:47 +00:00
John Ralls
b6b3fb8680 [r21156]Descendant Report: Fix changed Sort function name
svn: r21403
2013-02-24 00:53:37 +00:00
John Ralls
755b653925 [r21154]Import get_svn_revision into const.py
via const.py.in, of course

svn: r21402
2013-02-24 00:53:29 +00:00
John Ralls
592f68ab6e [r21153]PdfDocGen: Report cause of failure on all exceptions
not just file open ones. Expat can raise exceptions too!

svn: r21401
2013-02-24 00:53:20 +00:00
John Ralls
0986d69429 [r21152]GrampsLocale: Fix file encoding error in recentfiles
Expat wants a binary file, not a string file.

svn: r21400
2013-02-24 00:53:11 +00:00
John Ralls
98898ddb71 [r21151]GrampsLocale: Get the language code from the global translation
Instead of probing locale.getlocale() and environment variables

svn: r21399
2013-02-24 00:52:59 +00:00
John Ralls
8cbba85cf1 [r21150]GrampsLocale: Use the codeset from the singleton translation
Instead of locale.getlocale() or locale.nl_langinfo

svn: r21398
2013-02-24 00:52:48 +00:00
John Ralls
c01846fb84 [r21149]Fix some file resource leaks
I.e., files left open when the opening function exits. This is
a PyDebug warning.

svn: r21397
2013-02-24 00:52:35 +00:00
John Ralls
fccfdecd03 [r21148]GrampsLocale: Simplify the file-finding functions
Making use of the fact that GrampsLocale now knows what
encoding to use, and noting that filesystems don't use
more than one encoding to write filenames in directories.

Also specify the encoding on some more files

svn: r21396
2013-02-24 00:52:26 +00:00
John Ralls
3f408af0fa [r21147][Bug 6364] Fix file-opening failures due to unicode content.
svn: r21395
2013-02-24 00:52:07 +00:00
John Ralls
8cea2e239a [r21146]GrampsLocale: Replace calls to sys.getfilesystemencoding
On MSWin and OSX, this call always returns the correct
value (utf-8 on OSX, 'mbcs' on MSWin), but on Linux the
return value is bizarrely dependent upon the environment.

Replace it with a GrampsLocale function which returns 'utf-8'
(the correct value for most Linux file systems) regardless of
the environment.

Also replace its use in print and write functions: It's the
encoding of paths in the filesystem, not of the files's content,
nor of the terminal's capabilities. The former is almost
always utf-8 as long as we write the file, the latter is
given by sys.stdout.encoding. Use the 'backslashreplace' error
handler to avoid exceptions when we need to output unicode
text to an ASCII terminal.

svn: r21394
2013-02-24 00:51:57 +00:00
John Ralls
221c30976f [r21145][Bug 6222]: Get the addons language list from the primary
GrampsLocale instance.

svn: r21393
2013-02-24 00:51:38 +00:00
John Ralls
e28e114c95 [r21144]GrampsLocale: Remove ggettext
svn: r21392
2013-02-24 00:51:17 +00:00
John Ralls
3788d52107 [r21143]Localization: Re-implement localization as a class, GrampsLocale
GrampsLocale is effectively a singleton: An instance is created in
const.py and retrieved everywhere.

Translations are provided via Translations classes, which are derived
from GNUTranslations and NullTranslations to provide extra functions
like sgettext.

svn: r21391
2013-02-24 00:46:03 +00:00
John Ralls
740c7036d7 [r21142]Rename trans.py and mactrans.py to grampslocale.py and
maclocale.py

Reflecting discussion on gramps-devel about their affecting more than
just translations.

Provide for a master GrampsLocale instance to be retrieved from
const.py, set by grampsapp.

svn: r21390
2013-02-24 00:45:50 +00:00
Nick Hall
eeaf8697f0 6408: Display GExiv2 version rather than pyexiv2 version
svn: r21389
2013-02-23 23:36:23 +00:00
Nick Hall
3fabbe1ecb 6408: Convert Metadata Viewer from pyexiv2 to GExiv2. Move Edit Exif Metadata gramplet into gramps-addons.
svn: r21387
2013-02-23 21:11:29 +00:00
Helge Herz
d10d572002 see issue 0006464
svn: r21384
2013-02-23 12:42:24 +00:00
John Ralls
3d0fa69bd0 ImportGedcom: Fix Python3 "dictionary changed size during iteration" errors
svn: r21380
2013-02-19 22:11:35 +00:00
John Ralls
a84d51d6b7 Import ProGen: Use python3 print syntax
svn: r21379
2013-02-19 22:11:29 +00:00
John Ralls
88831f8398 Fix Py2 TypeError in GEDCOM export
Due to writing regular strings instead of unicode strings.

svn: r21378
2013-02-19 22:11:21 +00:00
Paul Franklin
945bec0d6c basedocclass==>docclass to match the 20695 changes
svn: r21373
2013-02-19 19:18:59 +00:00
Serge Noiraud
dfb6be488d Geography : print suppression
svn: r21371
2013-02-18 19:57:11 +00:00
Serge Noiraud
22bcc94ec0 Geography : bug #06451 note 27413 : the ellipse become a line when it is too small
svn: r21369
2013-02-18 19:40:16 +00:00
Serge Noiraud
d02f6a3fb1 Geography : bug #06466 : History change when clicking on one marker
bug #06451 : incomplete precedent patch


svn: r21367
2013-02-17 12:46:13 +00:00
Nick Hall
76eae75da2 Make availability of GraphViz settings depend on output format
svn: r21366
2013-02-16 21:37:07 +00:00
Serge Noiraud
657d8e233f Geography : bug #06451 : Don't see chinese characters in the geography view.
svn: r21363
2013-02-16 13:33:10 +00:00
Nick Hall
5bb9581b15 Improve the descriptions and tooltip for GraphViz aspect ratio option
svn: r21361
2013-02-15 19:44:00 +00:00
Peter Landgren
d6c4298ff4 Fixed a typo.
svn: r21360
2013-02-15 08:46:02 +00:00
Paul Franklin
260170ce36 6448: Text Reports>Descendant Report gives an AttributeError: 'Sort' object has no attribute by_birthdate
svn: r21358
2013-02-14 23:42:02 +00:00
John Ralls
801f1b77aa [Bug 6413] Fix importing ProGen files
This isn't a perfect fix because it requires that the ProGen file is
encoded with CP437, which is guaranteed only in Version 3.21 and later.

svn: r21354
2013-02-14 18:36:07 +00:00
Mirko Leonhäuser
d5dfa05ff9 updated german translation
svn: r21353
2013-02-13 22:35:21 +00:00
Paul Franklin
808002d419 6247: Crash when attempting to use Book Report
svn: r21352
2013-02-13 18:47:44 +00:00
Serge Noiraud
4dc0f01137 Geography : bug #6442 use the good glib with introspection.
svn: r21348
2013-02-13 13:39:58 +00:00
Tim G L Lyons
aa7e0b49e4 Reinstate inadvertent removal of rev 19988 change for bug 5900
svn: r21347
2013-02-13 11:08:52 +00:00
Peter Landgren
3c103143a6 Fixed a typo.
svn: r21345
2013-02-12 15:44:05 +00:00
Serge Noiraud
ef65c893ea Geography : replace GObject.timeout_add by glib.timeout_add as it is deprecated
svn: r21342
2013-02-12 08:38:19 +00:00
Erik De Richter
566c3fb32b updated nl translation
svn: r21339
2013-02-11 20:01:57 +00:00
Josip Pisoj
db1bd1e114 win32_py3: open use system encoding
svn: r21338
2013-02-10 22:52:19 +00:00
Paul Franklin
866796f5dc 6379: Can not get ancestry or relationship tabs to work
svn: r21336
2013-02-10 21:11:37 +00:00
Erik De Richter
fdf740b35c updated nl translation
svn: r21334
2013-02-10 19:29:32 +00:00
Josip Pisoj
1500556d99 win32 changes
svn: r21330
2013-02-10 17:37:56 +00:00
Helge Herz
5e4b2d3bdc Revert svn21254 as discussed in issue 6424
svn: r21328
2013-02-10 14:32:43 +00:00
Tim G L Lyons
880e6c44e7 Revert change 21304 for moving report_options file
svn: r21323
2013-02-08 17:09:50 +00:00
Serge Noiraud
4068bebb3e Geography : synchronize gramps and osm-gps-map for the free maps.
svn: r21319
2013-02-08 07:39:59 +00:00
Serge Noiraud
0465b9cf37 Geography : sometimes crash with unknown people or family.
svn: r21318
2013-02-07 23:25:46 +00:00
Josip Pisoj
fed5cc6a71 win32-py3 fix:ValueError: strftime() requires year in [1; 9999]
svn: r21317
2013-02-07 21:43:19 +00:00
Josip Pisoj
69800680a3 adapt setup script for win32
svn: r21316
2013-02-07 21:41:02 +00:00
Tim G L Lyons
a3a758fd13 0006411: Navweb crashes alpha4 when creating Media pages
svn: r21314
2013-02-07 16:42:16 +00:00
Benny Malengier
eadae6dbc9 use latest gtkspell if available
svn: r21308
2013-02-06 09:24:12 +00:00
Tim G L Lyons
3ee843917e 0003968: [NarWeb] Save/Restore settings for Narrated Website Generation. Change report_options file to be in the database directory, and implement different default report file and directory names based on the Family Tree Name. N.B. On upgrading, if you want to preserve your report_options, copy the report_option.xml file from the .gramps directory to the applicable .gramps.grampsdb.<number> directory. Also don't forget that the default options are to EXCLUDE private and living data.
svn: r21305
2013-02-05 18:07:03 +00:00
Tim G L Lyons
43c49238f5 Fix processing of contractions, and changes to ensure code (after initial lines) for narrativeweb is the same for trunk and gramps34 and gramps40. Also change default name of output directory (see bug 3968) and use website-directory configuration item.
svn: r21303
2013-02-05 18:00:09 +00:00
Peter Landgren
641155478f Fix of gramps -v for Graphviz and ghostscript.
svn: r21302
2013-02-05 15:18:59 +00:00
Tim G L Lyons
6ca692e33a 0006397: Navweb crashes alpha4. date.get_start_date has no attribute 'is_valid'
svn: r21300
2013-02-05 12:17:59 +00:00
Gary Burton
41fdca39dd Bug #6358. gc.DEBUG_OBJECTS removed from python3. Also handle exceptions due to collected weak references.
svn: r21299
2013-02-04 22:01:19 +00:00
Tim G L Lyons
bb3ac61359 Change format of console logging messages to have a meaningful timestamp
svn: r21297
2013-02-04 19:15:45 +00:00
John Ralls
a00a5ba32d [r21155]Use IMAGE_DIR in geography.py so that map images can be found
when running from source directory.

svn: r21288
2013-02-04 02:15:55 +00:00
Gary Burton
efdb6e9fd5 Fix memory leaks.
svn: r21284
2013-02-03 16:25:03 +00:00
Erik De Richter
ff12fdc4a3 updated nl translation
svn: r21277
2013-02-02 07:57:33 +00:00
Tim G L Lyons
3ef8a88a11 export file select dialogue does not correctly reject empty filenames - two (probably long standing) coding errors: use of method name 'strip' instead of calling it, and does not isolate the filename from the full pathname
svn: r21269
2013-02-01 17:40:47 +00:00
Peter Landgren
117b5b6594 Updated translation.
svn: r21266
2013-02-01 09:24:29 +00:00
Nick Hall
6a5a78eee0 Fix for --install-scripts option and new --server option
svn: r21264
2013-01-31 22:41:10 +00:00
Jérôme Rapinat
ba28adea94 6367: Update the Side/Bottombar text (patch by Patsyblefebre)
svn: r21259
2013-01-31 08:28:03 +00:00
John Ralls
17f938c978 Revert "[r21246]Allow hard-coded paths to be overridden with $XDG_DATA_DIRS"
This reverts r21247

svn: r21256
2013-01-30 14:51:52 +00:00
Benny Malengier
54034d4811 gdkpixbuf support on windows
svn: r21254
2013-01-30 10:05:06 +00:00
Erik De Richter
45fc795964 updated dutch translation
svn: r21252
2013-01-30 09:36:27 +00:00
Jérôme Rapinat
0d9884186a 6384: Update Danish translation by Lars Kristian Lundin
svn: r21250
2013-01-30 09:31:14 +00:00
Erik De Richter
e593d753ee updated nl translation
svn: r21248
2013-01-30 08:57:31 +00:00
John Ralls
2cd6aa43e4 [r21246]Allow hard-coded paths to be overridden with $XDG_DATA_DIRS
Necessary for post-installation relocatability.
Also ensure that data installed to share/gramps is in mac bundle.

svn: r21247
2013-01-29 21:14:15 +00:00
Jérôme Rapinat
7c82a5df48 typo
svn: r21244
2013-01-29 15:08:54 +00:00
Jérôme Rapinat
23baca2f09 6377: Danish translation is incomplete (patch by Lars Kristian Lundin)
svn: r21241
2013-01-29 08:47:52 +00:00
Jérôme Rapinat
02fd2409c5 6377: Danish translation is incomplete
svn: r21238
2013-01-28 16:10:30 +00:00
John Ralls
3b4496a808 [r21157]Fix GeoGraphyView.__init__ arg list for simplified bookmarks
svn: r21234
2013-01-27 20:00:42 +00:00
John Ralls
235a1e72fd Mac: Update (and correct) Info.plist for alpha4
svn: r21233
2013-01-27 19:33:13 +00:00
John Ralls
1af985dbc7 Mac: Bump alpha-version to 4
svn: r21232
2013-01-27 17:48:19 +00:00
Jérôme Rapinat
378f24272c behavior has changed on gramplet bars, message needs an update too
svn: r21230
2013-01-27 16:50:13 +00:00
Jérôme Rapinat
6bc5bcf644 re-enable svn revision, alpha4 release has last bug fix for 6371 and fixed translations
svn: r21228
2013-01-26 09:47:46 +00:00
Jérôme Rapinat
efbd0e95dd mismatching
svn: r21227
2013-01-26 09:36:37 +00:00
Gary Burton
45a6524247 Bug #6371. Fix memory leak caused by hanging reference to progress meter callback method.
svn: r21224
2013-01-26 09:28:28 +00:00
680 changed files with 85295 additions and 91138 deletions

View File

@@ -1,4 +1,4 @@
"UNSTABLE Gramps 4.0.0 Alpha4 release.
"UNSTABLE Gramps 4.0.0 Alpha5 release.
This is a technology preview to allow plugin writers and packagers-installer
writers to update their plugins and scripts. This release is not production

View File

@@ -52,11 +52,11 @@ SPHINXBUILD = 'sphinx-build'
if sys.platform == 'win32':
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
elif sys.platform == 'linux2' or os.name == 'darwin':
elif sys.platform in ['linux2', 'darwin', 'cygwin']:
pythonCmd = os.path.join(sys.prefix, 'bin', 'python')
sphinxCmd = SPHINXBUILD
else:
print ("ERROR: unknown system, don't know sphinx, ... commands")
print ("Update Man ERROR: unknown system, don't know sphinx, ... commands")
sys.exit(0)
def tests():

View File

@@ -42,11 +42,11 @@ SPHINXBUILD = 'sphinx-build'
if sys.platform == 'win32':
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
elif sys.platform == 'linux2' or os.name == 'darwin':
elif sys.platform in ['linux2', 'darwin', 'cygwin']:
pythonCmd = os.path.join(sys.prefix, 'bin', 'python')
sphinxCmd = SPHINXBUILD
else:
print ("ERROR: unknown system, don't know sphinx, ... commands")
print ("Update Docs ERROR: unknown system, don't know sphinx, ... commands")
sys.exit(0)
def tests():

View File

@@ -39,7 +39,8 @@ Module responsible for handling the command line arguments for GRAMPS.
from __future__ import print_function
import os
import sys
from gramps.gen.ggettext import gettext as _
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -185,9 +186,9 @@ class ArgHandler(object):
else:
# Need to convert to system file encoding before printing
# For non latin characters in path/file/user names
print(msg1.encode(sys.getfilesystemencoding()), file=sys.stderr)
print(msg1.encode(sys.stdout.encoding, 'backslashreplace'), file=sys.stderr)
if msg2 is not None:
print(msg2.encode(sys.getfilesystemencoding()), file=sys.stderr)
print(msg2.encode(sys.stdout.encoding, 'backslashreplace'), file=sys.stderr)
#-------------------------------------------------------------------------
# Argument parser: sorts out given arguments
@@ -294,7 +295,7 @@ class ArgHandler(object):
else:
ask = input
ans = ask(_('OK to overwrite? (yes/no) ') \
.encode(sys.getfilesystemencoding()))
.encode(sys.stdout.encoding, 'backslashreplace'))
except EOFError:
print()
sys.exit(0)
@@ -408,26 +409,26 @@ class ArgHandler(object):
if self.list:
print(_('List of known family trees in your database path\n').\
encode(sys.getfilesystemencoding()))
encode(sys.stdout.encoding, 'backslashreplace'))
for name, dirname in sorted(self.dbman.family_tree_list(),
key=lambda pair: pair[0].lower()):
print((_("%(full_DB_path)s with name \"%(f_t_name)s\"") % \
{'full_DB_path' : dirname,
'f_t_name' : name}).encode(sys.getfilesystemencoding()))
'f_t_name' : name}).encode(sys.stdout.encoding, 'backslashreplace'))
sys.exit(0)
if self.list_more:
print(_('Gramps Family Trees:').encode(sys.getfilesystemencoding()))
print(_('Gramps Family Trees:').encode(sys.stdout.encoding, 'backslashreplace'))
summary_list = self.dbman.family_tree_summary()
for summary in sorted(summary_list,
key=lambda sum: sum["Family tree"].lower()):
print(_("Family Tree \"%s\":").\
encode(sys.getfilesystemencoding()) % summary["Family tree"])
print(_("Family Tree \"%s\":") % summary["Family tree"].\
encode(sys.stdout.encoding, 'backslashreplace'))
for item in sorted(summary):
if item != "Family tree":
print((" %s: %s" % (item, summary[item])).\
encode(sys.getfilesystemencoding()))
encode(sys.stdout.encoding, 'backslashreplace'))
sys.exit(0)
self.__open_action()
@@ -442,7 +443,7 @@ class ArgHandler(object):
for expt in self.exports:
# Need to convert path/filename to str before printing
# For non latin characters in Windows path/file/user names
fn = expt[0].encode(sys.getfilesystemencoding())
fn = expt[0].encode(sys.stdout.encoding, 'backslashreplace')
fmt = str(expt[1])
print(_("Exporting: file %(filename)s, "
"format %(format)s.") % \
@@ -480,7 +481,7 @@ class ArgHandler(object):
self.imp_db_path, title = self.dbman.create_new_db_cli()
else:
self.imp_db_path = get_empty_tempdir("import_dbdir") \
.encode(sys.getfilesystemencoding())
.encode(sys.stdout.encoding, 'backslashreplace')
newdb = DbBsddb()
newdb.write_version(self.imp_db_path)
@@ -494,7 +495,7 @@ class ArgHandler(object):
sys.exit(0)
for imp in self.imports:
fn = imp[0].encode(sys.getfilesystemencoding())
fn = imp[0].encode(sys.stdout.encoding, 'backslashreplace')
fmt = str(imp[1])
msg = _("Importing: file %(filename)s, format %(format)s.") % \
{'filename' : fn, 'format' : fmt}
@@ -623,10 +624,10 @@ class ArgHandler(object):
# Print cli report name ([item[0]), GUI report name (item[4])
if len(pdata.id) <= 25:
print(" %s%s- %s" % ( pdata.id, " " * (26 - len(pdata.id)),
pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
else:
print(" %s\t- %s" % (pdata.id,
pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
elif action == "tool":
from gramps.gui.plug import tool
@@ -664,10 +665,10 @@ class ArgHandler(object):
# Print cli report name ([item[0]), GUI report name (item[4])
if len(pdata.id) <= 25:
print(" %s%s- %s" % ( pdata.id, " " * (26 - len(pdata.id)),
pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
else:
print(" %s\t- %s" % (pdata.id,
pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
elif action == "book":
try:

View File

@@ -39,7 +39,8 @@ Module responsible for handling the command line arguments for GRAMPS.
from __future__ import print_function
import sys
import getopt
from gramps.gen.ggettext import gettext as _
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
import logging
#-------------------------------------------------------------------------
@@ -292,7 +293,7 @@ class ArgParser(object):
self.list_more = True
elif option in ('-s','--show'):
print ("Gramps config settings from %s:" % \
config.filename.encode(sys.getfilesystemencoding()))
config.filename.encode(sys.stdout.encoding, 'backslashreplace'))
for section in config.data:
for setting in config.data[section]:
print ("%s.%s=%s" % (
@@ -402,7 +403,7 @@ class ArgParser(object):
"""
if self.help:
# Convert Help messages to file system encoding before printing
print (_HELP.encode(sys.getfilesystemencoding()))
print (_HELP.encode(sys.stdout.encoding, 'backslashreplace'))
sys.exit(0)
def print_usage(self):
@@ -411,5 +412,5 @@ class ArgParser(object):
"""
if self.usage:
# Convert Help messages to file system encoding before printing
print (_USAGE.encode(sys.getfilesystemencoding()))
print (_USAGE.encode(sys.stdout.encoding, 'backslashreplace'))
sys.exit(0)

View File

@@ -44,7 +44,6 @@ else:
from urllib.parse import urlparse
from urllib.request import urlopen, url2pathname
import tempfile
from gramps.gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# set up logging
@@ -58,6 +57,8 @@ LOG = logging.getLogger(".clidbman")
# gramps modules
#
#-------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
from gramps.gen.db import DbBsddb
from gramps.gen.plug import BasePluginManager
from gramps.gen.config import config
@@ -147,8 +148,8 @@ class CLIDbManager(object):
from gramps.gen.db import META, PERSON_TBL
env = db.DBEnv()
flags = db.DB_CREATE | db.DB_PRIVATE |\
db.DB_INIT_MPOOL | db.DB_INIT_LOCK |\
db.DB_INIT_LOG | db.DB_INIT_TXN | db.DB_THREAD
db.DB_INIT_MPOOL |\
db.DB_INIT_LOG | db.DB_INIT_TXN
try:
env.open(file_name, flags)
except:
@@ -158,8 +159,9 @@ class CLIDbManager(object):
try:
dbmap1.open(fname, META, db.DB_HASH, db.DB_RDONLY)
except:
env.close()
return "Unknown", "Unknown"
version = dbmap1.get('version', default=None)
version = dbmap1.get(b'version', default=None)
dbmap1.close()
dbmap2 = dbshelve.DBShelf(env)
fname = os.path.join(file_name, PERSON_TBL + ".db")
@@ -191,7 +193,7 @@ class CLIDbManager(object):
retval["Locked?"] = "no"
retval["DB version"] = version
if sys.version_info[0] < 3:
retval["Family tree"] = name.encode(sys.getfilesystemencoding())
retval["Family tree"] = name.encode(glocale.getfilesystemencoding())
else:
retval["Family tree"] = name
retval["Path"] = dirpath
@@ -206,7 +208,7 @@ class CLIDbManager(object):
# make the default directory if it does not exist
dbdir = os.path.expanduser(config.get('behavior.database-path'))
if sys.version_info[0] < 3:
dbdir = dbdir.encode(sys.getfilesystemencoding())
dbdir = dbdir.encode(glocale.getfilesystemencoding())
db_ok = make_dbdir(dbdir)
self.current_names = []
@@ -217,6 +219,7 @@ class CLIDbManager(object):
if os.path.isfile(path_name):
file = open(path_name)
name = file.readline().strip()
file.close()
(tval, last) = time_val(dirpath)
(enable, stock_id) = self.icon_values(dirpath, self.active,
@@ -413,7 +416,7 @@ def make_dbdir(dbdir):
if not os.path.isdir(dbdir):
os.makedirs(dbdir)
except (IOError, OSError) as msg:
msg = conv_to_unicode(str(msg), sys.getfilesystemencoding())
msg = conv_to_unicode(str(msg), glocale.getfilesystemencoding())
LOG.error(_("\nERROR: Wrong database path in Edit Menu->Preferences.\n"
"Open preferences and set correct database path.\n\n"
"Details: Could not make database directory:\n %s\n\n") % msg)
@@ -442,7 +445,7 @@ def find_next_db_dir():
base = "%x" % int(time.time())
dbdir = os.path.expanduser(config.get('behavior.database-path'))
if sys.version_info[0] < 3:
dbdir = dbdir.encode(sys.getfilesystemencoding())
dbdir = dbdir.encode(glocale.getfilesystemencoding())
new_path = os.path.join(dbdir, base)
if not os.path.isdir(new_path):
break
@@ -485,7 +488,7 @@ def find_locker_name(dirpath):
# Convert username to unicode according to system encoding
# Otherwise problems with non ASCII characters in
# username in Windows
username = conv_to_unicode(username, sys.getfilesystemencoding())
username = conv_to_unicode(username, glocale.getfilesystemencoding())
# feature request 2356: avoid genitive form
last = _("Locked by %s") % username
ifile.close()

View File

@@ -35,7 +35,8 @@ Provides also two small base classes: CLIDbLoader, CLIManager
#-------------------------------------------------------------------------
from __future__ import print_function
from gramps.gen.ggettext import gettext as _
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
import os
import sys
@@ -296,10 +297,10 @@ def startcli(errors, argparser):
#already errors encountered. Show first one on terminal and exit
# Convert error message to file system encoding before print
errmsg = _('Error encountered: %s') % errors[0][0]
errmsg = errmsg.encode(sys.getfilesystemencoding())
errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
print(errmsg)
errmsg = _(' Details: %s') % errors[0][1]
errmsg = errmsg.encode(sys.getfilesystemencoding())
errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
print(errmsg)
sys.exit(1)
@@ -307,10 +308,10 @@ def startcli(errors, argparser):
# Convert error message to file system encoding before print
errmsg = _('Error encountered in argument parsing: %s') \
% argparser.errors[0][0]
errmsg = errmsg.encode(sys.getfilesystemencoding())
errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
print(errmsg)
errmsg = _(' Details: %s') % argparser.errors[0][1]
errmsg = errmsg.encode(sys.getfilesystemencoding())
errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
print(errmsg)
sys.exit(1)

View File

@@ -35,7 +35,8 @@
#-------------------------------------------------------------------------
from __future__ import print_function
from gramps.gen.ggettext import gettext as _
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
import traceback
import os
import sys
@@ -570,11 +571,11 @@ class CommandLineReport(object):
# Make the output nicer to read, assume a tab has 8 spaces
tabs = '\t\t' if len(key) < 10 else '\t'
optmsg = " %s%s%s (%s)" % (key, tabs, opt[1], opt[0])
print(optmsg.encode(sys.getfilesystemencoding()))
print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
else:
optmsg = " %s%s%s" % (key, tabs,
_('(no help available)'))
print(optmsg.encode(sys.getfilesystemencoding()))
print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
print((_(" Use '%(donottranslate)s' to see description "
"and acceptable values") %
{'donottranslate' : "show=option"}))
@@ -587,10 +588,10 @@ class CommandLineReport(object):
if isinstance(vals, (list, tuple)):
for val in vals:
optmsg = " %s" % val
print(optmsg.encode(sys.getfilesystemencoding()))
print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
else:
optmsg = " %s" % opt[2]
print(optmsg.encode(sys.getfilesystemencoding()))
print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
else:
#there was a show option given, but the option is invalid

View File

@@ -38,7 +38,8 @@ import sys
# Gramps Modules
#
#------------------------------------------------------------------------
from gramps.gen.ggettext import gettext as _
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
from gramps.gen.user import User
#------------------------------------------------------------------------

View File

@@ -41,7 +41,8 @@ import logging
# Gramps imports
#
#---------------------------------------------------------------
from .ggettext import gettext as _
from .const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
from .const import HOME_DIR, USER_HOME, VERSION_DIR
from .utils.configmanager import ConfigManager

View File

@@ -42,7 +42,6 @@ import uuid
# Gramps modules
#
#-------------------------------------------------------------------------
from .ggettext import sgettext as _
from .svn_revision import get_svn_revision
#-------------------------------------------------------------------------
@@ -94,6 +93,12 @@ APP_GRAMPS_PKG = "application/x-gramps-package"
APP_GENEWEB = "application/x-geneweb"
APP_VCARD = ["text/x-vcard", "text/x-vcalendar"]
#-------------------------------------------------------------------------
#
# system paths
#
#-------------------------------------------------------------------------
LOCALE_DIR = "@LOCALE_DIR@"
#-------------------------------------------------------------------------
#
# Platforms
@@ -170,7 +175,7 @@ if sys.version_info[0] < 3:
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(
unicode(__file__, sys.getfilesystemencoding())), os.pardir))
#VERSION += get_svn_revision(ROOT_DIR)
VERSION += get_svn_revision(ROOT_DIR)
#
# Glade files
@@ -213,6 +218,14 @@ LOGO = os.path.join(IMAGE_DIR, "logo.png")
SPLASH = os.path.join(IMAGE_DIR, "splash.jpg")
LICENSE_FILE = os.path.join(DOC_DIR, 'COPYING')
#-------------------------------------------------------------------------
#
# Init Localization
#
#-------------------------------------------------------------------------
from gramps.gen.utils.grampslocale import GrampsLocale
GRAMPS_LOCALE = GrampsLocale()
_ = GRAMPS_LOCALE.get_translation().sgettext
#-------------------------------------------------------------------------
#

View File

@@ -24,8 +24,15 @@
Class handling language-specific selection for date parser and displayer.
"""
from __future__ import print_function
#-------------------------------------------------------------------------
#
# set up logging
#
#-------------------------------------------------------------------------
import logging
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().sgettext
# import prerequisites for localized handlers
from ._datehandler import (LANG, LANG_SHORT, LANG_TO_PARSER, LANG_TO_DISPLAY,
register_datehandler)
@@ -59,7 +66,7 @@ try:
else:
parser = LANG_TO_PARSER[LANG_SHORT]()
except:
print("Date parser for", LANG, "not available, using default")
logging.warning(_("Date parser for '%s' not available, using default") % LANG)
parser = LANG_TO_PARSER["C"]()
# Initialize global displayer
@@ -75,7 +82,7 @@ try:
else:
displayer = LANG_TO_DISPLAY[LANG_SHORT](val)
except:
print("Date displayer for", LANG, "not available, using default")
logging.warning(_("Date displayer for '%s' not available, using default") % LANG)
displayer = LANG_TO_DISPLAY["C"](val)

View File

@@ -25,6 +25,8 @@ import locale
import sys
from ..constfunc import mac, win, conv_to_unicode
from gramps.gen.const import GRAMPS_LOCALE as glocale
"""
Some OS environments do not support the locale.nl_langinfo() method
of determing month names and other date related information.
@@ -40,8 +42,9 @@ if sys.version_info[0] < 3:
else:
#locale returns unicode in python 3
to_uni = lambda x, y: x
codeset = glocale.encoding
try:
codeset = locale.nl_langinfo(locale.CODESET)
month_to_int = {
to_uni(locale.nl_langinfo(locale.MON_1), codeset).lower() : 1,
@@ -137,69 +140,64 @@ try:
except:
import time
codeset = None
if win() or mac():
codeset = locale.getlocale()[1]
if codeset is None:
codeset = locale.getpreferredencoding()
month_to_int = {
to_uni(time.strftime('%B',(0,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
to_uni(time.strftime('%b',(0,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
to_uni(time.strftime('%B',(0,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
to_uni(time.strftime('%b',(0,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
to_uni(time.strftime('%B',(0,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
to_uni(time.strftime('%b',(0,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
to_uni(time.strftime('%B',(0,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
to_uni(time.strftime('%b',(0,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
to_uni(time.strftime('%B',(0,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
to_uni(time.strftime('%b',(0,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
to_uni(time.strftime('%B',(0,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
to_uni(time.strftime('%b',(0,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
to_uni(time.strftime('%B',(0,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
to_uni(time.strftime('%b',(0,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
to_uni(time.strftime('%B',(0,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
to_uni(time.strftime('%b',(0,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
to_uni(time.strftime('%B',(0,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
to_uni(time.strftime('%b',(0,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
to_uni(time.strftime('%B',(0,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
to_uni(time.strftime('%b',(0,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
to_uni(time.strftime('%B',(0,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
to_uni(time.strftime('%b',(0,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
to_uni(time.strftime('%B',(0,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
to_uni(time.strftime('%b',(0,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
to_uni(time.strftime('%B',(1,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
to_uni(time.strftime('%b',(1,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
to_uni(time.strftime('%B',(1,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
to_uni(time.strftime('%b',(1,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
to_uni(time.strftime('%B',(1,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
to_uni(time.strftime('%b',(1,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
to_uni(time.strftime('%B',(1,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
to_uni(time.strftime('%b',(1,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
to_uni(time.strftime('%B',(1,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
to_uni(time.strftime('%b',(1,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
to_uni(time.strftime('%B',(1,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
to_uni(time.strftime('%b',(1,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
to_uni(time.strftime('%B',(1,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
to_uni(time.strftime('%b',(1,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
to_uni(time.strftime('%B',(1,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
to_uni(time.strftime('%b',(1,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
to_uni(time.strftime('%B',(1,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
to_uni(time.strftime('%b',(1,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
to_uni(time.strftime('%B',(1,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
to_uni(time.strftime('%b',(1,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
to_uni(time.strftime('%B',(1,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
to_uni(time.strftime('%b',(1,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
to_uni(time.strftime('%B',(1,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
to_uni(time.strftime('%b',(1,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
}
long_months = (
"",
to_uni(time.strftime('%B',(0,1,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(0,2,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(0,3,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(0,4,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(0,5,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(0,6,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(0,7,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(0,8,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(0,9,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(0,10,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(0,11,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(0,12,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(1,1,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(1,2,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(1,3,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(1,4,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(1,5,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(1,6,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(1,7,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(1,8,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(1,9,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(1,10,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(1,11,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%B',(1,12,1,1,1,1,1,1,1)), codeset),
)
short_months = (
"",
to_uni(time.strftime('%b',(0,1,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(0,2,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(0,3,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(0,4,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(0,5,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(0,6,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(0,7,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(0,8,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(0,9,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(0,10,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(0,11,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(0,12,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(1,1,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(1,2,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(1,3,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(1,4,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(1,5,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(1,6,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(1,7,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(1,8,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(1,9,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(1,10,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(1,11,1,1,1,1,1,1,1)), codeset),
to_uni(time.strftime('%b',(1,12,1,1,1,1,1,1,1)), codeset),
)
# Gramps day number: Sunday => 1, Monday => 2, etc
@@ -213,24 +211,24 @@ except:
# just a dummy.
long_days = (
"",
to_uni(time.strftime('%A',(0,1,1,1,1,1,6,1,1)), codeset), # Sunday
to_uni(time.strftime('%A',(0,1,1,1,1,1,0,1,1)), codeset), # Monday
to_uni(time.strftime('%A',(0,1,1,1,1,1,1,1,1)), codeset), # Tuesday
to_uni(time.strftime('%A',(0,1,1,1,1,1,2,1,1)), codeset), # Wednesday
to_uni(time.strftime('%A',(0,1,1,1,1,1,3,1,1)), codeset), # Thursday
to_uni(time.strftime('%A',(0,1,1,1,1,1,4,1,1)), codeset), # Friday
to_uni(time.strftime('%A',(0,1,1,1,1,1,5,1,1)), codeset), # Saturday
to_uni(time.strftime('%A',(1,1,1,1,1,1,6,1,1)), codeset), # Sunday
to_uni(time.strftime('%A',(1,1,1,1,1,1,0,1,1)), codeset), # Monday
to_uni(time.strftime('%A',(1,1,1,1,1,1,1,1,1)), codeset), # Tuesday
to_uni(time.strftime('%A',(1,1,1,1,1,1,2,1,1)), codeset), # Wednesday
to_uni(time.strftime('%A',(1,1,1,1,1,1,3,1,1)), codeset), # Thursday
to_uni(time.strftime('%A',(1,1,1,1,1,1,4,1,1)), codeset), # Friday
to_uni(time.strftime('%A',(1,1,1,1,1,1,5,1,1)), codeset), # Saturday
)
short_days = (
"",
to_uni(time.strftime('%a',(0,1,1,1,1,1,6,1,1)), codeset), # Sunday
to_uni(time.strftime('%a',(0,1,1,1,1,1,0,1,1)), codeset), # Monday
to_uni(time.strftime('%a',(0,1,1,1,1,1,1,1,1)), codeset), # Tuesday
to_uni(time.strftime('%a',(0,1,1,1,1,1,2,1,1)), codeset), # Wednesday
to_uni(time.strftime('%a',(0,1,1,1,1,1,3,1,1)), codeset), # Thursday
to_uni(time.strftime('%a',(0,1,1,1,1,1,4,1,1)), codeset), # Friday
to_uni(time.strftime('%a',(0,1,1,1,1,1,5,1,1)), codeset), # Saturday
to_uni(time.strftime('%a',(1,1,1,1,1,1,6,1,1)), codeset), # Sunday
to_uni(time.strftime('%a',(1,1,1,1,1,1,0,1,1)), codeset), # Monday
to_uni(time.strftime('%a',(1,1,1,1,1,1,1,1,1)), codeset), # Tuesday
to_uni(time.strftime('%a',(1,1,1,1,1,1,2,1,1)), codeset), # Wednesday
to_uni(time.strftime('%a',(1,1,1,1,1,1,3,1,1)), codeset), # Thursday
to_uni(time.strftime('%a',(1,1,1,1,1,1,4,1,1)), codeset), # Friday
to_uni(time.strftime('%a',(1,1,1,1,1,1,5,1,1)), codeset), # Saturday
)
# depending on the locale, the value returned for 20th Feb 2009 could be

View File

@@ -32,7 +32,8 @@ from this class.
# Python libraries
#
#-------------------------------------------------------------------------
from ..ggettext import gettext as _
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -198,8 +198,8 @@ if __name__ == "__main__":
x = db.DBEnv()
print("3")
x.open('/tmp', db.DB_CREATE | db.DB_PRIVATE |\
db.DB_INIT_MPOOL | db.DB_INIT_LOCK |\
db.DB_INIT_LOG | db.DB_INIT_TXN | db.DB_THREAD)
db.DB_INIT_MPOOL |\
db.DB_INIT_LOG | db.DB_INIT_TXN)
print("4")
d = dbshelve.DBShelf(x)
print("5")

View File

@@ -27,7 +27,8 @@
# Standard python modules
#
#-------------------------------------------------------------------------
from ..ggettext import gettext as _
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
class DbException(Exception):

View File

@@ -40,7 +40,6 @@ else:
import pickle
import time
import random
import locale
import os
from sys import maxsize
@@ -49,7 +48,8 @@ if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
from bsddb3 import db
else:
from bsddb import db
from ..ggettext import gettext as _
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
import re
import logging
@@ -80,6 +80,7 @@ from . import (BsddbBaseCursor, DbReadBase)
from ..utils.id import create_id
from ..errors import DbError
from ..constfunc import UNITYPE, STRTYPE, cuni
from ..const import GRAMPS_LOCALE as glocale
LOG = logging.getLogger(DBLOGNAME)
LOG = logging.getLogger(".citation")
@@ -1641,7 +1642,7 @@ class DbBsddbRead(DbReadBase, Callback):
def __sortbyperson_key(self, handle):
if isinstance(handle, UNITYPE):
handle = handle.encode('utf-8')
return locale.strxfrm(find_surname(handle,
return glocale.sort_key(find_surname(handle,
self.person_map.get(handle)))
def __sortbyplace(self, first, second):
@@ -1649,13 +1650,13 @@ class DbBsddbRead(DbReadBase, Callback):
first = first.encode('utf-8')
if isinstance(second, UNITYPE):
second = second.encode('utf-8')
return locale.strcoll(self.place_map.get(first)[2],
return glocale.strcoll(self.place_map.get(first)[2],
self.place_map.get(second)[2])
def __sortbyplace_key(self, place):
if isinstance(place, UNITYPE):
place = place.encode('utf-8')
return locale.strxfrm(self.place_map.get(place)[2])
return glocale.sort_key(self.place_map.get(place)[2])
def __sortbysource(self, first, second):
if isinstance(first, UNITYPE):
@@ -1664,13 +1665,13 @@ class DbBsddbRead(DbReadBase, Callback):
second = second.encode('utf-8')
source1 = cuni(self.source_map[first][2])
source2 = cuni(self.source_map[second][2])
return locale.strcoll(source1, source2)
return glocale.strcoll(source1, source2)
def __sortbysource_key(self, key):
if isinstance(key, UNITYPE):
key = key.encode('utf-8')
source = cuni(self.source_map[key][2])
return locale.strxfrm(source)
return glocale.sort_key(source)
def __sortbycitation(self, first, second):
if isinstance(first, UNITYPE):
@@ -1679,13 +1680,13 @@ class DbBsddbRead(DbReadBase, Callback):
second = second.encode('utf-8')
citation1 = cuni(self.citation_map[first][3])
citation2 = cuni(self.citation_map[second][3])
return locale.strcoll(citation1, citation2)
return glocale.strcoll(citation1, citation2)
def __sortbycitation_key(self, key):
if isinstance(key, UNITYPE):
key = key.encode('utf-8')
citation = cuni(self.citation_map[key][3])
return locale.strxfrm(citation)
return glocale.sort_key(citation)
def __sortbymedia(self, first, second):
if isinstance(first, UNITYPE):
@@ -1694,13 +1695,13 @@ class DbBsddbRead(DbReadBase, Callback):
second = second.encode('utf-8')
media1 = self.media_map[first][4]
media2 = self.media_map[second][4]
return locale.strcoll(media1, media2)
return glocale.strcoll(media1, media2)
def __sortbymedia_key(self, key):
if isinstance(key, UNITYPE):
key = key.encode('utf-8')
media = self.media_map[key][4]
return locale.strxfrm(media)
return glocale.sort_key(media)
def __sortbytag(self, first, second):
if isinstance(first, UNITYPE):
@@ -1709,13 +1710,13 @@ class DbBsddbRead(DbReadBase, Callback):
second = second.encode('utf-8')
tag1 = self.tag_map[first][1]
tag2 = self.tag_map[second][1]
return locale.strcoll(tag1, tag2)
return glocale.strcoll(tag1, tag2)
def __sortbytag_key(self, key):
if isinstance(key, UNITYPE):
key = key.encode('utf-8')
tag = self.tag_map[key][1]
return locale.strxfrm(tag)
return glocale.sort_key(tag)
def set_mediapath(self, path):
"""Set the default media path for database, path should be utf-8."""

View File

@@ -46,7 +46,8 @@ if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
from bsddb3 import db
else:
from bsddb import db
from ..ggettext import gettext as _
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -30,8 +30,9 @@ import time
import logging
LOG = logging.getLogger(".citation")
from ..ggettext import gettext as _
from ..constfunc import cuni, UNITYPE
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
from ..constfunc import cuni
"""
methods to upgrade a database from version 13 to current version

View File

@@ -40,13 +40,11 @@ else:
import pickle
import os
import time
import locale
import bisect
from functools import wraps
import logging
from sys import maxsize
from ..ggettext import gettext as _
from ..config import config
if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
from bsddb3 import dbshelve, db
@@ -77,10 +75,12 @@ from . import (DbBsddbRead, DbWriteBase, BSDDBTxn,
find_byte_surname, find_surname_name, DbUndoBSDDB as DbUndo)
from .dbconst import *
from ..utils.callback import Callback
from ..utils.cast import (conv_unicode_tosrtkey, conv_dbstr_to_unicode)
from ..utils.cast import conv_dbstr_to_unicode
from ..updatecallback import UpdateCallback
from ..errors import DbError
from ..constfunc import win, conv_to_unicode, cuni, UNITYPE, handle2internal
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
_LOG = logging.getLogger(DBLOGNAME)
LOG = logging.getLogger(".citation")
@@ -495,8 +495,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
# The DB_PRIVATE flag must go if we ever move to multi-user setup
env_flags = db.DB_CREATE | db.DB_PRIVATE |\
db.DB_INIT_MPOOL | db.DB_INIT_LOCK |\
db.DB_INIT_LOG | db.DB_INIT_TXN | db.DB_THREAD
db.DB_INIT_MPOOL |\
db.DB_INIT_LOG | db.DB_INIT_TXN
# As opposed to before, we always try recovery on databases
env_flags |= db.DB_RECOVER
@@ -1135,11 +1135,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
self.transaction_abort(self.transaction)
self.env.txn_checkpoint()
lockstats = self.env.lock_stat()
_LOG.debug("lock occupancy: %d%%, locked object occupancy: %d%%" % (
round(lockstats['maxnlocks']*100/lockstats['maxlocks']),
round(lockstats['maxnobjects']*100/lockstats['maxobjects'])))
self.__close_metadata()
self.name_group.close()
self.surnames.close()
@@ -1498,7 +1493,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
self.emit('person-groupname-rebuild', (name, grouppar))
def sort_surname_list(self):
self.surname_list.sort(key=conv_unicode_tosrtkey)
self.surname_list.sort(key=glocale.sort_key)
@catch_db_error
def build_surname_list(self):
@@ -1510,7 +1505,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
#TODO GTK3: Why double conversion? Convert to a list of str objects!
self.surname_list = sorted(
map(conv_dbstr_to_unicode, set(self.surnames.keys())),
key=conv_unicode_tosrtkey)
key=glocale.sort_key)
def add_to_surname_list(self, person, batch_transaction):
"""
@@ -2055,8 +2050,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
# The DB_PRIVATE flag must go if we ever move to multi-user setup
env_flags = db.DB_CREATE | db.DB_PRIVATE |\
db.DB_INIT_MPOOL | db.DB_INIT_LOCK |\
db.DB_INIT_LOG | db.DB_INIT_TXN | db.DB_THREAD
db.DB_INIT_MPOOL |\
db.DB_INIT_LOG | db.DB_INIT_TXN
# As opposed to before, we always try recovery on databases
env_flags |= db.DB_RECOVER

View File

@@ -53,8 +53,8 @@ Specific symbols for parts of a name are defined:
# Python modules
#
#-------------------------------------------------------------------------
from ..ggettext import sgettext as _
import sys
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().sgettext
import re
import logging
LOG = logging.getLogger(".gramps.gen")

View File

@@ -40,6 +40,7 @@ import collections
from ._filterparser import FilterParser
from ..plug import BasePluginManager
from ..constfunc import STRTYPE
from ..const import GRAMPS_LOCALE as glocale
PLUGMAN = BasePluginManager.get_instance()
#-------------------------------------------------------------------------
@@ -124,7 +125,7 @@ class FilterList(object):
return l.replace('"', '&quot;')
def save(self):
f = open(self.file.encode(sys.getfilesystemencoding()), 'w')
f = open(self.file.encode(glocale.getfilesystemencoding()), 'w')
f.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
f.write('<filters>\n')
for namespace in self.filter_namespaces:

View File

@@ -28,7 +28,8 @@
from __future__ import print_function, unicode_literals
from xml.sax import handler
from ..ggettext import gettext as _
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
import re
import time

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -29,7 +29,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
#
#-------------------------------------------------------------------------
import re
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -27,7 +27,8 @@ Rule that checks for an object with a particular tag.
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -23,7 +23,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gramps.gen.ggettext import gettext as _
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
from . import Rule
#-------------------------------------------------------------------------

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,6 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
import logging
LOG = logging.getLogger(".filter")
@@ -36,6 +35,8 @@ LOG = logging.getLogger(".filter")
#-------------------------------------------------------------------------
# we need global variableCustomFilters, so we need to query gramps.gen.filters
# when we need this variable, not import it at the start!
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
import gramps.gen.filters
from . import Rule

View File

@@ -29,7 +29,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
#
#-------------------------------------------------------------------------
import re
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -30,7 +30,8 @@ Base class for filter rules.
# Standard Python modules
#
#-------------------------------------------------------------------------
from ...ggettext import gettext as _
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
import re
#-------------------------------------------------------------------------

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -28,7 +28,8 @@ Filter rule to match citation data.
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -29,7 +29,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -29,7 +29,8 @@ Filter rule to match citation with a particular source.
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -28,7 +28,8 @@
#-------------------------------------------------------------------------
import logging
LOG = logging.getLogger(".citation")
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -27,7 +27,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -29,7 +29,8 @@ Filter rule to match event with a particular citation.
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -27,7 +27,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import sgettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#

View File

@@ -27,7 +27,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -29,7 +29,8 @@ Filter rule to match family with a particular citation.
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -28,7 +28,8 @@ Filter rule to match families with a particular event.
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

View File

@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....ggettext import gettext as _
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#

Some files were not shown because too many files have changed in this diff Show More