Compare commits
75 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4370fa29ad | |||
| 20bb38de62 | |||
| 7c3073c54a | |||
| f96c6ce2a0 | |||
| 5c88ccfe7a | |||
| 93197c4677 | |||
| 9b0145d050 | |||
| 2b9efedd41 | |||
| 9a8af2289a | |||
| 58d30e6ded | |||
| b656d55364 | |||
| 2fc6750867 | |||
| 44d9578622 | |||
| 78c79202de | |||
| df1ffe06e1 | |||
| c46f7dde41 | |||
| e9c3ca1620 | |||
| 46cf600fac | |||
| 3246bf77d3 | |||
| 3501a9666c | |||
| ee0bc905da | |||
| 8be01ff00e | |||
| 5c278cfc36 | |||
| 915522c989 | |||
| e4ebeb247a | |||
| e6c7a53580 | |||
| 10aca55568 | |||
| 5fc71a7923 | |||
| d25385328b | |||
| 5c6259edbc | |||
| 1452b499ff | |||
| 63a8a2955d | |||
| 97762815bc | |||
| fed7d5e5b8 | |||
| d3f346808f | |||
| c1e356769e | |||
| 31a222a754 | |||
| bbe5e0ec84 | |||
| 57209001cb | |||
| 7c3094b5b5 | |||
| 489d12d484 | |||
| a6659515d5 | |||
| b094b4b7a7 | |||
| bf20905761 | |||
| 555a244a45 | |||
| 78ec6a26a2 | |||
| 942b51945c | |||
| 6a5b630a05 | |||
| c97aeb0f1a | |||
| 503d3bf6ca | |||
| 951e9341cf | |||
| c864804eac | |||
| 87a5ae428e | |||
| 6b55af1e03 | |||
| 9dc8e62951 | |||
| e398d3db2d | |||
| 320bbeb0b6 | |||
| 7af4bf5d5f | |||
| 9fb493415a | |||
| 7c35586ae2 | |||
| 82294e6a82 | |||
| 2203f28b28 | |||
| 7c27167042 | |||
| 6cb766326f | |||
| 716096be44 | |||
| 58d5d61789 | |||
| 01ee2d9a30 | |||
| 755eeaf1dc | |||
| fd2db583c1 | |||
| 16cbe024ec | |||
| 97a1419281 | |||
| 2d4e36a074 | |||
| f2c9e7cfc8 | |||
| a006b930d9 | |||
| 29dc9bdc54 |
@@ -1,3 +1,48 @@
|
||||
2014-04-30
|
||||
Version 3.4.9 of Gramps! "I am no longer infected", a maintenance release.
|
||||
* Error converting python2 utf-8 strings to python3 str when loading data from database
|
||||
* Gedcom input: SUBN and SUBM record handling
|
||||
* [Gedcom] import/export round trip causes lost information
|
||||
* [Gedcom] Gramps can't import estim. date period exported by itself
|
||||
* [Gedcom] import deletes first char of notes
|
||||
* [Gedcom] import of embedded notes attached to media does not work
|
||||
* [Gedcom] NameError in importer
|
||||
* [Gedcom] export does not export media attached to citations
|
||||
* [Gedcom] Errors handling owner/submitter information
|
||||
* [Gedcom] Event address is lost on import, i.e. disconnected from event
|
||||
* [Gedcom] Entering a witness to an event such as marriage might be ignored
|
||||
* [Gedcom] Importing file containing multibyte UTF-8 characters fails
|
||||
* Event list in editors does not display content into 'Main Participants' column
|
||||
* Fix 'Last Change' column into Person Selector
|
||||
* Support creating directories in various scenarios
|
||||
* tag_map is not initialized
|
||||
* Fix bad handle in explanation note for unknown event
|
||||
* Narrative website: Missing webpage for media with missing thumbnail on person page
|
||||
* Enable the "default" CSS choice for the narrated web report
|
||||
* Crash while scrolling in person view
|
||||
* Crash when attempting to create Places Report
|
||||
* Error in Session Log gramplet with no active person
|
||||
* In Ahnentafel Report, Use Christening Date if no Birth Date Present
|
||||
* Family with children but no parents is lost on filtered export
|
||||
* Some labels now fit better on citations sidebar filter
|
||||
* Can't disable box shadow in SVG descendant tree
|
||||
* Descendant tree graphical report, syntax error in svg output
|
||||
* Various problems with docgen.TextDoc.add_media_object
|
||||
* Spurious spaces in CLI List Family Trees, tab delimited output. Print statements changed to assemble the whole line before output.
|
||||
* GuiColorOption missing avail-changed event handler
|
||||
* Regression: running gramps from crontab fails
|
||||
* Better support for handling custom media attributes on edition
|
||||
* DB lock not checked when opening database from the recent opened trees menu item
|
||||
* List index out of range" on [initial CLI "gramps -t"]
|
||||
* HTML View fails to load on Debian unstable
|
||||
* Fix unknown gender relationships hander for the french locale
|
||||
* Can't fill in calculated and estimated dates in czech locale
|
||||
* Enhance Serbian date handler to handle Cyrillic dates
|
||||
* Updated translations: cs, de, fr, hu, it
|
||||
* Fix mac menubar setting
|
||||
* Fix mac OsmGpsMaps setting
|
||||
* Enable PIL with Freetype2 support on mac
|
||||
|
||||
2014-05-29
|
||||
Version 3.4.8 of Gramps! "Forget about your sin, give the audience a grin", a maintenance release.
|
||||
* Database corrupted - TypeError: unhashable type: 'list'
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ dnl May need to run automake && aclocal first
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
dnl NOTE: arg to macro below becomes the "VERSION"
|
||||
AC_INIT(gramps, 3.4.8, [gramps-bugs@lists.sourceforge.net])
|
||||
AC_INIT(gramps, 3.4.9, [gramps-bugs@lists.sourceforge.net])
|
||||
AC_CONFIG_SRCDIR(configure.in)
|
||||
AM_INIT_AUTOMAKE([1.6.3 foreign])
|
||||
|
||||
|
||||
+32
-32
@@ -25,7 +25,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Anna Hansdotter
|
||||
2 DATE 2 OCT 1864
|
||||
2 PLAC Loderup, Malmous Lan, Sweden
|
||||
2 PLAC Löderup, Malmöhus Län, Sweden
|
||||
1 DEAT
|
||||
2 TYPE Death of Anna Hansdotter
|
||||
2 DATE 29 SEP 1945
|
||||
@@ -55,7 +55,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Hans Peter Smith
|
||||
2 DATE 17 APR 1904
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 DEAT
|
||||
2 TYPE Death of Hans Peter Smith
|
||||
2 DATE 29 JAN 1977
|
||||
@@ -74,7 +74,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Hanna Smith
|
||||
2 DATE 29 JAN 1821
|
||||
2 PLAC Gladsax, Kristianstad Lan, Sweden
|
||||
2 PLAC Gladsax, Kristianstad Län, Sweden
|
||||
1 FAMC @F0@
|
||||
1 CHAN
|
||||
2 DATE 21 DEC 2007
|
||||
@@ -87,7 +87,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Herman Julius Nielsen
|
||||
2 DATE 31 AUG 1889
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 DEAT
|
||||
2 TYPE Death of Herman Julius Nielsen
|
||||
2 DATE 1945
|
||||
@@ -128,7 +128,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Gus Smith
|
||||
2 DATE 11 SEP 1897
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 DEAT
|
||||
2 TYPE Death of Gus Smith
|
||||
2 DATE 21 OCT 1963
|
||||
@@ -146,7 +146,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Jennifer Anderson
|
||||
2 DATE 5 NOV 1907
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 DEAT
|
||||
2 TYPE Death of Jennifer Anderson
|
||||
2 DATE 29 MAY 1985
|
||||
@@ -163,7 +163,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Lillie Harriet Jones
|
||||
2 DATE 2 MAY 1910
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 DEAT
|
||||
2 TYPE Death of Lillie Harriet Jones
|
||||
2 DATE 26 JUN 1990
|
||||
@@ -227,7 +227,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Carl Emil Smith
|
||||
2 DATE 20 DEC 1899
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 DEAT
|
||||
2 TYPE Death of Carl Emil Smith
|
||||
2 DATE 28 JAN 1959
|
||||
@@ -245,11 +245,11 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Hjalmar Smith
|
||||
2 DATE 31 JAN 1893
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 DEAT
|
||||
2 TYPE Death of Hjalmar Smith
|
||||
2 DATE 25 SEP 1894
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 FAMC @F3@
|
||||
1 CHAN
|
||||
2 DATE 21 DEC 2007
|
||||
@@ -262,7 +262,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Martin Smith
|
||||
2 DATE 19 NOV 1830
|
||||
2 PLAC Gladsax, Kristianstad Lan, Sweden
|
||||
2 PLAC Gladsax, Kristianstad Län, Sweden
|
||||
1 DEAT
|
||||
2 TYPE Death of Martin Smith
|
||||
2 DATE BET 1899 AND 1905
|
||||
@@ -270,7 +270,7 @@
|
||||
1 BAPM
|
||||
2 TYPE Baptism of Martin Smith
|
||||
2 DATE 23 NOV 1830
|
||||
2 PLAC Gladsax, Kristianstad Lan, Sweden
|
||||
2 PLAC Gladsax, Kristianstad Län, Sweden
|
||||
1 FAMC @F0@
|
||||
1 FAMS @F2@
|
||||
1 NOTE @N0002@
|
||||
@@ -285,7 +285,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Astrid Shermanna Augusta Smith
|
||||
2 DATE 31 JAN 1889
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 DEAT
|
||||
2 TYPE Death of Astrid Shermanna Augusta Smith
|
||||
2 DATE 21 DEC 1963
|
||||
@@ -304,7 +304,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Gustaf Smith, Sr.
|
||||
2 DATE 28 NOV 1862
|
||||
2 PLAC Grostorp, Kristianstad Lan, Sweden
|
||||
2 PLAC Grostorp, Kristianstad Län, Sweden
|
||||
1 DEAT
|
||||
2 TYPE Death of Gustaf Smith, Sr.
|
||||
2 DATE BEF 23 JUL 1930
|
||||
@@ -316,7 +316,7 @@
|
||||
1 CHR
|
||||
2 TYPE Christening of Gustaf Smith, Sr.
|
||||
2 DATE 7 DEC 1862
|
||||
2 PLAC Gladsax, Kristianstad Lan, Sweden
|
||||
2 PLAC Gladsax, Kristianstad Län, Sweden
|
||||
1 FAMC @F2@
|
||||
1 FAMS @F3@
|
||||
1 CHAN
|
||||
@@ -343,7 +343,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Kirsti Marie Smith
|
||||
2 DATE 15 DEC 1886
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 DEAT
|
||||
2 TYPE Death of Kirsti Marie Smith
|
||||
2 DATE 18 JUL 1966
|
||||
@@ -378,7 +378,7 @@
|
||||
1 DEAT
|
||||
2 TYPE Death of Anna Streiffert
|
||||
2 DATE 2 FEB 1927
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 FAMS @F11@
|
||||
1 CHAN
|
||||
2 DATE 21 DEC 2007
|
||||
@@ -407,11 +407,11 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Magnes Smith
|
||||
2 DATE 6 OCT 1858
|
||||
2 PLAC Simrishamn, Kristianstad Lan, Sweden
|
||||
2 PLAC Simrishamn, Kristianstad Län, Sweden
|
||||
1 DEAT
|
||||
2 TYPE Death of Magnes Smith
|
||||
2 DATE 20 FEB 1910
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 FAMC @F2@
|
||||
1 FAMS @F11@
|
||||
1 CHAN
|
||||
@@ -515,14 +515,14 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Elna Jefferson
|
||||
2 DATE 14 SEP 1800
|
||||
2 PLAC Gladsax, Kristianstad Lan, Sweden
|
||||
2 PLAC Gladsax, Kristianstad Län, Sweden
|
||||
1 DEAT
|
||||
2 TYPE Death of Elna Jefferson
|
||||
2 PLAC Sweden
|
||||
1 CHR
|
||||
2 TYPE Christening of Elna Jefferson
|
||||
2 DATE 16 SEP 1800
|
||||
2 PLAC Gladsax, Kristianstad Lan, Sweden
|
||||
2 PLAC Gladsax, Kristianstad Län, Sweden
|
||||
1 FAMS @F0@
|
||||
1 CHAN
|
||||
2 DATE 21 DEC 2007
|
||||
@@ -560,7 +560,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Kerstina Hansdotter
|
||||
2 DATE 29 NOV 1832
|
||||
2 PLAC Smestorp, Kristianstad Lan, Sweden
|
||||
2 PLAC Smestorp, Kristianstad Län, Sweden
|
||||
1 DEAT
|
||||
2 TYPE Death of Kerstina Hansdotter
|
||||
2 DATE BEF 1908
|
||||
@@ -577,7 +577,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Martin Smith
|
||||
2 DATE BET 1794 AND 1796
|
||||
2 PLAC Tommarp, Kristianstad Lan, Sweden
|
||||
2 PLAC Tommarp, Kristianstad Län, Sweden
|
||||
1 DEAT
|
||||
2 TYPE Death of Martin Smith
|
||||
2 PLAC Sweden
|
||||
@@ -594,7 +594,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Ingeman Smith
|
||||
2 DATE 29 JAN 1826
|
||||
2 PLAC Gladsax, Kristianstad Lan, Sweden
|
||||
2 PLAC Gladsax, Kristianstad Län, Sweden
|
||||
1 FAMC @F0@
|
||||
1 CHAN
|
||||
2 DATE 21 DEC 2007
|
||||
@@ -661,7 +661,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Ingar Smith
|
||||
2 DATE AFT 1823
|
||||
2 PLAC Gladsax, Kristianstad Lan, Sweden
|
||||
2 PLAC Gladsax, Kristianstad Län, Sweden
|
||||
1 FAMC @F0@
|
||||
1 CHAN
|
||||
2 DATE 21 DEC 2007
|
||||
@@ -674,7 +674,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Hjalmar Smith
|
||||
2 DATE 7 APR 1895
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 DEAT
|
||||
2 TYPE Death of Hjalmar Smith
|
||||
2 DATE 26 JUN 1975
|
||||
@@ -682,7 +682,7 @@
|
||||
1 BAPM
|
||||
2 TYPE Baptism of Hjalmar Smith
|
||||
2 DATE 3 JUN 1895
|
||||
2 PLAC Ronne Bornholm, Denmark
|
||||
2 PLAC Rønne Bornholm, Denmark
|
||||
1 EVEN
|
||||
2 TYPE Immi
|
||||
2 DATE 14 NOV 1912
|
||||
@@ -701,7 +701,7 @@
|
||||
1 BIRT
|
||||
2 TYPE Birth of Emil Smith
|
||||
2 DATE 27 SEP 1860
|
||||
2 PLAC Simrishamn, Kristianstad Lan, Sweden
|
||||
2 PLAC Simrishamn, Kristianstad Län, Sweden
|
||||
1 FAMC @F2@
|
||||
1 CHAN
|
||||
2 DATE 21 DEC 2007
|
||||
@@ -712,7 +712,7 @@
|
||||
1 MARR
|
||||
2 TYPE Marriage of Martin Smith and Elna Jefferson
|
||||
2 DATE ABT 1816
|
||||
2 PLAC Gladsax, Kristianstad Lan, Sweden
|
||||
2 PLAC Gladsax, Kristianstad Län, Sweden
|
||||
1 CHIL @I11@
|
||||
1 CHIL @I7@
|
||||
1 CHIL @I4@
|
||||
@@ -748,7 +748,7 @@
|
||||
1 MARR
|
||||
2 TYPE Marriage of Magnes Smith and Anna Streiffert
|
||||
2 DATE 24 AUG 1884
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 CHAN
|
||||
2 DATE 21 DEC 2007
|
||||
3 TIME 01:35:26
|
||||
@@ -805,7 +805,7 @@
|
||||
1 MARR
|
||||
2 TYPE Marriage of Gustaf Smith, Sr. and Anna Hansdotter
|
||||
2 DATE 27 NOV 1885
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 CHIL @I26@
|
||||
1 CHIL @I23@
|
||||
1 CHIL @I21@
|
||||
@@ -831,7 +831,7 @@
|
||||
1 MARR
|
||||
2 TYPE Marriage of Herman Julius Nielsen and Astrid Shermanna Augusta Smith
|
||||
2 DATE 30 NOV 1912
|
||||
2 PLAC Ronne, Bornholm, Denmark
|
||||
2 PLAC Rønne, Bornholm, Denmark
|
||||
1 CHAN
|
||||
2 DATE 21 DEC 2007
|
||||
3 TIME 01:35:26
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
*** a/_imagingft.c Sat Oct 31 17:44:12 2009
|
||||
--- b/_imagingft.c Thu May 22 12:30:02 2014
|
||||
***************
|
||||
*** 70,76 ****
|
||||
--- 70,80 ----
|
||||
const char* message;
|
||||
} ft_errors[] =
|
||||
|
||||
+ #if defined(USE_FREETYPE_2_1)
|
||||
+ #include <freetype2/fterrors.h>
|
||||
+ #else
|
||||
#include <freetype/fterrors.h>
|
||||
+ #endif
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* font objects */
|
||||
--- a/setup.py Sun Nov 15 08:06:10 2009
|
||||
+++ b/setup.py Fri May 23 11:26:20 2014
|
||||
@@ -348,7 +348,7 @@
|
||||
dir = os.path.join(root, "Tk.framework", "Headers")
|
||||
add_directory(self.compiler.include_dirs, dir, 1)
|
||||
break
|
||||
- if frameworks:
|
||||
+ if False:
|
||||
exts.append(Extension(
|
||||
"_imagingtk", ["_imagingtk.c", "Tk/tkImaging.c"],
|
||||
extra_compile_args=frameworks, extra_link_args=frameworks
|
||||
+4
-4
@@ -7,7 +7,7 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>Gramps</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>Gramps 3.4.7-1, (C) 1997-2014 The Gramps Team http://www.gramps-project.org</string>
|
||||
<string>Gramps 3.4.9-1, (C) 1997-2015 The Gramps Team http://www.gramps-project.org</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>gramps.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
@@ -17,15 +17,15 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>3.4.7-1</string>
|
||||
<string>3.4.9-1</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Gramps</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>3.4.7-1</string>
|
||||
<string>3.4.9-1</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright 1997 - 2014 The Gramps Team, GNU General Public License.</string>
|
||||
<string>Copyright 1997 - 2015 The Gramps Team, GNU General Public License.</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.5</string>
|
||||
</dict>
|
||||
|
||||
+2
-2
@@ -72,7 +72,7 @@
|
||||
</binary>
|
||||
|
||||
<binary>
|
||||
${prefix}/lib/libgtkmacintegration.2.dylib
|
||||
${prefix}/lib/libgtkmacintegration-gtk2.2.dylib
|
||||
</binary>
|
||||
|
||||
<binary>
|
||||
@@ -100,7 +100,7 @@
|
||||
</binary>
|
||||
|
||||
<binary>
|
||||
${prefix}/lib/libtiff.3.dylib
|
||||
${prefix}/lib/libtiff.5.dylib
|
||||
</binary>
|
||||
|
||||
<binary dest="${bundle}/Contents/MacOS/">
|
||||
|
||||
+3
-2
@@ -23,7 +23,7 @@ export GTK_PATH="$bundle_res"
|
||||
export PANGO_RC_FILE="$bundle_etc/pango/pangorc"
|
||||
export PANGO_SYSCONFDIR="$bundle_etc"
|
||||
export PANGO_LIBDIR="$bundle_lib"
|
||||
export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
|
||||
export GDK_PIXBUF_MODULE_FILE="$bundle_lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
|
||||
if [ `uname -r | cut -d . -f 1` -ge 10 ]; then
|
||||
export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules"
|
||||
fi
|
||||
@@ -40,7 +40,8 @@ export PYTHONPATH="$bundle_lib/python$PYVER/site-packages/gtk-2.0:$PYTHONPATH"
|
||||
|
||||
export GRAMPSDIR="$bundle_data"/gramps
|
||||
export GRAMPSI18N="$bundle_data"/locale
|
||||
export GRAMPSHOME="$HOME/Library/Application Support"
|
||||
export USERPROFILE="$HOME"
|
||||
export APPDATA="$HOME/Library/Application Support"
|
||||
|
||||
# Strip out the argument added by the OS.
|
||||
if /bin/expr "x$1" : '^x-psn_' > /dev/null; then
|
||||
|
||||
+11
-21
@@ -21,8 +21,8 @@
|
||||
href="http://download.oracle.com/"/>
|
||||
<repository type="tarball" name="pymodules"
|
||||
href="http://pypi.python.org/packages/source/"/>
|
||||
<repository type="tarball" name="stowers"
|
||||
href="http://www.johnstowers.co.nz/files/"/>
|
||||
<repository type="git" name="github"
|
||||
href="git://github.com/"/>
|
||||
<repository type="tarball" name="graphviz"
|
||||
href="http://www.graphviz.org/pub/graphviz/stable/SOURCES/"/>
|
||||
<repository type="tarball" name="launchpad"
|
||||
@@ -63,7 +63,7 @@ ige-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
|
||||
<!--include href="/Users/john/Development/GTK-OSX/gtk-osx-build/modulesets-stable/gtk-osx.modules"/-->
|
||||
|
||||
<autotools id="gramps" autogen-sh="configure">
|
||||
<branch module="gramps/gramps-3.4.7.tar.gz" version="3.4.7"
|
||||
<branch module="gramps/gramps-3.4.9.tar.gz" version="3.4.9"
|
||||
repo="sourceforge">
|
||||
</branch>
|
||||
<dependencies>
|
||||
@@ -74,7 +74,7 @@ ige-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
|
||||
<dep package="shared-mime-info"/>
|
||||
<dep package="hunspell"/>
|
||||
<dep package="pygtk-extras"/>
|
||||
<dep package="osmgpsmap-py"/>
|
||||
<dep package="osmgpsmap"/>
|
||||
<dep package="graphviz"/>
|
||||
<dep package="pyicu"/>
|
||||
</dependencies>
|
||||
@@ -93,7 +93,7 @@ ige-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
|
||||
<dep package="shared-mime-info"/>
|
||||
<dep package="hunspell"/>
|
||||
<dep package="pygtk-extras"/>
|
||||
<dep package="osmgpsmap-py"/>
|
||||
<dep package="osmgpsmap"/>
|
||||
<dep package="graphviz"/>
|
||||
</dependencies>
|
||||
<after>
|
||||
@@ -138,27 +138,15 @@ ige-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
|
||||
<branch module="xdg-utils-1.0.2.tgz" version="1.0.2" repo="xdg-utils"/>
|
||||
</autotools>
|
||||
|
||||
<autotools id="osmgpsmap" autogenargs="--disable-introspection"
|
||||
autogen-sh="configure">
|
||||
<branch module="osm-gps-map/osm-gps-map-0.7.3.tar.gz" repo="stowers"
|
||||
version="0.7.3"/>
|
||||
<autotools id="osmgpsmap" skip-autogen="never"
|
||||
supports-non-srcdir-builds="no">
|
||||
<branch module="nzjrs/osm-gps-map" revision="gtk2" repo="github"/>
|
||||
<dependencies>
|
||||
<dep package="gtk+"/>
|
||||
<dep package="libsoup"/>
|
||||
</dependencies>
|
||||
</autotools>
|
||||
|
||||
<distutils id="osmgpsmap-py" autogen-sh="gnome-autogen.sh">
|
||||
<branch module="osm-gps-map/python-osmgpsmap-0.7.3.tar.gz" repo="stowers"
|
||||
version="0.7.3"/>
|
||||
<dependencies>
|
||||
<dep package="osmgpsmap"/>
|
||||
<dep package="pygtk"/>
|
||||
<dep package="pycairo-python2.6"/>
|
||||
<dep package="pygobject"/>
|
||||
</dependencies>
|
||||
</distutils>
|
||||
|
||||
<autotools id="graphviz" autogen-sh="configure"
|
||||
autogenargs="--disable-sharp --disable-guile --disable-java --disable-lua --disable-ocaml --disable-perl --disable-php --disable-r --disable-ruby --disable-tcl --without-x --with-pangocairo --with-included-ltdl=yes">
|
||||
<branch module="graphviz-2.28.0.tar.gz" version="2.28.0" repo="graphviz"/>
|
||||
@@ -196,7 +184,9 @@ ige-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
|
||||
</autotools>
|
||||
|
||||
<distutils id="pil">
|
||||
<branch module="Imaging-1.1.7.tar.gz" version="1.1.7" repo="pythonware"/>
|
||||
<branch module="Imaging-1.1.7.tar.gz" version="1.1.7" repo="pythonware">
|
||||
<patch file="Imaging-Freetype2.patch" strip="1"/>
|
||||
</branch>
|
||||
</distutils>
|
||||
|
||||
<distutils id='pyicu'>
|
||||
|
||||
@@ -234,6 +234,7 @@ src/gui/editors/displaytabs/grampstab.py
|
||||
src/gui/editors/displaytabs/groupembeddedlist.py
|
||||
src/gui/editors/displaytabs/ldsmodel.py
|
||||
src/gui/editors/displaytabs/locationmodel.py
|
||||
src/gui/editors/displaytabs/mediaattrembedlist.py
|
||||
src/gui/editors/displaytabs/mediabackreflist.py
|
||||
src/gui/editors/displaytabs/notebackreflist.py
|
||||
src/gui/editors/displaytabs/personrefmodel.py
|
||||
|
||||
Executable → Regular
+33
@@ -115,6 +115,38 @@ class Check_named_fmt( Check ):
|
||||
msgstr = msg.msgstr[1]
|
||||
self.__process( msg, msgid, msgstr )
|
||||
|
||||
class Check_mapping_fmt( Check ):
|
||||
# A pattern to find all {}
|
||||
find_map_pat = re.compile('\{ \w+ \}', re.VERBOSE)
|
||||
|
||||
def __init__( self ):
|
||||
Check.__init__( self )
|
||||
self.diag_header = "-------- {} name mismatches --------------"
|
||||
self.summary_text = "{} name mismatches:"
|
||||
|
||||
def __process( self, msg, msgid, msgstr ):
|
||||
# Same number of named formats?
|
||||
fmts1 = self.find_map_pat.findall( msgid )
|
||||
fmts2 = self.find_map_pat.findall( msgstr )
|
||||
if len( fmts1 ) != len( fmts2 ):
|
||||
self.msgs.append( msg )
|
||||
else:
|
||||
# Do we have the same named formats?
|
||||
fmts1.sort()
|
||||
fmts2.sort()
|
||||
if fmts1 != fmts2:
|
||||
self.msgs.append( msg )
|
||||
|
||||
def process( self, msg ):
|
||||
msgid = msg.msgid
|
||||
msgstr = msg.msgstr[0]
|
||||
self.__process( msg, msgid, msgstr )
|
||||
|
||||
if msg.msgidp and len(msg.msgstr) >= 2:
|
||||
msgid = msg.msgidp
|
||||
msgstr = msg.msgstr[1]
|
||||
self.__process( msg, msgid, msgstr )
|
||||
|
||||
class Check_missing_sd( Check ):
|
||||
# A pattern to find %() without s or d
|
||||
# Here is a command to use for testing
|
||||
@@ -512,6 +544,7 @@ def analyze_msgs( options, fname, msgs, nr_templates = None, nth = 0 ):
|
||||
checks.append( Check_fmt( '%s' ) )
|
||||
checks.append( Check_fmt( '%d' ) )
|
||||
checks.append( Check_named_fmt() )
|
||||
checks.append( Check_mapping_fmt() )
|
||||
checks.append( Check_missing_sd() )
|
||||
checks.append( Check_runaway() )
|
||||
checks.append( Check_xml_chars() )
|
||||
|
||||
+728
-684
File diff suppressed because it is too large
Load Diff
@@ -62,7 +62,7 @@ msgstr ""
|
||||
"Project-Id-Version: gramps 3\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-03-19 09:09+0100\n"
|
||||
"PO-Revision-Date: 2014-03-23 02:42+0100\n"
|
||||
"PO-Revision-Date: 2014-09-27 23:38+0200\n"
|
||||
"Last-Translator: Luigi Toscano <luigi.toscano@tiscali.it>\n"
|
||||
"Language-Team: Italian <tp@lists.linux.it>\n"
|
||||
"Language: it\n"
|
||||
@@ -197,9 +197,8 @@ msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#: ../src/Bookmarks.py:393
|
||||
#, fuzzy
|
||||
msgid "Cannot bookmark this reference"
|
||||
msgstr "Impossibile condividere questo riferimento"
|
||||
msgstr "Impossibile creare un segnalibro per questo riferimento"
|
||||
|
||||
#: ../src/const.py:203
|
||||
msgid ""
|
||||
@@ -2141,9 +2140,8 @@ msgid "Database needs recovery, cannot open it!"
|
||||
msgstr "Il database deve essere ripristinato, non è possibile aprirlo!"
|
||||
|
||||
#: ../src/cli/arghandler.py:601 ../src/cli/arghandler.py:648
|
||||
#, fuzzy
|
||||
msgid "Ignoring invalid options string."
|
||||
msgstr "Stringa di opzioni non valida ignorata."
|
||||
msgstr "Ignorata stringa di opzioni non valida."
|
||||
|
||||
#. name exists, but is not in the list of valid report names
|
||||
#: ../src/cli/arghandler.py:624
|
||||
@@ -3216,7 +3214,6 @@ msgid "Informant"
|
||||
msgstr "Informatore/trice"
|
||||
|
||||
#: ../src/gen/lib/eventtype.py:139
|
||||
#, fuzzy
|
||||
msgid "Life Events"
|
||||
msgstr "Eventi della vita"
|
||||
|
||||
@@ -3864,7 +3861,7 @@ msgstr "Nota rifermento figlio"
|
||||
|
||||
#: ../src/gen/lib/person.py:458
|
||||
msgid "Merged Gramps ID"
|
||||
msgstr "Riordina ID Gramps"
|
||||
msgstr "ID Gramps fuso"
|
||||
|
||||
#: ../src/gen/lib/repotype.py:61
|
||||
msgid "Library"
|
||||
@@ -4273,9 +4270,8 @@ msgid "Left, top"
|
||||
msgstr "Da sinistra, dall'alto"
|
||||
|
||||
#: ../src/gen/plug/docgen/graphdoc.py:81
|
||||
#, fuzzy
|
||||
msgid "Compress to minimal size"
|
||||
msgstr "Compresso a dimensioni minimali"
|
||||
msgstr "Comprimi a dimensioni minimali"
|
||||
|
||||
#: ../src/gen/plug/docgen/graphdoc.py:82
|
||||
msgid "Fill the given area"
|
||||
@@ -6372,7 +6368,6 @@ msgid ""
|
||||
msgstr ""
|
||||
|
||||
#: ../src/gui/utils.py:488
|
||||
#, fuzzy
|
||||
msgid "Cannot open new citation editor"
|
||||
msgstr "Impossibile aprire un nuovo editor delle citazioni"
|
||||
|
||||
@@ -19023,7 +19018,7 @@ msgstr "Rimuove la persona selezionata"
|
||||
|
||||
#: ../src/plugins/lib/libpersonview.py:116
|
||||
msgid "Merge the selected persons"
|
||||
msgstr "Elimina la persona selezionata"
|
||||
msgstr "Fonde la persona selezionata"
|
||||
|
||||
#: ../src/plugins/lib/libpersonview.py:295
|
||||
msgid "Deleting the person will remove the person from the database."
|
||||
|
||||
@@ -166,8 +166,10 @@ class DateParserCZ(DateParser):
|
||||
}
|
||||
|
||||
quality_to_int = {
|
||||
u'přibližně' : Date.QUAL_ESTIMATED,
|
||||
u'odhadované' : Date.QUAL_ESTIMATED,
|
||||
u'odh.' : Date.QUAL_ESTIMATED,
|
||||
u'vypočteno' : Date.QUAL_CALCULATED,
|
||||
u'vypočtené' : Date.QUAL_CALCULATED,
|
||||
u'vyp.' : Date.QUAL_CALCULATED,
|
||||
}
|
||||
@@ -238,14 +240,14 @@ class DateDisplayCZ(DateDisplay):
|
||||
return date.get_text()
|
||||
elif start == Date.EMPTY:
|
||||
return ""
|
||||
elif mod == Date.MOD_NONE:
|
||||
date_decl_string = self.display_cal[cal](start)
|
||||
date_decl_string = date_decl_string.replace(u"den ", u"dna ")
|
||||
date_decl_string = date_decl_string.replace(u"or ", u"ora ")
|
||||
date_decl_string = date_decl_string.replace(u"en ", u"na ")
|
||||
date_decl_string = date_decl_string.replace(u"ad ", u"adu ")
|
||||
date_decl_string = date_decl_string.replace(u"ec ", u"ce ")
|
||||
return date_decl_string
|
||||
# elif mod == Date.MOD_NONE:
|
||||
# date_decl_string = self.display_cal[cal](start)
|
||||
# date_decl_string = date_decl_string.replace(u"den ", u"dna ")
|
||||
# date_decl_string = date_decl_string.replace(u"or ", u"ora ")
|
||||
# date_decl_string = date_decl_string.replace(u"en ", u"na ")
|
||||
# date_decl_string = date_decl_string.replace(u"ad ", u"adu ")
|
||||
# date_decl_string = date_decl_string.replace(u"ec ", u"ce ")
|
||||
# return date_decl_string
|
||||
elif mod == Date.MOD_SPAN:
|
||||
dat1 = self.display_cal[cal](start)
|
||||
dat2 = self.display_cal[cal](date.get_stop_date())
|
||||
|
||||
+235
-178
@@ -16,10 +16,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# DateHandler/_Date_sr.py
|
||||
# $Id$
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# Serbian version by Vlada Perić <vlada.peric@gmail.com>, 2009.
|
||||
@@ -28,7 +25,7 @@
|
||||
"""
|
||||
Serbian-specific classes for parsing and displaying dates.
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
@@ -57,153 +54,153 @@ class DateParserSR(DateParser):
|
||||
"""
|
||||
month_to_int = DateParser.month_to_int
|
||||
|
||||
month_to_int[u"januar"] = 1
|
||||
month_to_int[u"januara"] = 1
|
||||
month_to_int[u"jan"] = 1
|
||||
month_to_int[u"јан"] = 1
|
||||
month_to_int[u"јануара"] = 1
|
||||
month_to_int[u"јануар"] = 1
|
||||
month_to_int[u"i"] = 1
|
||||
month_to_int["januar"] = 1
|
||||
month_to_int["januara"] = 1
|
||||
month_to_int["jan"] = 1
|
||||
month_to_int["јан"] = 1
|
||||
month_to_int["јануара"] = 1
|
||||
month_to_int["јануар"] = 1
|
||||
month_to_int["i"] = 1
|
||||
|
||||
month_to_int[u"februar"] = 2
|
||||
month_to_int[u"februara"] = 2
|
||||
month_to_int[u"feb"] = 2
|
||||
month_to_int[u"феб"] = 2
|
||||
month_to_int[u"фебруар"] = 2
|
||||
month_to_int[u"фебруара"] = 2
|
||||
month_to_int[u"ii"] = 2
|
||||
month_to_int["februar"] = 2
|
||||
month_to_int["februara"] = 2
|
||||
month_to_int["feb"] = 2
|
||||
month_to_int["феб"] = 2
|
||||
month_to_int["фебруар"] = 2
|
||||
month_to_int["фебруара"] = 2
|
||||
month_to_int["ii"] = 2
|
||||
|
||||
month_to_int[u"mart"] = 3
|
||||
month_to_int[u"marta"] = 3
|
||||
month_to_int[u"mar"] = 3
|
||||
month_to_int[u"мар"] = 3
|
||||
month_to_int[u"март"] = 3
|
||||
month_to_int[u"марта"] = 3
|
||||
month_to_int[u"iii"] = 3
|
||||
month_to_int["mart"] = 3
|
||||
month_to_int["marta"] = 3
|
||||
month_to_int["mar"] = 3
|
||||
month_to_int["мар"] = 3
|
||||
month_to_int["март"] = 3
|
||||
month_to_int["марта"] = 3
|
||||
month_to_int["iii"] = 3
|
||||
|
||||
month_to_int[u"april"] = 4
|
||||
month_to_int[u"aprila"] = 4
|
||||
month_to_int[u"apr"] = 4
|
||||
month_to_int[u"апр"] = 4
|
||||
month_to_int[u"април"] = 4
|
||||
month_to_int[u"априла"] = 4
|
||||
month_to_int[u"iv"] = 4
|
||||
month_to_int["april"] = 4
|
||||
month_to_int["aprila"] = 4
|
||||
month_to_int["apr"] = 4
|
||||
month_to_int["апр"] = 4
|
||||
month_to_int["април"] = 4
|
||||
month_to_int["априла"] = 4
|
||||
month_to_int["iv"] = 4
|
||||
|
||||
month_to_int[u"maj"] = 5
|
||||
month_to_int[u"maja"] = 5
|
||||
month_to_int[u"мај"] = 5
|
||||
month_to_int[u"маја"] = 5
|
||||
month_to_int[u"v"] = 5
|
||||
month_to_int["maj"] = 5
|
||||
month_to_int["maja"] = 5
|
||||
month_to_int["мај"] = 5
|
||||
month_to_int["маја"] = 5
|
||||
month_to_int["v"] = 5
|
||||
|
||||
month_to_int[u"jun"] = 6
|
||||
month_to_int[u"juna"] = 6
|
||||
month_to_int[u"јун"] = 6
|
||||
month_to_int[u"јуна"] = 6
|
||||
month_to_int[u"vi"] = 6
|
||||
month_to_int["jun"] = 6
|
||||
month_to_int["juna"] = 6
|
||||
month_to_int["јун"] = 6
|
||||
month_to_int["јуна"] = 6
|
||||
month_to_int["vi"] = 6
|
||||
|
||||
month_to_int[u"jul"] = 7
|
||||
month_to_int[u"jula"] = 7
|
||||
month_to_int[u"јул"] = 7
|
||||
month_to_int[u"јула"] = 7
|
||||
month_to_int[u"vii"] = 7
|
||||
month_to_int["jul"] = 7
|
||||
month_to_int["jula"] = 7
|
||||
month_to_int["јул"] = 7
|
||||
month_to_int["јула"] = 7
|
||||
month_to_int["vii"] = 7
|
||||
|
||||
month_to_int[u"avgust"] = 8
|
||||
month_to_int[u"avgusta"] = 8
|
||||
month_to_int[u"avg"] = 8
|
||||
month_to_int[u"авг"] = 8
|
||||
month_to_int[u"август"] = 8
|
||||
month_to_int[u"августа"] = 8
|
||||
month_to_int[u"viii"] = 8
|
||||
month_to_int["avgust"] = 8
|
||||
month_to_int["avgusta"] = 8
|
||||
month_to_int["avg"] = 8
|
||||
month_to_int["авг"] = 8
|
||||
month_to_int["август"] = 8
|
||||
month_to_int["августа"] = 8
|
||||
month_to_int["viii"] = 8
|
||||
|
||||
month_to_int[u"septembar"] = 9
|
||||
month_to_int[u"septembra"] = 9
|
||||
month_to_int[u"sep"] = 9
|
||||
month_to_int[u"сеп"] = 9
|
||||
month_to_int[u"септембар"] = 9
|
||||
month_to_int[u"септембра"] = 9
|
||||
month_to_int[u"ix"] = 9
|
||||
month_to_int["septembar"] = 9
|
||||
month_to_int["septembra"] = 9
|
||||
month_to_int["sep"] = 9
|
||||
month_to_int["сеп"] = 9
|
||||
month_to_int["септембар"] = 9
|
||||
month_to_int["септембра"] = 9
|
||||
month_to_int["ix"] = 9
|
||||
|
||||
month_to_int[u"oktobar"] = 10
|
||||
month_to_int[u"oktobra"] = 10
|
||||
month_to_int[u"okt"] = 10
|
||||
month_to_int[u"окт"] = 10
|
||||
month_to_int[u"октобар"] = 10
|
||||
month_to_int[u"октобра"] = 10
|
||||
month_to_int[u"x"] = 10
|
||||
month_to_int["oktobar"] = 10
|
||||
month_to_int["oktobra"] = 10
|
||||
month_to_int["okt"] = 10
|
||||
month_to_int["окт"] = 10
|
||||
month_to_int["октобар"] = 10
|
||||
month_to_int["октобра"] = 10
|
||||
month_to_int["x"] = 10
|
||||
|
||||
month_to_int[u"novembar"] = 11
|
||||
month_to_int[u"novembra"] = 11
|
||||
month_to_int[u"nov"] = 11
|
||||
month_to_int[u"нов"] = 11
|
||||
month_to_int[u"новембар"] = 11
|
||||
month_to_int[u"новембра"] = 11
|
||||
month_to_int[u"xi"] = 11
|
||||
month_to_int["novembar"] = 11
|
||||
month_to_int["novembra"] = 11
|
||||
month_to_int["nov"] = 11
|
||||
month_to_int["нов"] = 11
|
||||
month_to_int["новембар"] = 11
|
||||
month_to_int["новембра"] = 11
|
||||
month_to_int["xi"] = 11
|
||||
|
||||
month_to_int[u"decembar"] = 12
|
||||
month_to_int[u"decembra"] = 12
|
||||
month_to_int[u"dec"] = 12
|
||||
month_to_int[u"дец"] = 12
|
||||
month_to_int[u"децембар"] = 12
|
||||
month_to_int[u"децембра"] = 12
|
||||
month_to_int[u"xii"] = 12
|
||||
month_to_int["decembar"] = 12
|
||||
month_to_int["decembra"] = 12
|
||||
month_to_int["dec"] = 12
|
||||
month_to_int["дец"] = 12
|
||||
month_to_int["децембар"] = 12
|
||||
month_to_int["децембра"] = 12
|
||||
month_to_int["xii"] = 12
|
||||
|
||||
modifier_to_int = {
|
||||
u'pre' : Date.MOD_BEFORE,
|
||||
u'posle' : Date.MOD_AFTER,
|
||||
u'oko' : Date.MOD_ABOUT,
|
||||
u'cca' : Date.MOD_ABOUT,
|
||||
'pre' : Date.MOD_BEFORE,
|
||||
'posle' : Date.MOD_AFTER,
|
||||
'oko' : Date.MOD_ABOUT,
|
||||
'cca' : Date.MOD_ABOUT,
|
||||
|
||||
u'пре' : Date.MOD_BEFORE,
|
||||
u'после' : Date.MOD_AFTER,
|
||||
u'око' : Date.MOD_ABOUT,
|
||||
'пре' : Date.MOD_BEFORE,
|
||||
'после' : Date.MOD_AFTER,
|
||||
'око' : Date.MOD_ABOUT,
|
||||
}
|
||||
|
||||
calendar_to_int = {
|
||||
u'gregorijanski' : Date.CAL_GREGORIAN,
|
||||
u'greg.' : Date.CAL_GREGORIAN,
|
||||
u'julijanski' : Date.CAL_JULIAN,
|
||||
u'jul.' : Date.CAL_JULIAN,
|
||||
u'hebrejski' : Date.CAL_HEBREW,
|
||||
u'hebr.' : Date.CAL_HEBREW,
|
||||
u'islamski' : Date.CAL_ISLAMIC,
|
||||
u'isl.' : Date.CAL_ISLAMIC,
|
||||
u'francuski republikanski': Date.CAL_FRENCH,
|
||||
u'franc.' : Date.CAL_FRENCH,
|
||||
u'persijski' : Date.CAL_PERSIAN,
|
||||
u'pers. ' : Date.CAL_PERSIAN,
|
||||
u'švedski' : Date.CAL_SWEDISH,
|
||||
u'šv.' : Date.CAL_SWEDISH,
|
||||
'gregorijanski' : Date.CAL_GREGORIAN,
|
||||
'greg.' : Date.CAL_GREGORIAN,
|
||||
'julijanski' : Date.CAL_JULIAN,
|
||||
'jul.' : Date.CAL_JULIAN,
|
||||
'hebrejski' : Date.CAL_HEBREW,
|
||||
'hebr.' : Date.CAL_HEBREW,
|
||||
'islamski' : Date.CAL_ISLAMIC,
|
||||
'isl.' : Date.CAL_ISLAMIC,
|
||||
'francuski republikanski': Date.CAL_FRENCH,
|
||||
'franc.' : Date.CAL_FRENCH,
|
||||
'persijski' : Date.CAL_PERSIAN,
|
||||
'pers. ' : Date.CAL_PERSIAN,
|
||||
'švedski' : Date.CAL_SWEDISH,
|
||||
'šv.' : Date.CAL_SWEDISH,
|
||||
|
||||
u'грегоријански' : Date.CAL_GREGORIAN,
|
||||
u'грег.' : Date.CAL_GREGORIAN,
|
||||
u'јулијански' : Date.CAL_JULIAN,
|
||||
u'јул.' : Date.CAL_JULIAN,
|
||||
u'хебрејски' : Date.CAL_HEBREW,
|
||||
u'хебр.' : Date.CAL_HEBREW,
|
||||
u'исламски' : Date.CAL_ISLAMIC,
|
||||
u'исл.' : Date.CAL_ISLAMIC,
|
||||
u'француски републикански': Date.CAL_FRENCH,
|
||||
u'франц.' : Date.CAL_FRENCH,
|
||||
u'персијски' : Date.CAL_PERSIAN,
|
||||
u'перс. ' : Date.CAL_PERSIAN,
|
||||
u'шведски' : Date.CAL_SWEDISH,
|
||||
u'шв' : Date.CAL_SWEDISH,
|
||||
'грегоријански' : Date.CAL_GREGORIAN,
|
||||
'грег.' : Date.CAL_GREGORIAN,
|
||||
'јулијански' : Date.CAL_JULIAN,
|
||||
'јул.' : Date.CAL_JULIAN,
|
||||
'хебрејски' : Date.CAL_HEBREW,
|
||||
'хебр.' : Date.CAL_HEBREW,
|
||||
'исламски' : Date.CAL_ISLAMIC,
|
||||
'исл.' : Date.CAL_ISLAMIC,
|
||||
'француски републикански': Date.CAL_FRENCH,
|
||||
'франц.' : Date.CAL_FRENCH,
|
||||
'персијски' : Date.CAL_PERSIAN,
|
||||
'перс. ' : Date.CAL_PERSIAN,
|
||||
'шведски' : Date.CAL_SWEDISH,
|
||||
'шв' : Date.CAL_SWEDISH,
|
||||
}
|
||||
|
||||
quality_to_int = {
|
||||
u'procenjeno' : Date.QUAL_ESTIMATED,
|
||||
u'pro.' : Date.QUAL_ESTIMATED,
|
||||
u'izračunato' : Date.QUAL_CALCULATED,
|
||||
u'izr.' : Date.QUAL_CALCULATED,
|
||||
'procenjeno' : Date.QUAL_ESTIMATED,
|
||||
'pro.' : Date.QUAL_ESTIMATED,
|
||||
'izračunato' : Date.QUAL_CALCULATED,
|
||||
'izr.' : Date.QUAL_CALCULATED,
|
||||
|
||||
u'процењено' : Date.QUAL_ESTIMATED,
|
||||
u'про.' : Date.QUAL_ESTIMATED,
|
||||
u'израчунато' : Date.QUAL_CALCULATED,
|
||||
u'изр.' : Date.QUAL_CALCULATED,
|
||||
'процењено' : Date.QUAL_ESTIMATED,
|
||||
'про.' : Date.QUAL_ESTIMATED,
|
||||
'израчунато' : Date.QUAL_CALCULATED,
|
||||
'изр.' : Date.QUAL_CALCULATED,
|
||||
}
|
||||
|
||||
bce = [u"пре нове ере", u"пре Христа", u"п.н.е."
|
||||
u"pre nove ere", u"pre Hrista", u"p.n.e."] + DateParser.bce
|
||||
bce = ["пре нове ере", "пре Христа", "п.н.е."
|
||||
"pre nove ere", "pre Hrista", "p.n.e."] + DateParser.bce
|
||||
|
||||
def init_strings(self):
|
||||
"""
|
||||
@@ -217,10 +214,10 @@ class DateParserSR(DateParser):
|
||||
# match Day.Month.Year.
|
||||
self._numeric = re.compile("((\d+)[/\. ])?\s*((\d+)[/\.])?\s*(\d+)\.?$")
|
||||
|
||||
_span_1 = [u'od', u'од']
|
||||
_span_2 = [u'do', u'до']
|
||||
_range_1 = [u'između', u'између']
|
||||
_range_2 = [u'i', u'и']
|
||||
_span_1 = ['od', 'од']
|
||||
_span_2 = ['do', 'до']
|
||||
_range_1 = ['između', 'између']
|
||||
_range_2 = ['i', 'и']
|
||||
self._span = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %
|
||||
('|'.join(_span_1), '|'.join(_span_2)),
|
||||
re.IGNORECASE)
|
||||
@@ -233,46 +230,15 @@ class DateParserSR(DateParser):
|
||||
# Serbian display
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class DateDisplaySR_latin(DateDisplay):
|
||||
class DateDisplaySR_Base(DateDisplay):
|
||||
"""
|
||||
Serbian (latin) date display class
|
||||
Serbian (base) date display class
|
||||
"""
|
||||
long_months = ("",
|
||||
u"januara", u"februara", u"marta", u"aprila",
|
||||
u"maja", u"juna", u"jula", u"avgusta",
|
||||
u"septembra", u"oktobra", u"novembra", u"decembra"
|
||||
)
|
||||
|
||||
short_months = ("",
|
||||
u"jan", u"feb", u"mar", u"apr", u"maj", u"jun",
|
||||
u"jul", u"avg", u"sep", u"okt", u"nov", u"dec"
|
||||
)
|
||||
|
||||
roman_months = (
|
||||
"", "I", "II", "III", "IV", "V", "VI",
|
||||
"VII", "VIII", "IX", "X", "XI", "XII"
|
||||
)
|
||||
|
||||
calendar = (
|
||||
"", u"julijanski", u"hebrejski",
|
||||
u"francuski republikanski", u"persijski", u"islamski",
|
||||
u"švedski"
|
||||
)
|
||||
|
||||
_mod_str = ("", "pre ", "posle ", "oko ", "", "", "")
|
||||
|
||||
_qual_str = ("", "procenjeno ", "izračunato ")
|
||||
|
||||
_bce_str = "%s p.n.e."
|
||||
|
||||
formats = (
|
||||
"GGGG-MM-DD (ISO-8601)",
|
||||
"Numerički (DD.MM.GGGG.)",
|
||||
"D. MMM GGGG.",
|
||||
"D. Mesec GGGG.",
|
||||
"D. Rb GGGG."
|
||||
)
|
||||
# this definition must agree with its "_display_gregorian" method
|
||||
|
||||
def _display_gregorian(self, date_val):
|
||||
"""
|
||||
@@ -299,27 +265,27 @@ class DateDisplaySR_latin(DateDisplay):
|
||||
# day. month_abbreviation year.
|
||||
if date_val[0] == 0:
|
||||
if date_val[1] == 0:
|
||||
value = u"%s." % year
|
||||
value = "%s." % year
|
||||
else:
|
||||
value = u"%s %s." % (self.short_months[date_val[1]], year)
|
||||
value = "%s %s." % (self.short_months[date_val[1]], year)
|
||||
else:
|
||||
value = u"%d. %s %s." % (date_val[0],
|
||||
self.short_months[date_val[1]], year)
|
||||
value = "%d. %s %s." % (date_val[0],
|
||||
self.short_months[date_val[1]], year)
|
||||
elif self.format == 3:
|
||||
# day. month_name year.
|
||||
if date_val[0] == 0:
|
||||
if date_val[1] == 0:
|
||||
value = u"%s." % year
|
||||
value = "%s." % year
|
||||
else:
|
||||
value = u"%s %s." % (self.long_months[date_val[1]], year)
|
||||
value = "%s %s." % (self.long_months[date_val[1]], year)
|
||||
else:
|
||||
value = u"%d. %s %s." % (date_val[0],
|
||||
self.long_months[date_val[1]], year)
|
||||
value = "%d. %s %s." % (date_val[0],
|
||||
self.long_months[date_val[1]], year)
|
||||
else:
|
||||
# day. Roman_number_month year.
|
||||
if date_val[0] == 0:
|
||||
if date_val[1] == 0:
|
||||
value = u"%s." % year
|
||||
value = "%s." % year
|
||||
else:
|
||||
value = "%s %s." % (self.roman_months[date_val[1]], year)
|
||||
else:
|
||||
@@ -341,6 +307,10 @@ class DateDisplaySR_latin(DateDisplay):
|
||||
newyear = date.get_new_year()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
span1 = self._span1
|
||||
span2 = self._span2
|
||||
range1 = self._range1
|
||||
range2 = self._range2
|
||||
|
||||
if mod == Date.MOD_TEXTONLY:
|
||||
return date.get_text()
|
||||
@@ -350,13 +320,13 @@ class DateDisplaySR_latin(DateDisplay):
|
||||
d_1 = self.display_cal[cal](start)
|
||||
d_2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'od', d_1, u'do', d_2,
|
||||
return "%s%s %s %s %s%s" % (qual_str, span1, d_1, span2, d_2,
|
||||
scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d_1 = self.display_cal[cal](start)
|
||||
d_2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'između', d_1, u'i', d_2,
|
||||
return "%s%s %s %s %s%s" % (qual_str, range1, d_1, range2, d_2,
|
||||
scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
@@ -364,11 +334,98 @@ class DateDisplaySR_latin(DateDisplay):
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text,
|
||||
scal)
|
||||
|
||||
class DateDisplaySR_Latin(DateDisplaySR_Base):
|
||||
"""
|
||||
Serbian (Latin) date display class
|
||||
"""
|
||||
|
||||
long_months = ("",
|
||||
"januara", "februara", "marta", "aprila",
|
||||
"maja", "juna", "jula", "avgusta",
|
||||
"septembra", "oktobra", "novembra", "decembra"
|
||||
)
|
||||
|
||||
short_months = ("",
|
||||
"jan", "feb", "mar", "apr", "maj", "jun",
|
||||
"jul", "avg", "sep", "okt", "nov", "dec"
|
||||
)
|
||||
|
||||
calendar = (
|
||||
"", "julijanski", "hebrejski",
|
||||
"francuski republikanski", "persijski", "islamski",
|
||||
"švedski"
|
||||
)
|
||||
|
||||
_mod_str = ("", "pre ", "posle ", "oko ", "", "", "")
|
||||
|
||||
_qual_str = ("", "procenjeno ", "izračunato ")
|
||||
|
||||
_bce_str = "%s p.n.e."
|
||||
|
||||
formats = (
|
||||
"GGGG-MM-DD (ISO-8601)",
|
||||
"Numerički (DD.MM.GGGG.)",
|
||||
"D. MMM GGGG.",
|
||||
"D. Mesec GGGG.",
|
||||
"D. Rb GGGG."
|
||||
)
|
||||
# this definition must agree with its "_display_gregorian" method
|
||||
|
||||
_span1 = 'od'
|
||||
_span2 = 'do'
|
||||
_range1 = 'između'
|
||||
_range2 = 'i'
|
||||
|
||||
class DateDisplaySR_Cyrillic(DateDisplaySR_Base):
|
||||
"""
|
||||
Serbian (Cyrillic) date display class
|
||||
"""
|
||||
|
||||
long_months = ("",
|
||||
"Јануар", "Фебруар", "Март", "Април",
|
||||
"Мај", "Јуне", "Јули", "Аугуст",
|
||||
"Септембар", "Оцтобер", "Новембер", "Децембар"
|
||||
)
|
||||
|
||||
short_months = ("",
|
||||
"Јан", "Феб", "Мар", "Апр", "Мај", "Јун",
|
||||
"Јул", "Авг", "Сеп", "Окт", "Нов", "Дец"
|
||||
)
|
||||
|
||||
calendar = (
|
||||
"", "Јулиан", "хебрејски",
|
||||
"француски републиканац", "Персиан", "исламски",
|
||||
"шведски"
|
||||
)
|
||||
|
||||
_mod_str = ("", "пре ", "после ", "око ", "", "", "")
|
||||
|
||||
_qual_str = ("", "процењено ", "израчунато ")
|
||||
|
||||
_bce_str = "%s п.н.е."
|
||||
|
||||
formats = (
|
||||
"ГГГГ-ММ-ДД (ISO-8601)",
|
||||
"Нумеричка (ДД.ММ.ГГГГ.)",
|
||||
"Д. МММ ГГГГ.",
|
||||
"Д. Месец ГГГГ.",
|
||||
"Д. Rb ГГГГ."
|
||||
)
|
||||
# this definition must agree with its "_display_gregorian" method
|
||||
|
||||
_span1 = 'из'
|
||||
_span2 = 'до'
|
||||
_range1 = 'између'
|
||||
_range2 = 'и'
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Register classes
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
register_datehandler(('sr', 'serbian', 'srpski', 'sr_RS'),
|
||||
DateParserSR, DateDisplaySR_latin)
|
||||
register_datehandler(('srpski', 'Srpski',
|
||||
'sr_Latn', 'sr_Latn_RS', 'sr_RS@latin'),
|
||||
DateParserSR, DateDisplaySR_Latin)
|
||||
register_datehandler(('sr', 'српски', 'Српски', 'serbian',
|
||||
'sr_RS', 'sr_Cyrl', 'sr_Cyrl_RS'),
|
||||
DateParserSR, DateDisplaySR_Cyrillic)
|
||||
|
||||
+90
-131
@@ -18,20 +18,17 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# DateHandler/_Date_zh.py
|
||||
# $Id$
|
||||
#
|
||||
|
||||
"""
|
||||
Simplified-Chinese-specific classes for parsing and displaying dates.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
"""
|
||||
Chinese-specific classes for parsing and displaying dates.
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import re
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -39,7 +36,6 @@ import re
|
||||
# GRAMPS modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
from gen.lib import Date
|
||||
from _DateParser import DateParser
|
||||
from _DateDisplay import DateDisplay
|
||||
@@ -47,147 +43,128 @@ from _DateHandler import register_datehandler
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Chinese parser
|
||||
# Simplified-Chinese parser
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class DateParserZH(DateParser):
|
||||
class DateParserZH_CN(DateParser):
|
||||
"""
|
||||
Convert a text string into a Date object. If the date cannot be
|
||||
converted, the text string is assigned.
|
||||
"""
|
||||
|
||||
# translate english strings into chinese
|
||||
|
||||
# modifiers before the date
|
||||
modifier_to_int = {
|
||||
u'before' : Date.MOD_BEFORE, u'bef' : Date.MOD_BEFORE,
|
||||
u'bef.' : Date.MOD_BEFORE, u'after' : Date.MOD_AFTER,
|
||||
u'aft' : Date.MOD_AFTER, u'aft.' : Date.MOD_AFTER,
|
||||
u'about' : Date.MOD_ABOUT, u'abt.' : Date.MOD_ABOUT,
|
||||
u'abt' : Date.MOD_ABOUT, u'circa' : Date.MOD_ABOUT,
|
||||
u'c.' : Date.MOD_ABOUT, u'around' : Date.MOD_ABOUT,
|
||||
'以前' : Date.MOD_BEFORE,
|
||||
'以后' : Date.MOD_AFTER,
|
||||
'大约' : Date.MOD_ABOUT,
|
||||
}
|
||||
|
||||
month_to_int = DateParser.month_to_int
|
||||
|
||||
month_to_int[u"正"] = 1
|
||||
month_to_int[u"一"] = 1
|
||||
month_to_int[u"zhēngyuè"] = 1
|
||||
month_to_int[u"二"] = 2
|
||||
month_to_int[u"èryuè"] = 2
|
||||
month_to_int[u"三"] = 3
|
||||
month_to_int[u"sānyuè"] = 3
|
||||
month_to_int[u"四"] = 4
|
||||
month_to_int[u"sìyuè"] = 4
|
||||
month_to_int[u"五"] = 5
|
||||
month_to_int[u"wǔyuè"] = 5
|
||||
month_to_int[u"六"] = 6
|
||||
month_to_int[u"liùyuè"] = 6
|
||||
month_to_int[u"七"] = 7
|
||||
month_to_int[u"qīyuè"] = 7
|
||||
month_to_int[u"八"] = 8
|
||||
month_to_int[u"bāyuè"] = 8
|
||||
month_to_int[u"九"] = 9
|
||||
month_to_int[u"jiǔyuè"] = 9
|
||||
month_to_int[u"十"] = 10
|
||||
month_to_int[u"shíyuè"] = 10
|
||||
month_to_int[u"十一"] = 11
|
||||
month_to_int[u"shíyīyuè"] = 11
|
||||
month_to_int[u"十二"] = 12
|
||||
month_to_int[u"shí'èryuè"] = 12
|
||||
month_to_int[u"假閏"] = 13
|
||||
month_to_int[u"jiǎ rùn yùe"] = 13
|
||||
|
||||
# translate english strings into chinese
|
||||
month_to_int["正"] = 1
|
||||
month_to_int["一"] = 1
|
||||
month_to_int["zhēngyuè"] = 1
|
||||
month_to_int["二"] = 2
|
||||
month_to_int["èryuè"] = 2
|
||||
month_to_int["三"] = 3
|
||||
month_to_int["sānyuè"] = 3
|
||||
month_to_int["四"] = 4
|
||||
month_to_int["sìyuè"] = 4
|
||||
month_to_int["五"] = 5
|
||||
month_to_int["wǔyuè"] = 5
|
||||
month_to_int["六"] = 6
|
||||
month_to_int["liùyuè"] = 6
|
||||
month_to_int["七"] = 7
|
||||
month_to_int["qīyuè"] = 7
|
||||
month_to_int["八"] = 8
|
||||
month_to_int["bāyuè"] = 8
|
||||
month_to_int["九"] = 9
|
||||
month_to_int["jiǔyuè"] = 9
|
||||
month_to_int["十"] = 10
|
||||
month_to_int["shíyuè"] = 10
|
||||
month_to_int["十一"] = 11
|
||||
month_to_int["shíyīyuè"] = 11
|
||||
month_to_int["十二"] = 12
|
||||
month_to_int["shí'èryuè"] = 12
|
||||
month_to_int["假閏"] = 13
|
||||
month_to_int["jiǎ rùn yùe"] = 13
|
||||
|
||||
calendar_to_int = {
|
||||
'gregorian' : Date.CAL_GREGORIAN,
|
||||
'阳历' : Date.CAL_GREGORIAN,
|
||||
'g' : Date.CAL_GREGORIAN,
|
||||
'julian' : Date.CAL_JULIAN,
|
||||
'儒略历' : Date.CAL_JULIAN,
|
||||
'j' : Date.CAL_JULIAN,
|
||||
'hebrew' : Date.CAL_HEBREW,
|
||||
'希伯来历' : Date.CAL_HEBREW,
|
||||
'h' : Date.CAL_HEBREW,
|
||||
'islamic' : Date.CAL_ISLAMIC,
|
||||
'伊斯兰历' : Date.CAL_ISLAMIC,
|
||||
'i' : Date.CAL_ISLAMIC,
|
||||
'french' : Date.CAL_FRENCH,
|
||||
'french republican': Date.CAL_FRENCH,
|
||||
'法国共和历' : Date.CAL_FRENCH,
|
||||
'f' : Date.CAL_FRENCH,
|
||||
'persian' : Date.CAL_PERSIAN,
|
||||
'伊郎历' : Date.CAL_PERSIAN,
|
||||
'p' : Date.CAL_PERSIAN,
|
||||
'swedish' : Date.CAL_SWEDISH,
|
||||
'瑞典历' : Date.CAL_SWEDISH,
|
||||
's' : Date.CAL_SWEDISH,
|
||||
}
|
||||
|
||||
# translate english strings into chinese
|
||||
|
||||
quality_to_int = {
|
||||
u'estimated' : Date.QUAL_ESTIMATED,
|
||||
u'est.' : Date.QUAL_ESTIMATED,
|
||||
u'est' : Date.QUAL_ESTIMATED,
|
||||
u'calc.' : Date.QUAL_CALCULATED,
|
||||
u'calc' : Date.QUAL_CALCULATED,
|
||||
u'calculated' : Date.QUAL_CALCULATED,
|
||||
'据估计' : Date.QUAL_ESTIMATED,
|
||||
'据计算' : Date.QUAL_CALCULATED,
|
||||
}
|
||||
|
||||
# translate english strings into chinese
|
||||
|
||||
bce = [u"before calendar", u"negative year"] + DateParser.bce
|
||||
# FIXME translate these English strings into simplified-Chinese ones
|
||||
bce = ["before calendar", "negative year"] + DateParser.bce
|
||||
|
||||
def init_strings(self):
|
||||
"""
|
||||
This method compiles regular expression strings for matching dates.
|
||||
|
||||
Most of the re's in most languages can stay as is. span and range
|
||||
most likely will need to change. Whatever change is done, this method
|
||||
may be called first as DateParser.init_strings(self) so that the
|
||||
invariant expresions don't need to be repeteadly coded. All differences
|
||||
can be coded after DateParser.init_strings(self) call, that way they
|
||||
override stuff from this method. See DateParserRU() as an example.
|
||||
"""
|
||||
DateParser.init_strings(self)
|
||||
|
||||
# day: 日 ; month : 月 ; year : 年
|
||||
|
||||
# See DateParser class; translate english strings (from/to, between/and) into chinese
|
||||
# do not translate <start> and <stop>
|
||||
|
||||
self._span = re.compile(u"(from)\s+(?P<start>.+)\s+to\s+(?P<stop>.+)",
|
||||
re.IGNORECASE)
|
||||
self._range = re.compile(u"(bet|bet.|between)\s+(?P<start>.+)\s+and\s+(?P<stop>.+)",
|
||||
re.IGNORECASE)
|
||||
_span_1 = ['自']
|
||||
_span_2 = ['至']
|
||||
_range_1 = ['介于']
|
||||
_range_2 = ['与']
|
||||
self._span = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %
|
||||
('|'.join(_span_1), '|'.join(_span_2)),
|
||||
re.IGNORECASE)
|
||||
self._range = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %
|
||||
('|'.join(_range_1), '|'.join(_range_2)),
|
||||
re.IGNORECASE)
|
||||
|
||||
#def _parse_lunisolar(self, date_val=text):
|
||||
#text = text.strip() # otherwise spaces can make it a bad date
|
||||
#date = Date(self._qual_str, self._mod_str, self._cal_str, text, self._ny_str)
|
||||
#return unicode(text)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Chinese display
|
||||
# Simplified-Chinese display
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class DateDisplayZH(DateDisplay):
|
||||
class DateDisplayZH_CN(DateDisplay):
|
||||
"""
|
||||
Chinese language date display class.
|
||||
Simplified-Chinese language date display class.
|
||||
"""
|
||||
|
||||
# translate english strings into chinese
|
||||
|
||||
long_months = ( u"", u"January", u"February", u"March", u"April", u"May",
|
||||
u"June", u"July", u"August", u"September", u"October",
|
||||
u"November", u"December" )
|
||||
# this is used to display the 12 gregorian months
|
||||
long_months = ( "", "正月", "二月", "三月", "四月", "五月",
|
||||
"六月", "七月", "八月", "九月", "十月",
|
||||
"十一月", "十二月" )
|
||||
|
||||
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" )
|
||||
short_months = ( "", "一月", "二月", "三月", "四月", "五月", "六月",
|
||||
"七月", "八月", "九月", "十月", "十一月", "十二月" )
|
||||
|
||||
formats = (
|
||||
"年年年年-月月-日日 (ISO)", "数字格式", "月 日,年",
|
||||
"月 日,年", "日 月 年", "日 月 年",
|
||||
)
|
||||
# this must agree with DateDisplayEn's "formats" definition
|
||||
# (since no locale-specific _display_gregorian exists, here)
|
||||
|
||||
calendar = (
|
||||
"", u"Julian", u"Hebrew", u"French Republican",
|
||||
u"Persian", u"Islamic", u"Swedish"
|
||||
"", "儒略历", "希伯来历", "法国共和历",
|
||||
"伊郎历", "伊斯兰历", "瑞典历"
|
||||
)
|
||||
|
||||
_mod_str = ("", u"before ", u"after ", u"around ", "", "", "")
|
||||
_mod_str = ("", "以前 ", "以后 ", "大约 ", "", "", "")
|
||||
|
||||
_qual_str = ("", u"estimated ", u"calculated ", "")
|
||||
_qual_str = ("", "据估计 ", "据计算 ", "")
|
||||
|
||||
# FIXME translate these English strings into simplified-Chinese ones
|
||||
_bce_str = "%s B.C.E."
|
||||
|
||||
|
||||
@@ -195,7 +172,6 @@ class DateDisplayZH(DateDisplay):
|
||||
"""
|
||||
Return a text string representing the date.
|
||||
"""
|
||||
|
||||
mod = date.get_modifier()
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
@@ -209,45 +185,28 @@ class DateDisplayZH(DateDisplay):
|
||||
elif start == Date.EMPTY:
|
||||
return ""
|
||||
elif mod == Date.MOD_SPAN:
|
||||
date1 = self.display_cal[cal](start)
|
||||
date2 = self.display_cal[cal](date.get_stop_date())
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
# translate english strings into chinese
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'from', date1, u'to',
|
||||
date2, scal)
|
||||
return "%s%s %s %s %s%s" % (qual_str, '自', d1, '至', d2, scal)
|
||||
elif mod == Date.MOD_RANGE:
|
||||
date1 = self.display_cal[cal](start)
|
||||
date2 = self.display_cal[cal](date.get_stop_date())
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
scal = self.format_extras(cal, newyear)
|
||||
# translate english strings into chinese
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'between', date1, u'and',
|
||||
date2, scal)
|
||||
return "%s%s %s %s %s%s之间" % (qual_str, '介于', d1, '与',
|
||||
d2, scal)
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
scal = self.format_extras(cal, newyear)
|
||||
return "%s%s%s%s" % (qual_str, (self._mod_str)[mod], text,
|
||||
scal)
|
||||
|
||||
#def _display_chinese(self, date_val):
|
||||
#self._tformat = '%Y年%m月%d日'
|
||||
#year = self._slash_year(date_val[2], date_val[3])
|
||||
#if date_val[3]:
|
||||
#return self.display_iso(date_val)
|
||||
#else:
|
||||
#if date_val[0] == date_val[1] == 0:
|
||||
#value = u'%Y年' % date_val[2]
|
||||
#else:
|
||||
#value = self._tformat.replace('%m月', str(self.lunisolar[date_val[1]]))
|
||||
#value = u'%m月' % date_val[1]
|
||||
#value = u'%d日' % date_val[0]
|
||||
#value = u'%Y年' % date_val[2]
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Register classes
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
register_datehandler(('zh_CN', 'zh_TW', 'zh_SG', 'zh_HK', 'zh', 'chinese', 'Chinese'),
|
||||
DateParserZH, DateDisplayZH)
|
||||
register_datehandler(('zh_CN', 'zh_SG', 'zh_TW', 'zh_HK',
|
||||
'zh', 'chinese', 'Chinese'),
|
||||
DateParserZH_CN, DateDisplayZH_CN)
|
||||
|
||||
+15
-11
@@ -392,7 +392,7 @@ class ArgHandler(object):
|
||||
@param: climan: the manager of a CLI session
|
||||
@type: CLIManager object
|
||||
"""
|
||||
|
||||
# Handle the "-l" List Family Trees option.
|
||||
if self.list:
|
||||
print _('List of known family trees in your database path\n').\
|
||||
encode(sys.getfilesystemencoding())
|
||||
@@ -403,6 +403,7 @@ class ArgHandler(object):
|
||||
'f_t_name' : name}).encode(sys.getfilesystemencoding())
|
||||
sys.exit(0)
|
||||
|
||||
# Handle the "-L" List Family Trees in detail option.
|
||||
if self.list_more:
|
||||
print _('Gramps Family Trees:').encode(sys.getfilesystemencoding())
|
||||
summary_list = self.dbman.family_tree_summary()
|
||||
@@ -418,25 +419,28 @@ class ArgHandler(object):
|
||||
encode(sys.getfilesystemencoding())
|
||||
sys.exit(0)
|
||||
|
||||
# Handle the "-t" List Family Trees, tab delimited option.
|
||||
if self.list_table:
|
||||
print _('Gramps Family Trees:').encode(sys.getfilesystemencoding())
|
||||
summary_list = self.dbman.family_tree_summary()
|
||||
print _("Family Tree").encode(sys.getfilesystemencoding()),
|
||||
if not summary_list:
|
||||
sys.exit(0)
|
||||
# We have to construct the line elements together, to avoid
|
||||
# insertion of blank spaces when print on the same line is used
|
||||
line_list = [_("Family Tree").encode(sys.getfilesystemencoding())]
|
||||
for key in sorted(summary_list[0]):
|
||||
if key != _("Family tree"):
|
||||
print "\t ",
|
||||
print key.encode(sys.getfilesystemencoding()),
|
||||
print
|
||||
line_list += [key.encode(sys.getfilesystemencoding())]
|
||||
print "\t".join(line_list)
|
||||
for summary in sorted(summary_list,
|
||||
key=lambda sum: sum[_("Family tree")].lower()):
|
||||
print '"%s"'.\
|
||||
encode(sys.getfilesystemencoding()) % summary[_("Family tree")],
|
||||
line_list = [('"%s"' % summary[_("Family tree")]).\
|
||||
encode(sys.getfilesystemencoding())]
|
||||
for item in sorted(summary):
|
||||
if item != _("Family tree"):
|
||||
print "\t ",
|
||||
print ('"%s"' % summary[item]).\
|
||||
encode(sys.getfilesystemencoding()),
|
||||
print
|
||||
line_list += [('"%s"' % summary[item]).\
|
||||
encode(sys.getfilesystemencoding())]
|
||||
print "\t".join(line_list)
|
||||
sys.exit(0)
|
||||
|
||||
self.__open_action()
|
||||
|
||||
+11
-1
@@ -238,6 +238,13 @@ class CLIManager(object):
|
||||
_("Family Tree does not exist, as it has been deleted."))
|
||||
return
|
||||
|
||||
if os.path.isfile(os.path.join(filename, "lock")):
|
||||
self._errordialog(
|
||||
_("The database is locked."),
|
||||
_("Use the --force-unlock option if you are sure "
|
||||
"that the database is not in use."))
|
||||
return
|
||||
|
||||
if self.db_loader.read_file(filename):
|
||||
# Attempt to figure out the database title
|
||||
path = os.path.join(filename, "name.txt")
|
||||
@@ -279,7 +286,10 @@ class CLIManager(object):
|
||||
# apply preferred researcher if loaded file has none
|
||||
res = self.dbstate.db.get_researcher()
|
||||
owner = get_researcher()
|
||||
if res.get_name() == "" and owner.get_name() != "":
|
||||
# If the DB Owner Info is empty and
|
||||
# [default] Researcher is not empty and
|
||||
# database is empty, then copy default researcher to DB owner
|
||||
if res.is_empty() and not owner.is_empty() and self.dbstate.db.is_empty():
|
||||
self.dbstate.db.set_researcher(owner)
|
||||
|
||||
name_displayer.set_name_format(self.dbstate.db.name_formats)
|
||||
|
||||
+3
-3
@@ -43,10 +43,10 @@ from gen.ggettext import sgettext as _
|
||||
#-------------------------------------------------------------------------
|
||||
PROGRAM_NAME = "Gramps"
|
||||
if "@VERSIONSTRING@" == "@" + "VERSIONSTRING" + "@":
|
||||
VERSION = "3.4.8"
|
||||
VERSION = "3.4.9"
|
||||
else:
|
||||
VERSION = "@VERSIONSTRING@"
|
||||
VERSION_TUPLE = (3, 4, 8)
|
||||
VERSION_TUPLE = (3, 4, 9)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -199,7 +199,7 @@ else:
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
COPYRIGHT_MSG = u"\u00A9 2001-2006 Donald N. Allingham\n" \
|
||||
u"\u00A9 2007-2014 The Gramps Developers"
|
||||
u"\u00A9 2007-2015 The Gramps Developers"
|
||||
COMMENTS = _("Gramps (Genealogical Research and Analysis "
|
||||
"Management Programming System) is a personal "
|
||||
"genealogy program.")
|
||||
|
||||
@@ -40,7 +40,7 @@ __all__ = (
|
||||
('DBPAGE', 'DBMODE', 'DBCACHE', 'DBLOCKS', 'DBOBJECTS', 'DBUNDO',
|
||||
'DBEXT', 'DBMODE_R', 'DBMODE_W', 'DBUNDOFN', 'DBLOCKFN',
|
||||
'DBRECOVFN','BDBVERSFN', 'DBLOGNAME', 'DBFLAGS_O', 'DBFLAGS_R',
|
||||
'DBFLAGS_D',
|
||||
'DBFLAGS_D', 'SCHVERSFN'
|
||||
) +
|
||||
|
||||
('PERSON_KEY', 'FAMILY_KEY', 'SOURCE_KEY', 'CITATION_KEY',
|
||||
@@ -56,6 +56,7 @@ DBUNDOFN = "undo.db" # File name of 'undo' database
|
||||
DBLOCKFN = "lock" # File name of lock file
|
||||
DBRECOVFN = "need_recover" # File name of recovery file
|
||||
BDBVERSFN = "bdbversion.txt"# File name of Berkeley DB version file
|
||||
SCHVERSFN = "schemaversion.txt"# File name of schema version file
|
||||
DBLOGNAME = ".Db" # Name of logger
|
||||
DBMODE_R = "r" # Read-only access
|
||||
DBMODE_W = "w" # Full Read/Write access
|
||||
|
||||
@@ -355,6 +355,7 @@ class DbBsddbRead(DbReadBase, Callback):
|
||||
self.citation_map = {}
|
||||
self.repository_map = {}
|
||||
self.note_map = {}
|
||||
self.tag_map = {}
|
||||
self.media_map = {}
|
||||
self.event_map = {}
|
||||
self.metadata = {}
|
||||
@@ -908,6 +909,18 @@ class DbBsddbRead(DbReadBase, Callback):
|
||||
"""
|
||||
return self.get_number_of_records(self.tag_map)
|
||||
|
||||
def is_empty(self):
|
||||
"""
|
||||
Return true if there are no [primary] records in the database
|
||||
"""
|
||||
for obj_map in [self.person_map, self.family_map, self.event_map,
|
||||
self.place_map, self.source_map, self.citation_map,
|
||||
self.media_map, self.repository_map, self.note_map,
|
||||
self.tag_map]:
|
||||
if self.get_number_of_records(obj_map) > 0:
|
||||
return False
|
||||
return True
|
||||
|
||||
def all_handles(self, table):
|
||||
return table.keys(txn=self.txn)
|
||||
|
||||
|
||||
+22
-1
@@ -558,6 +558,18 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
||||
|
||||
self.__check_python_version(name, force_python_upgrade)
|
||||
|
||||
# Check for schema upgrade
|
||||
versionpath = os.path.join(self.path, SCHVERSFN)
|
||||
if os.path.isfile(versionpath):
|
||||
with open(versionpath, "r") as version_file:
|
||||
schema_version = int(version_file.read().strip())
|
||||
else:
|
||||
schema_version = 0
|
||||
if not self.readonly and schema_version < _DBVERSION and \
|
||||
force_schema_upgrade:
|
||||
_LOG.debug("Make backup in case there is a schema upgrade")
|
||||
self.__make_zip_backup(name)
|
||||
|
||||
# Set up database environment
|
||||
self.env = db.DBEnv()
|
||||
self.env.set_cachesize(0, DBCACHE)
|
||||
@@ -664,7 +676,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
||||
versionpath = os.path.join(name, BDBVERSFN)
|
||||
with open(versionpath, "w") as version_file:
|
||||
version_file.write(str(db.version()))
|
||||
_LOG.debug("Updated BDBVERSFN file to %s" % str(db.version()))
|
||||
_LOG.debug("Updated bsddb version file to %s" % str(db.version()))
|
||||
|
||||
if self.update_python_version:
|
||||
versionpath = os.path.join(name, "pythonversion.txt")
|
||||
@@ -683,6 +695,10 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
||||
(oldschema, newschema))
|
||||
if force_schema_upgrade == True:
|
||||
self.gramps_upgrade(callback)
|
||||
versionpath = os.path.join(name, SCHVERSFN)
|
||||
with open(versionpath, "w") as version_file:
|
||||
version_file.write(str(_DBVERSION))
|
||||
_LOG.debug("Updated schema version file to %s" % str(_DBVERSION))
|
||||
else:
|
||||
self.__close_early()
|
||||
clear_lock_file(name)
|
||||
@@ -2125,6 +2141,11 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
||||
with open(versionpath, "w") as version_file:
|
||||
version_file.write(str(version_info[0]))
|
||||
|
||||
versionpath = os.path.join(name, SCHVERSFN)
|
||||
_LOG.debug("Write schema version file to %s" % str(_DBVERSION))
|
||||
with open(versionpath, "w") as version_file:
|
||||
version_file.write(str(_DBVERSION))
|
||||
|
||||
self.metadata.close()
|
||||
self.env.close()
|
||||
|
||||
|
||||
@@ -114,3 +114,10 @@ class Researcher(LocationBase):
|
||||
['name', 'addr', 'locality', 'city', 'state',
|
||||
'country', 'postal', 'phone', 'email']
|
||||
]
|
||||
|
||||
def is_empty(self):
|
||||
for attr in ['name', 'addr', 'locality', 'city', 'state',
|
||||
'country', 'postal', 'phone', 'email']:
|
||||
if getattr(self, attr) != "":
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -79,6 +79,7 @@ class FilterProxyDb(ProxyDbBase):
|
||||
person = self.db.get_person_from_handle(handle)
|
||||
if person:
|
||||
self.flist.update(person.get_family_handle_list())
|
||||
self.flist.update(person.get_parent_family_handle_list())
|
||||
|
||||
def get_person_from_handle(self, handle):
|
||||
"""
|
||||
|
||||
@@ -31,6 +31,7 @@ pkgpython_PYTHON = \
|
||||
locationembedlist.py \
|
||||
locationmodel.py \
|
||||
mediabackreflist.py \
|
||||
mediaattrembedlist.py \
|
||||
nameembedlist.py \
|
||||
namemodel.py \
|
||||
notebackreflist.py \
|
||||
|
||||
@@ -47,6 +47,7 @@ from familyldsembedlist import FamilyLdsEmbedList
|
||||
from gallerytab import GalleryTab
|
||||
from ldsembedlist import LdsEmbedList
|
||||
from locationembedlist import LocationEmbedList
|
||||
from mediaattrembedlist import MediaAttrEmbedList
|
||||
from mediabackreflist import MediaBackRefList
|
||||
from nameembedlist import NameEmbedList
|
||||
from notebackreflist import NoteBackRefList
|
||||
|
||||
@@ -152,8 +152,4 @@ class EventRefModel(gtk.TreeStore):
|
||||
return u""
|
||||
|
||||
def column_participant(self, event_ref):
|
||||
if int(event_ref.get_role()) not in (EventRoleType.PRIMARY,
|
||||
EventRoleType.FAMILY):
|
||||
return Utils.get_participant_from_event(self.db, event_ref.ref)
|
||||
else:
|
||||
return ""
|
||||
return Utils.get_participant_from_event(self.db, event_ref.ref)
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2014 Nick Hall
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps classes
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from attrembedlist import AttrEmbedList
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# MediaAttrEmbedList
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class MediaAttrEmbedList(AttrEmbedList):
|
||||
|
||||
def __init__(self, dbstate, uistate, track, data):
|
||||
AttrEmbedList.__init__(self, dbstate, uistate, track, data)
|
||||
|
||||
def get_editor(self):
|
||||
from .. import EditAttribute
|
||||
return EditAttribute
|
||||
|
||||
def get_user_values(self):
|
||||
return self.dbstate.db.get_media_attribute_types()
|
||||
@@ -51,7 +51,7 @@ import Utils
|
||||
from editprimary import EditPrimary
|
||||
from gui.widgets import (MonitoredDate, MonitoredEntry, PrivacyButton,
|
||||
MonitoredTagList)
|
||||
from displaytabs import (CitationEmbedList, AttrEmbedList, NoteTab,
|
||||
from displaytabs import (CitationEmbedList, MediaAttrEmbedList, NoteTab,
|
||||
MediaBackRefList)
|
||||
from addmedia import AddMediaObject
|
||||
from QuestionDialog import ErrorDialog
|
||||
@@ -200,7 +200,7 @@ class EditMedia(EditPrimary):
|
||||
self._add_tab(notebook, self.citation_tab)
|
||||
self.track_ref_for_deletion("citation_tab")
|
||||
|
||||
self.attr_tab = AttrEmbedList(self.dbstate,
|
||||
self.attr_tab = MediaAttrEmbedList(self.dbstate,
|
||||
self.uistate,
|
||||
self.track,
|
||||
self.obj.get_attribute_list())
|
||||
|
||||
@@ -51,7 +51,7 @@ import Utils
|
||||
from gen.lib import NoteType
|
||||
from gen.db import DbTxn
|
||||
from glade import Glade
|
||||
from displaytabs import (CitationEmbedList, AttrEmbedList, MediaBackRefList,
|
||||
from displaytabs import (CitationEmbedList, MediaAttrEmbedList, MediaBackRefList,
|
||||
NoteTab)
|
||||
from gui.widgets import (MonitoredSpinButton, MonitoredEntry, PrivacyButton,
|
||||
MonitoredDate, MonitoredTagList)
|
||||
@@ -615,7 +615,7 @@ class EditMediaRef(EditReference):
|
||||
self._add_tab(notebook_ref, self.srcref_list)
|
||||
self.track_ref_for_deletion("srcref_list")
|
||||
|
||||
self.attr_list = AttrEmbedList(self.dbstate,self.uistate,self.track,
|
||||
self.attr_list = MediaAttrEmbedList(self.dbstate,self.uistate,self.track,
|
||||
self.source_ref.get_attribute_list())
|
||||
self._add_tab(notebook_ref, self.attr_list)
|
||||
self.track_ref_for_deletion("attr_list")
|
||||
@@ -640,7 +640,7 @@ class EditMediaRef(EditReference):
|
||||
self._add_tab(notebook_src, self.src_srcref_list)
|
||||
self.track_ref_for_deletion("src_srcref_list")
|
||||
|
||||
self.src_attr_list = AttrEmbedList(self.dbstate,self.uistate,self.track,
|
||||
self.src_attr_list = MediaAttrEmbedList(self.dbstate,self.uistate,self.track,
|
||||
self.source.get_attribute_list())
|
||||
self._add_tab(notebook_src, self.src_attr_list)
|
||||
self.track_ref_for_deletion("src_attr_list")
|
||||
|
||||
@@ -237,6 +237,9 @@ class GuiColorOption(gtk.ColorButton):
|
||||
self.changekey = self.connect('color-set', self.__color_changed)
|
||||
self.valuekey = self.__option.connect('value-changed', self.__value_changed)
|
||||
|
||||
self.conkey = self.__option.connect('avail-changed', self.__update_avail)
|
||||
self.__update_avail()
|
||||
|
||||
self.set_tooltip_text(self.__option.get_help())
|
||||
|
||||
def __color_changed(self, obj): # IGNORE:W0613 - obj is unused
|
||||
@@ -253,6 +256,13 @@ class GuiColorOption(gtk.ColorButton):
|
||||
self.__option.set_value(value)
|
||||
self.__option.enable_signals()
|
||||
|
||||
def __update_avail(self):
|
||||
"""
|
||||
Update the availability (sensitivity) of this widget.
|
||||
"""
|
||||
avail = self.__option.get_available()
|
||||
self.set_sensitive(avail)
|
||||
|
||||
def __value_changed(self):
|
||||
"""
|
||||
Handle the change made programmatically
|
||||
@@ -266,6 +276,7 @@ class GuiColorOption(gtk.ColorButton):
|
||||
remove stuff that blocks garbage collection
|
||||
"""
|
||||
self.__option.disconnect(self.valuekey)
|
||||
self.__option.disconnect(self.conkey)
|
||||
self.__option = None
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -533,13 +533,20 @@ class ReportDialog(ManagedWindow.ManagedWindow):
|
||||
# we will need to create the file/dir
|
||||
# need to make sure we can create in the parent dir
|
||||
parent_dir = os.path.dirname(os.path.normpath(self.target_path))
|
||||
if not os.access(parent_dir, os.W_OK):
|
||||
ErrorDialog(_('Permission problem'),
|
||||
_("You do not have permission to create "
|
||||
"%s\n\n"
|
||||
"Please select another path or correct "
|
||||
"the permissions.") % self.target_path
|
||||
)
|
||||
if os.path.isdir(parent_dir):
|
||||
if not os.access(parent_dir, os.W_OK):
|
||||
ErrorDialog(_('Permission problem'),
|
||||
_("You do not have permission to create "
|
||||
"%s\n\n"
|
||||
"Please select another path or correct "
|
||||
"the permissions.") % self.target_path
|
||||
)
|
||||
return None
|
||||
else:
|
||||
ErrorDialog(_('No directory'),
|
||||
_('There is no directory %s.\n\n'
|
||||
'Please select another directory '
|
||||
'or create it.') % parent_dir )
|
||||
return None
|
||||
|
||||
self.set_default_directory(os.path.dirname(self.target_path) + os.sep)
|
||||
|
||||
@@ -79,7 +79,7 @@ class SelectPerson(BaseSelector):
|
||||
(_('Death Date'), 150, BaseSelector.MARKUP, 5),
|
||||
(_('Death Place'), 150, BaseSelector.MARKUP, 6),
|
||||
(_('Spouse'), 150, BaseSelector.TEXT, 7),
|
||||
(_('Last Change'), 150, BaseSelector.TEXT, 8)
|
||||
(_('Last Change'), 150, BaseSelector.TEXT, 9)
|
||||
]
|
||||
|
||||
def get_from_handle_func(self):
|
||||
|
||||
@@ -380,7 +380,7 @@ class ViewManager(CLIManager):
|
||||
hpane.add2(self.notebook)
|
||||
self.menubar = self.uimanager.get_widget('/MenuBar')
|
||||
self.toolbar = self.uimanager.get_widget('/ToolBar')
|
||||
vbox.pack_start(self.menubar, False)
|
||||
self.__attach_menubar(vbox)
|
||||
vbox.pack_start(self.toolbar, False)
|
||||
vbox.add(hpane)
|
||||
vbox.pack_end(self.__setup_statusbar(), False)
|
||||
@@ -857,6 +857,9 @@ class ViewManager(CLIManager):
|
||||
|
||||
self.uimanager.add_ui_from_string(UIDEFAULT)
|
||||
self.uimanager.ensure_update()
|
||||
|
||||
def __attach_menubar(self, vbox):
|
||||
vbox.pack_start(self.menubar, False, True, 0)
|
||||
if _GTKOSXAPPLICATION:
|
||||
menubar = self.uimanager.get_widget("/MenuBar")
|
||||
menubar.hide()
|
||||
|
||||
@@ -56,6 +56,7 @@ class DateEntry(gtk.HBox):
|
||||
def __init__(self, uistate, track):
|
||||
gtk.HBox.__init__(self)
|
||||
self.entry = ValidatableMaskedEntry()
|
||||
self.entry.set_width_chars(13)
|
||||
self.pack_start(self.entry, True, True, 0)
|
||||
image = gtk.Image()
|
||||
image.set_from_stock('gramps-date-edit', gtk.ICON_SIZE_BUTTON)
|
||||
|
||||
@@ -958,6 +958,7 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc):
|
||||
'<style:style ' +
|
||||
'style:name="Single_%s" ' % str(style[1]) +
|
||||
'style:family="graphic" ' +
|
||||
'style:parent-style-name="photo">' +
|
||||
'<style:graphic-properties ' +
|
||||
'style:vertical-pos="from-top" ' +
|
||||
'style:mirror="none" ' +
|
||||
|
||||
@@ -86,7 +86,7 @@ class SvgDrawDoc(BaseDoc, DrawDoc):
|
||||
'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n' +
|
||||
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" ' +
|
||||
'"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">\n' +
|
||||
'<svg width="%5.2fcm" height="%5.2fcm" '
|
||||
'<svg width="%4.2fcm" height="%4.2fcm" '
|
||||
% (self.paper.get_size().get_width(),
|
||||
self.paper.get_size().get_height()) +
|
||||
'xmlns="http://www.w3.org/2000/svg">\n'
|
||||
@@ -120,7 +120,7 @@ class SvgDrawDoc(BaseDoc, DrawDoc):
|
||||
self.t.write('font-weight:bold;')
|
||||
if font.get_italic():
|
||||
self.t.write('font-style:italic;')
|
||||
self.t.write('font-size:%d; ' % size)
|
||||
self.t.write('font-size:%dpt; ' % size)
|
||||
if font.get_type_face() == FONT_SANS_SERIF:
|
||||
self.t.write('font-family:sans-serif;')
|
||||
else:
|
||||
@@ -193,12 +193,13 @@ class SvgDrawDoc(BaseDoc, DrawDoc):
|
||||
|
||||
style_sheet = self.get_style_sheet()
|
||||
box_style = style_sheet.get_draw_style(style)
|
||||
shadow_width = box_style.get_shadow_space()
|
||||
|
||||
if box_style.get_shadow():
|
||||
if box_style.get_shadow() and shadow_width > 0:
|
||||
self.f.write(
|
||||
'<rect ' +
|
||||
'x="%4.2fcm" ' % (x+0.15) +
|
||||
'y="%4.2fcm" ' % (y+0.15) +
|
||||
'x="%4.2fcm" ' % (x + shadow_width) +
|
||||
'y="%4.2fcm" ' % (y + shadow_width) +
|
||||
'width="%4.2fcm" ' % w +
|
||||
'height="%4.2fcm" ' % h +
|
||||
'style="fill:#808080; stroke:#808080; stroke-width:1;"/>\n'
|
||||
@@ -241,7 +242,7 @@ class SvgDrawDoc(BaseDoc, DrawDoc):
|
||||
self.t.write(' font-weight:bold;')
|
||||
if font.get_italic():
|
||||
self.t.write(' font-style:italic;')
|
||||
self.t.write(' font-size:%d;' % font_size)
|
||||
self.t.write(' font-size:%dpt;' % font_size)
|
||||
if font.get_type_face() == FONT_SANS_SERIF:
|
||||
self.t.write(' font-family:sans-serif;')
|
||||
else:
|
||||
@@ -274,7 +275,7 @@ class SvgDrawDoc(BaseDoc, DrawDoc):
|
||||
self.t.write('font-weight:bold;')
|
||||
if font.get_italic():
|
||||
self.t.write('font-style:italic;')
|
||||
self.t.write('font-size:%d; ' % font_size)
|
||||
self.t.write('font-size:%dpt; ' % font_size)
|
||||
if font.get_type_face() == FONT_SANS_SERIF:
|
||||
self.t.write('font-family:sans-serif;')
|
||||
else:
|
||||
|
||||
@@ -536,6 +536,7 @@ class GedcomWriter(UpdateCallback):
|
||||
extract the real event to discover the event type.
|
||||
|
||||
"""
|
||||
adop_written = False
|
||||
for event_ref in person.get_event_ref_list():
|
||||
event = self.dbase.get_event_from_handle(event_ref.ref)
|
||||
etype = int(event.get_type())
|
||||
@@ -575,10 +576,14 @@ class GedcomWriter(UpdateCallback):
|
||||
if descr:
|
||||
self.__writeln(2, 'NOTE', "Description: " + descr)
|
||||
self.__dump_event_stats(event, event_ref)
|
||||
if etype == gen.lib.EventType.ADOPT and not adop_written:
|
||||
adop_written = True
|
||||
self.__adoption_records(person, adop_written)
|
||||
|
||||
self.__adoption_records(person)
|
||||
if not adop_written:
|
||||
self.__adoption_records(person, adop_written)
|
||||
|
||||
def __adoption_records(self, person):
|
||||
def __adoption_records(self, person, adop_written):
|
||||
"""
|
||||
Write Adoption events for each child that has been adopted.
|
||||
|
||||
@@ -602,7 +607,8 @@ class GedcomWriter(UpdateCallback):
|
||||
adoptions.append((family, child_ref.frel, child_ref.mrel))
|
||||
|
||||
for (fam, frel, mrel) in adoptions:
|
||||
self.__writeln(1, 'ADOP', 'Y')
|
||||
if not adop_written:
|
||||
self.__writeln(1, 'ADOP', 'Y')
|
||||
self.__writeln(2, 'FAMC', '@%s@' % fam.get_gramps_id())
|
||||
if mrel == frel:
|
||||
self.__writeln(3, 'ADOP', 'BOTH')
|
||||
@@ -1164,16 +1170,22 @@ class GedcomWriter(UpdateCallback):
|
||||
cal = date.get_calendar()
|
||||
mod = date.get_modifier()
|
||||
quality = date.get_quality()
|
||||
if quality in libgedcom.DATE_QUALITY:
|
||||
qual_text = libgedcom.DATE_QUALITY[quality] + " "
|
||||
else:
|
||||
qual_text = ""
|
||||
if mod == gen.lib.Date.MOD_SPAN:
|
||||
val = "FROM %s TO %s" % (
|
||||
libgedcom.make_gedcom_date(start, cal, mod, quality),
|
||||
val = "%sFROM %s TO %s" % (
|
||||
qual_text,
|
||||
libgedcom.make_gedcom_date(start, cal, mod, None),
|
||||
libgedcom.make_gedcom_date(date.get_stop_date(),
|
||||
cal, mod, quality))
|
||||
cal, mod, None))
|
||||
elif mod == gen.lib.Date.MOD_RANGE:
|
||||
val = "BET %s AND %s" % (
|
||||
libgedcom.make_gedcom_date(start, cal, mod, quality),
|
||||
val = "%sBET %s AND %s" % (
|
||||
qual_text,
|
||||
libgedcom.make_gedcom_date(start, cal, mod, None),
|
||||
libgedcom.make_gedcom_date(date.get_stop_date(),
|
||||
cal, mod, quality))
|
||||
cal, mod, None))
|
||||
else:
|
||||
val = libgedcom.make_gedcom_date(start, cal, mod, quality)
|
||||
self.__writeln(level, 'DATE', val)
|
||||
@@ -1305,7 +1317,8 @@ class GedcomWriter(UpdateCallback):
|
||||
note_list = [ n.handle for n in note_list
|
||||
if n and n.get_type() != gen.lib.NoteType.SOURCE_TEXT]
|
||||
self.__note_references(note_list, level+1)
|
||||
self.__photos(citation.get_media_list(), level+1)
|
||||
|
||||
self.__photos(citation.get_media_list(), level+1)
|
||||
|
||||
if "EVEN" in citation.get_data_map().keys():
|
||||
self.__writeln(level+1, "EVEN", citation.get_data_map()["EVEN"])
|
||||
|
||||
@@ -140,6 +140,12 @@ class GrampsXmlWriter(UpdateCallback):
|
||||
"Please make sure you have write access to the "
|
||||
"directory and try again."))
|
||||
return 0
|
||||
else:
|
||||
raise DbWriteFailure(_('No directory'),
|
||||
_('There is no directory %s.\n\n'
|
||||
'Please select another directory '
|
||||
'or create it.') % base )
|
||||
return 0
|
||||
|
||||
if os.path.exists(filename):
|
||||
if not os.access(filename, os.W_OK):
|
||||
|
||||
@@ -95,10 +95,8 @@ class Events(Gramplet, DbGUIElement):
|
||||
if spouse:
|
||||
participants = name_displayer.display(spouse)
|
||||
|
||||
if int(event_ref.get_role()) not in (EventRoleType.PRIMARY,
|
||||
EventRoleType.FAMILY):
|
||||
participants = Utils.get_participant_from_event(self.dbstate.db,
|
||||
event_ref.ref)
|
||||
participants = Utils.get_participant_from_event(self.dbstate.db,
|
||||
event_ref.ref)
|
||||
|
||||
self.model.add((event.get_handle(),
|
||||
str(event.get_type()),
|
||||
@@ -165,6 +163,9 @@ class PersonEvents(Events):
|
||||
Display the events for the active person.
|
||||
"""
|
||||
active_person = self.dbstate.db.get_person_from_handle(active_handle)
|
||||
if not active_person:
|
||||
self.set_has_data(self.model.count > 0)
|
||||
return
|
||||
for event_ref in active_person.get_event_ref_list():
|
||||
self.add_event_ref(event_ref)
|
||||
for family_handle in active_person.get_family_handle_list():
|
||||
|
||||
@@ -66,7 +66,8 @@ class LogGramplet(Gramplet):
|
||||
lambda handles: self.log('Family', 'Edited', handles))
|
||||
|
||||
def active_changed(self, handle):
|
||||
self.log('Person', 'Selected', [handle])
|
||||
if handle:
|
||||
self.log('Person', 'Selected', [handle])
|
||||
|
||||
def log(self, ltype, action, handles):
|
||||
for handle in set(handles):
|
||||
|
||||
@@ -356,7 +356,7 @@ class GeneWebParser(object):
|
||||
|
||||
def read_children_source_line(self,line,fields):
|
||||
csrc = self.get_or_create_source(self.decode(fields[1]))
|
||||
self.current_child_source_handle = csrc
|
||||
self.current_child_source_handle = csrc.handle
|
||||
return None
|
||||
|
||||
def read_family_comment(self,line,fields):
|
||||
|
||||
@@ -478,6 +478,10 @@ class GrampsParser(UpdateCallback):
|
||||
self.replace_import_handle = (self.db.get_number_of_people() > 0 and
|
||||
not LOG.isEnabledFor(logging.DEBUG))
|
||||
|
||||
# Similarly, if the data is imported into an empty family tree, we also
|
||||
# import the Researcher; if the tree was not empty, the existing
|
||||
# Researcher is retained
|
||||
self.import_researcher = self.db.is_empty()
|
||||
self.ord = None
|
||||
self.objref = None
|
||||
self.object = None
|
||||
@@ -633,7 +637,8 @@ class GrampsParser(UpdateCallback):
|
||||
"datestr": (self.start_datestr, None),
|
||||
"places": (None, self.stop_places),
|
||||
"placeobj": (self.start_placeobj, self.stop_placeobj),
|
||||
"ptitle": (None, self.stop_ptitle),
|
||||
"ptitle": (None, self.stop_ptitle),
|
||||
"locality": (None, self.stop_locality),
|
||||
"location": (self.start_location, None),
|
||||
"lds_ord": (self.start_lds_ord, self.stop_lds_ord),
|
||||
"temple": (self.start_temple, None),
|
||||
@@ -896,7 +901,10 @@ class GrampsParser(UpdateCallback):
|
||||
# Register new formats
|
||||
name_displayer.set_name_format(self.db.name_formats)
|
||||
|
||||
self.db.set_researcher(self.owner)
|
||||
# If the database was originally empty we update the researcher from
|
||||
# the XML (or initialised to no researcher)
|
||||
if self.import_researcher:
|
||||
self.db.set_researcher(self.owner)
|
||||
if self.home is not None:
|
||||
person = self.db.get_person_from_handle(self.home)
|
||||
self.db.set_default_person_handle(person.handle)
|
||||
|
||||
+194
-110
@@ -735,9 +735,9 @@ class Lexer(object):
|
||||
line = line.split('@', 2)
|
||||
# line is now [None, alphanum+pointer_string, rest]
|
||||
tag = '@' + line[1] + '@'
|
||||
line_value = line[2]
|
||||
line_value = line[2].lstrip()
|
||||
## Ignore meaningless @IDENT@ on CONT or CONC line
|
||||
## as detailed at http://www.tamurajones.net/IdentCONT.xhtml
|
||||
## as noted at http://www.tamurajones.net/IdentCONT.xhtml
|
||||
if (line_value.lstrip().startswith("CONT ") or
|
||||
line_value.lstrip().startswith("CONC ")):
|
||||
line = line_value.lstrip().partition(' ')
|
||||
@@ -757,6 +757,10 @@ class Lexer(object):
|
||||
if func:
|
||||
func(data)
|
||||
else:
|
||||
# There will normally only be one space between tag and
|
||||
# line_value, but in case there is more then one, remove extra
|
||||
# spaces after CONC/CONT processing
|
||||
data = data[:2] + (data[2].strip(),) + data[3:]
|
||||
self.current_list.insert(0, data)
|
||||
|
||||
def clean_up(self):
|
||||
@@ -1744,6 +1748,7 @@ class GedcomParser(UpdateCallback):
|
||||
|
||||
__TRUNC_MSG = _("Your GEDCOM file is corrupted. "
|
||||
"It appears to have been truncated.")
|
||||
_EMPTY_LOC = gen.lib.Location().serialize()
|
||||
|
||||
SyntaxError = "Syntax Error"
|
||||
BadFile = "Not a GEDCOM file"
|
||||
@@ -1805,6 +1810,7 @@ class GedcomParser(UpdateCallback):
|
||||
self.number_of_errors = 0
|
||||
self.maxpeople = stage_one.get_person_count()
|
||||
self.dbase = dbase
|
||||
self.import_researcher = self.dbase.is_empty()
|
||||
self.emapper = IdFinder(dbase.get_gramps_ids(EVENT_KEY),
|
||||
dbase.event_prefix)
|
||||
self.famc_map = stage_one.get_famc_map()
|
||||
@@ -2222,12 +2228,12 @@ class GedcomParser(UpdateCallback):
|
||||
TOKEN_CTRY : self.__location_ctry,
|
||||
# Not legal GEDCOM - not clear why these are included at this level
|
||||
TOKEN_ADDR : self.__ignore,
|
||||
TOKEN_DATE : self.__location_date,
|
||||
TOKEN_DATE : self.__ignore, # there is nowhere to put a date
|
||||
TOKEN_NOTE : self.__location_note,
|
||||
TOKEN_RNOTE : self.__location_note,
|
||||
TOKEN__LOC : self.__ignore,
|
||||
TOKEN__NAME : self.__ignore,
|
||||
TOKEN_PHON : self.__ignore,
|
||||
TOKEN_PHON : self.__location_phone,
|
||||
TOKEN_IGNORE : self.__ignore,
|
||||
}
|
||||
self.func_list.append(self.parse_loc_tbl)
|
||||
@@ -2562,12 +2568,12 @@ class GedcomParser(UpdateCallback):
|
||||
self.func_list.append(self.note_parse_tbl)
|
||||
|
||||
# look for existing place titles, build a map
|
||||
self.place_names = {}
|
||||
self.place_names = defaultdict(list)
|
||||
cursor = dbase.get_place_cursor()
|
||||
data = cursor.next()
|
||||
while data:
|
||||
(handle, val) = data
|
||||
self.place_names[val[2]] = handle
|
||||
self.place_names[val[2]].append(handle)
|
||||
data = cursor.next()
|
||||
cursor.close()
|
||||
|
||||
@@ -2788,41 +2794,69 @@ class GedcomParser(UpdateCallback):
|
||||
self.dbase.add_note(note, self.trans)
|
||||
return note
|
||||
|
||||
def __find_or_create_place(self, title):
|
||||
def __loc_is_empty(self, location):
|
||||
"""
|
||||
Finds or creates a place based on the GRAMPS ID. If the ID is
|
||||
already used (is in the db), we return the item in the db. Otherwise,
|
||||
we create a new place, assign the handle and GRAMPS ID.
|
||||
"""
|
||||
place = gen.lib.Place()
|
||||
|
||||
# check to see if we've encountered this name before
|
||||
# if we haven't we need to get a new GRAMPS ID
|
||||
Determines whether a location is empty.
|
||||
|
||||
intid = self.place_names.get(title)
|
||||
if intid is None:
|
||||
intid = self.lid2id.get(title)
|
||||
if intid is None:
|
||||
new_id = self.dbase.find_next_place_gramps_id()
|
||||
@param location: The current location
|
||||
@type location: gen.lib.Location
|
||||
@return True of False
|
||||
"""
|
||||
if location is None:
|
||||
return True
|
||||
elif location.serialize() == self._EMPTY_LOC:
|
||||
return True
|
||||
elif location.is_empty():
|
||||
return True
|
||||
return False
|
||||
|
||||
def __find_place(self, title, location):
|
||||
"""
|
||||
Finds an existing place based on the title and primary location.
|
||||
|
||||
@param title: The place title
|
||||
@type title: string
|
||||
@param location: The current location
|
||||
@type location: gen.lib.Location
|
||||
@return gen.lib.Place
|
||||
"""
|
||||
for place_handle in self.place_names[title]:
|
||||
place = self.dbase.get_place_from_handle(place_handle)
|
||||
if place.get_title() == title:
|
||||
if self.__loc_is_empty(location) and \
|
||||
self.__loc_is_empty(place.get_main_location()):
|
||||
return place
|
||||
elif (not self.__loc_is_empty(location) and \
|
||||
not self.__loc_is_empty(place.get_main_location()) and
|
||||
place.get_main_location().is_equivalent(location) == IDENTICAL):
|
||||
return place
|
||||
return None
|
||||
|
||||
def __add_place(self, event, sub_state):
|
||||
"""
|
||||
Add a new place to an event if not already present, or update a
|
||||
place.
|
||||
|
||||
@param event: The event
|
||||
@type event: gen.lib.Event
|
||||
@param substate: The sub-state for PLAC or ADDR elements (i.e. parsed by
|
||||
event_parse_tbl)
|
||||
@type sub_state: CurrentState
|
||||
"""
|
||||
if sub_state.place:
|
||||
# see whether this place already exists
|
||||
place = self.__find_place(sub_state.place.get_title(),
|
||||
sub_state.place.get_main_location())
|
||||
if place is None:
|
||||
place = sub_state.place
|
||||
self.dbase.add_place(place, self.trans)
|
||||
self.place_names[place.get_title()].append(place.get_handle())
|
||||
event.set_place_handle(place.get_handle())
|
||||
else:
|
||||
new_id = None
|
||||
else:
|
||||
new_id = None
|
||||
|
||||
# check to see if the name already existed in the database
|
||||
# if it does, create a new name by appending the GRAMPS ID.
|
||||
# generate a GRAMPS ID if needed
|
||||
|
||||
if self.dbase.has_place_handle(intid):
|
||||
place.unserialize(self.dbase.get_raw_place_data(intid))
|
||||
else:
|
||||
intid = Utils.create_id()
|
||||
place.set_handle(intid)
|
||||
place.set_title(title)
|
||||
place.set_gramps_id(new_id)
|
||||
self.dbase.add_place(place, self.trans)
|
||||
self.lid2id[title] = intid
|
||||
return place
|
||||
place.merge(sub_state.place)
|
||||
self.dbase.commit_place(place, self.trans)
|
||||
event.set_place_handle(place.get_handle())
|
||||
sub_state.pf.load_place(place, place.get_title())
|
||||
|
||||
def __find_file(self, fullname, altpath):
|
||||
tries = []
|
||||
@@ -3236,10 +3270,13 @@ class GedcomParser(UpdateCallback):
|
||||
self.__parse_level(state, self.subm_parse_tbl, self.__undefined)
|
||||
# If this is the submitter that we were told about in the HEADer, then
|
||||
# we will need to update the researcher
|
||||
if line.token_text == self.subm:
|
||||
if line.token_text == self.subm and self.import_researcher:
|
||||
self.dbase.set_researcher(state.res)
|
||||
|
||||
submitter_name = _("SUBM (Submitter): @%s@") % line.token_text
|
||||
if state.res.get_name() == "":
|
||||
submitter_name = _("SUBM (Submitter): @%s@") % line.token_text
|
||||
else:
|
||||
submitter_name = _("SUBM (Submitter): %s") % state.res.get_name()
|
||||
if self.use_def_src:
|
||||
repo.set_name(submitter_name)
|
||||
repo.set_handle(Utils.create_id())
|
||||
@@ -3726,10 +3763,13 @@ class GedcomParser(UpdateCallback):
|
||||
sub_state.level = state.level+1
|
||||
sub_state.event = event
|
||||
sub_state.event_ref = event_ref
|
||||
sub_state.pf = self.place_parser
|
||||
|
||||
self.__parse_level(sub_state, self.event_parse_tbl, self.__undefined)
|
||||
state.msg += sub_state.msg
|
||||
|
||||
self.__add_place(event, sub_state)
|
||||
|
||||
self.dbase.commit_event(event, self.trans)
|
||||
event_ref.ref = event.handle
|
||||
state.person.add_event_ref(event_ref)
|
||||
@@ -3930,10 +3970,13 @@ class GedcomParser(UpdateCallback):
|
||||
sub_state.level = state.level+1
|
||||
sub_state.event = event
|
||||
sub_state.event_ref = event_ref
|
||||
sub_state.pf = self.place_parser
|
||||
|
||||
self.__parse_level(sub_state, self.event_parse_tbl, self.__undefined)
|
||||
state.msg += sub_state.msg
|
||||
|
||||
self.__add_place(event, sub_state)
|
||||
|
||||
self.dbase.add_event(event, self.trans)
|
||||
event_ref.ref = event.handle
|
||||
state.person.add_event_ref(event_ref)
|
||||
@@ -4378,9 +4421,16 @@ class GedcomParser(UpdateCallback):
|
||||
@type state: CurrentState
|
||||
"""
|
||||
try:
|
||||
state.place = self.__find_or_create_place(line.data)
|
||||
state.place.set_title(line.data)
|
||||
state.lds_ord.set_place_handle(state.place.handle)
|
||||
title = line.data
|
||||
place = self.__find_place(title, None)
|
||||
if place is None:
|
||||
place = gen.lib.Place()
|
||||
place.set_title(title)
|
||||
self.dbase.add_place(place, self.trans)
|
||||
self.place_names[place.get_title()].append(place.get_handle())
|
||||
else:
|
||||
pass
|
||||
state.lds_ord.set_place_handle(place.handle)
|
||||
except NameError:
|
||||
return
|
||||
|
||||
@@ -4741,10 +4791,13 @@ class GedcomParser(UpdateCallback):
|
||||
sub_state.level = state.level+1
|
||||
sub_state.event = event
|
||||
sub_state.event_ref = event_ref
|
||||
sub_state.pf = self.place_parser
|
||||
|
||||
self.__parse_level(sub_state, self.event_parse_tbl, self.__undefined)
|
||||
state.msg += sub_state.msg
|
||||
|
||||
self.__add_place(event, sub_state)
|
||||
|
||||
if event.type == gen.lib.EventType.MARRIAGE:
|
||||
descr = event.get_description()
|
||||
if descr == "Civil Union":
|
||||
@@ -4784,9 +4837,12 @@ class GedcomParser(UpdateCallback):
|
||||
sub_state.level = state.level+1
|
||||
sub_state.event = event
|
||||
sub_state.event_ref = event_ref
|
||||
sub_state.pf = self.place_parser
|
||||
|
||||
self.__parse_level(sub_state, self.event_parse_tbl, self.__undefined)
|
||||
state.msg += sub_state.msg
|
||||
|
||||
self.__add_place(event, sub_state)
|
||||
|
||||
self.dbase.commit_event(event, self.trans)
|
||||
event_ref.ref = event.handle
|
||||
@@ -5040,14 +5096,44 @@ class GedcomParser(UpdateCallback):
|
||||
"""
|
||||
+1 <<NOTE_STRUCTURE>> {0:M}
|
||||
|
||||
TODO: Fix this for full reference
|
||||
|
||||
@param line: The current line in GedLine format
|
||||
@type line: GedLine
|
||||
@param state: The current state
|
||||
@type state: CurrentState
|
||||
"""
|
||||
state.note = line.data
|
||||
# This code pretty much duplicates the code in __parse_note. In
|
||||
# __parse_note, we already know the object to which the note is to be
|
||||
# attached, so we can directly add the note to the object. however, in
|
||||
# the case of a media object, the media object is not constructed till
|
||||
# the end of processing, so we just remember the handle of the note.
|
||||
if line.token == TOKEN_RNOTE:
|
||||
# reference to a named note defined elsewhere
|
||||
#NOTE_STRUCTURE: =
|
||||
# n NOTE @<XREF:NOTE>@ {1:1}
|
||||
# +1 SOUR @<XREF:SOUR>@ {0:M}
|
||||
state.note = self.__find_note_handle(self.nid_map[line.data])
|
||||
else:
|
||||
# Embedded note
|
||||
#NOTE_STRUCTURE: =
|
||||
# n NOTE [<SUBMITTER_TEXT> | <NULL>] {1:1}
|
||||
# +1 [ CONC | CONT ] <SUBMITTER_TEXT> {0:M}
|
||||
# +1 SOUR @<XREF:SOUR>@ {0:M}
|
||||
if not line.data:
|
||||
self.__add_msg(_("Empty note ignored"), line, state)
|
||||
self.__skip_subordinate_levels(state.level+1, state)
|
||||
else:
|
||||
new_note = gen.lib.Note(line.data)
|
||||
new_note.set_gramps_id(self.nid_map[""])
|
||||
new_note.set_handle(Utils.create_id())
|
||||
|
||||
sub_state = CurrentState(level=state.level+1)
|
||||
sub_state.note = new_note
|
||||
self.__parse_level(sub_state, self.note_parse_tbl,
|
||||
self.__undefined)
|
||||
state.msg += sub_state.msg
|
||||
|
||||
self.dbase.commit_note(new_note, self.trans, new_note.change)
|
||||
state.note = new_note.get_handle()
|
||||
|
||||
def __family_adopt(self, line, state):
|
||||
"""
|
||||
@@ -5179,44 +5265,33 @@ class GedcomParser(UpdateCallback):
|
||||
@type state: CurrentState
|
||||
"""
|
||||
|
||||
location = None
|
||||
if self.is_ftw and state.event.type in FTW_BAD_PLACE:
|
||||
state.event.set_description(line.data)
|
||||
else:
|
||||
# It is possible that we have already got an address structure
|
||||
# associated with this event. In that case, we will remember the
|
||||
# location to re-insert later, and set the place as the place name
|
||||
# and primary location
|
||||
place_handle = state.event.get_place_handle()
|
||||
if place_handle:
|
||||
place = self.dbase.get_place_from_handle(place_handle)
|
||||
location = place.get_main_location()
|
||||
empty_loc = gen.lib.Location()
|
||||
place.set_main_location(empty_loc)
|
||||
place = state.place
|
||||
if place:
|
||||
# We encounter a PLAC, having previously encountered an ADDR
|
||||
if place.get_title() and place.get_title() != "":
|
||||
# We have previously found a PLAC
|
||||
self.__add_msg(_("A second PLAC ignored"), line, state)
|
||||
# ignore this second PLAC, and use the old one
|
||||
else:
|
||||
# This is the first PLAC
|
||||
place.set_title(line.data)
|
||||
else:
|
||||
place = self.__find_or_create_place(line.data)
|
||||
place.set_title(line.data)
|
||||
state.event.set_place_handle(place.handle)
|
||||
|
||||
# The first thing we encounter is PLAC
|
||||
state.place = gen.lib.Place()
|
||||
place = state.place
|
||||
place.set_title(line.data)
|
||||
|
||||
sub_state = CurrentState()
|
||||
sub_state.place = place
|
||||
sub_state.level = state.level+1
|
||||
sub_state.pf = self.place_parser
|
||||
|
||||
self.__parse_level(sub_state, self.event_place_map,
|
||||
self.__undefined)
|
||||
state.msg += sub_state.msg
|
||||
|
||||
sub_state.pf.load_place(place, place.get_title())
|
||||
# If we already had a remembered location, we set it into the main
|
||||
# location if that is empty, else the alternate location
|
||||
if location and not location.is_empty():
|
||||
if place.get_main_location().is_empty():
|
||||
place.set_main_location(location)
|
||||
else:
|
||||
place.add_alternate_locations(location)
|
||||
self.dbase.commit_place(place, self.trans)
|
||||
|
||||
def __event_place_note(self, line, state):
|
||||
"""
|
||||
@param line: The current line in GedLine format
|
||||
@@ -5327,8 +5402,8 @@ class GedcomParser(UpdateCallback):
|
||||
|
||||
sub_state = CurrentState(level=state.level+1)
|
||||
sub_state.location = gen.lib.Location()
|
||||
sub_state.note = []
|
||||
sub_state.event = state.event
|
||||
sub_state.place = gen.lib.Place() # temp stash for notes, citations etc
|
||||
|
||||
self.__parse_level(sub_state, self.parse_loc_tbl, self.__undefined)
|
||||
state.msg += sub_state.msg
|
||||
@@ -5336,23 +5411,28 @@ class GedcomParser(UpdateCallback):
|
||||
self.__merge_address(free_form, sub_state.location, line, state)
|
||||
|
||||
location = sub_state.location
|
||||
note_list = sub_state.note
|
||||
|
||||
place_handle = state.event.get_place_handle()
|
||||
if place_handle:
|
||||
place = self.dbase.get_place_from_handle(place_handle)
|
||||
place = state.place
|
||||
if place:
|
||||
# We encounter an ADDR having previously encountered a PLAC
|
||||
if len(place.get_alternate_locations()) != 0 and \
|
||||
not place.get_main_location().is_empty():
|
||||
# We have perviously found an ADDR, or have populated location
|
||||
# from PLAC title
|
||||
self.__add_msg(_("Location already populated; ADDR ignored"),
|
||||
line, state)
|
||||
# ignore this second ADDR, and use the old one
|
||||
else:
|
||||
# This is the first ADDR
|
||||
place.set_main_location(location)
|
||||
else:
|
||||
place = self.__find_or_create_place(line.data)
|
||||
place.set_title(line.data)
|
||||
place_handle = place.handle
|
||||
# The first thing we encounter is ADDR
|
||||
state.place = gen.lib.Place()
|
||||
place = state.place
|
||||
place.set_main_location(location)
|
||||
|
||||
self.__add_location(place, location)
|
||||
# place.set_main_location(location)
|
||||
|
||||
map(place.add_note, note_list)
|
||||
|
||||
state.event.set_place_handle(place_handle)
|
||||
self.dbase.commit_place(place, self.trans)
|
||||
# merge notes etc into place
|
||||
place.merge(sub_state.place)
|
||||
|
||||
def __add_location(self, place, location):
|
||||
"""
|
||||
@@ -5381,12 +5461,10 @@ class GedcomParser(UpdateCallback):
|
||||
@param state: The current state
|
||||
@type state: CurrentState
|
||||
"""
|
||||
place_handle = state.event.get_place_handle()
|
||||
if place_handle:
|
||||
place = self.dbase.get_place_from_handle(place_handle)
|
||||
place = state.place
|
||||
if place:
|
||||
location = place.get_main_location()
|
||||
location.set_phone(line.data)
|
||||
self.dbase.commit_place(place, self.trans)
|
||||
|
||||
def __event_privacy(self, line, state):
|
||||
"""
|
||||
@@ -5532,7 +5610,7 @@ class GedcomParser(UpdateCallback):
|
||||
"""
|
||||
while True:
|
||||
line = self.__get_next_line()
|
||||
if self.__level_is_finished(line, state.level):
|
||||
if self.__level_is_finished(line, state.level+1):
|
||||
break
|
||||
elif line.token == TOKEN_AGE:
|
||||
attr = gen.lib.Attribute()
|
||||
@@ -5553,7 +5631,7 @@ class GedcomParser(UpdateCallback):
|
||||
"""
|
||||
while True:
|
||||
line = self.__get_next_line()
|
||||
if self.__level_is_finished(line, state.level):
|
||||
if self.__level_is_finished(line, state.level+1):
|
||||
break
|
||||
elif line.token == TOKEN_AGE:
|
||||
attr = gen.lib.Attribute()
|
||||
@@ -6529,17 +6607,6 @@ class GedcomParser(UpdateCallback):
|
||||
url.set_type(gen.lib.UrlType(gen.lib.UrlType.EMAIL))
|
||||
state.repo.add_url(url)
|
||||
|
||||
def __location_date(self, line, state):
|
||||
"""
|
||||
@param line: The current line in GedLine format
|
||||
@type line: GedLine
|
||||
@param state: The current state
|
||||
@type state: CurrentState
|
||||
"""
|
||||
if not state.location:
|
||||
state.location = gen.lib.Location()
|
||||
state.location.set_date_object(line.data)
|
||||
|
||||
def __location_adr1(self, line, state):
|
||||
"""
|
||||
@param line: The current line in GedLine format
|
||||
@@ -6608,7 +6675,7 @@ class GedcomParser(UpdateCallback):
|
||||
state.location = gen.lib.Location()
|
||||
state.location.set_country(line.data)
|
||||
|
||||
def __location_note(self, line, state):
|
||||
def __location_phone(self, line, state):
|
||||
"""
|
||||
@param line: The current line in GedLine format
|
||||
@type line: GedLine
|
||||
@@ -6617,9 +6684,19 @@ class GedcomParser(UpdateCallback):
|
||||
"""
|
||||
if not state.location:
|
||||
state.location = gen.lib.Location()
|
||||
state.location.set_phone(line.data)
|
||||
|
||||
def __location_note(self, line, state):
|
||||
"""
|
||||
@param line: The current line in GedLine format
|
||||
@type line: GedLine
|
||||
@param state: The current state
|
||||
@type state: CurrentState
|
||||
"""
|
||||
if state.event:
|
||||
self.__parse_note(line, state.event, state.level+1, state)
|
||||
self.__parse_note(line, state.place, state.level, state)
|
||||
else:
|
||||
# This causes notes below SUBMitter to be ignored
|
||||
self.__not_recognized(line, state.level, state)
|
||||
|
||||
def __optional_note(self, line, state):
|
||||
@@ -7137,6 +7214,7 @@ class GedcomParser(UpdateCallback):
|
||||
|
||||
if self.use_def_src and msg != "":
|
||||
self.def_src.set_data_item(msg, line.data)
|
||||
self.dbase.commit_source(self.def_src, self.trans)
|
||||
|
||||
def handle_source(self, line, level, state):
|
||||
"""
|
||||
@@ -7261,8 +7339,7 @@ class GedcomParser(UpdateCallback):
|
||||
oref = gen.lib.MediaRef()
|
||||
oref.set_reference_handle(photo.handle)
|
||||
if note:
|
||||
gramps_id = self.nid_map[note]
|
||||
oref.add_note(self.__find_note_handle(gramps_id))
|
||||
oref.add_note(note)
|
||||
obj.add_media_reference(oref)
|
||||
|
||||
def __build_event_pair(self, state, event_type, event_map, description):
|
||||
@@ -7292,9 +7369,13 @@ class GedcomParser(UpdateCallback):
|
||||
sub_state.event_ref = event_ref
|
||||
sub_state.event = event
|
||||
sub_state.person = state.person
|
||||
sub_state.pf = self.place_parser
|
||||
|
||||
self.__parse_level(sub_state, event_map, self.__undefined)
|
||||
state.msg += sub_state.msg
|
||||
|
||||
self.__add_place(event, sub_state)
|
||||
|
||||
self.dbase.commit_event(event, self.trans)
|
||||
|
||||
event_ref.set_reference_handle(event.handle)
|
||||
@@ -7316,10 +7397,13 @@ class GedcomParser(UpdateCallback):
|
||||
sub_state.level = state.level+1
|
||||
sub_state.event = event
|
||||
sub_state.event_ref = event_ref
|
||||
sub_state.pf = self.place_parser
|
||||
|
||||
self.__parse_level(sub_state, event_map, self.__undefined)
|
||||
state.msg += sub_state.msg
|
||||
|
||||
self.__add_place(event, sub_state)
|
||||
|
||||
self.dbase.commit_event(event, self.trans)
|
||||
event_ref.set_reference_handle(event.handle)
|
||||
return event_ref
|
||||
@@ -7504,9 +7588,9 @@ class GedcomStageOne(object):
|
||||
continue
|
||||
|
||||
if level == 0 and key[0] == '@':
|
||||
if value == ("FAM", "FAMILY") :
|
||||
if value in ("FAM", "FAMILY") :
|
||||
current_family_id = key.strip()[1:-1]
|
||||
elif value == ("INDI", "INDIVIDUAL"):
|
||||
elif value in ("INDI", "INDIVIDUAL"):
|
||||
self.pcnt += 1
|
||||
elif key in ("HUSB", "HUSBAND", "WIFE") and \
|
||||
self.__is_xref_value(value):
|
||||
|
||||
@@ -334,7 +334,7 @@ def get_child_unknown(level, inlaw=""):
|
||||
else:
|
||||
return u"un descendant lointain%s" % inlaw
|
||||
|
||||
def get_sibling_unknown(inlaw=""):
|
||||
def get_sibling_unknown(Ga, inlaw=""):
|
||||
"""
|
||||
sibling of an ancestor, gender = unknown
|
||||
"""
|
||||
@@ -654,7 +654,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
|
||||
elif gender_b == gen.lib.Person.FEMALE:
|
||||
rel_str = u"la tante lointaine" + bygen % (Ga + 1)
|
||||
elif gender_b == gen.lib.Person.UNKNOWN:
|
||||
rel_str = get_sibling_unknown(inlaw)
|
||||
rel_str = get_sibling_unknown(Ga, inlaw)
|
||||
else:
|
||||
return rel_str
|
||||
elif Ga == 1:
|
||||
@@ -673,7 +673,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
|
||||
rel_str = u"la nièce lointaine%s (%dème génération)" % \
|
||||
(inlaw, Gb)
|
||||
elif gender_b == gen.lib.Person.UNKNOWN:
|
||||
rel_str = get_sibling_unknown(inlaw)
|
||||
rel_str = get_sibling_unknown(Ga, inlaw)
|
||||
else:
|
||||
return rel_str
|
||||
elif Ga == Gb:
|
||||
@@ -685,7 +685,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
|
||||
elif gender_b == gen.lib.Person.FEMALE:
|
||||
rel_str = get_cousine(Ga - 1, 0, inlaw=inlaw)
|
||||
elif gender_b == gen.lib.Person.UNKNOWN:
|
||||
rel_str = get_sibling_unknown(inlaw)
|
||||
rel_str = get_sibling_unknown(Ga, inlaw)
|
||||
else:
|
||||
return rel_str
|
||||
elif Ga > 1 and Ga > Gb:
|
||||
|
||||
@@ -240,6 +240,7 @@ class AncestorReport(Report):
|
||||
self.__narrator.set_subject(person)
|
||||
self.doc.write_text(self.__narrator.get_born_string())
|
||||
self.doc.write_text(self.__narrator.get_baptised_string())
|
||||
self.doc.write_text(self.__narrator.get_christened_string())
|
||||
self.doc.write_text(self.__narrator.get_died_string())
|
||||
self.doc.write_text(self.__narrator.get_buried_string())
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ class PlaceReport(Report):
|
||||
This procedure writes out each of the events related to the place
|
||||
"""
|
||||
event_handles = [event_handle for (object_type, event_handle) in
|
||||
self.database.find_backlink_handles(handle)]
|
||||
self.database.find_backlink_handles(handle, ['Event'])]
|
||||
event_handles.sort(self.sort.by_date)
|
||||
|
||||
if event_handles:
|
||||
@@ -244,7 +244,7 @@ class PlaceReport(Report):
|
||||
This procedure writes out each of the people related to the place
|
||||
"""
|
||||
event_handles = [event_handle for (object_type, event_handle) in
|
||||
self.database.find_backlink_handles(handle)]
|
||||
self.database.find_backlink_handles(handle, ['Event'])]
|
||||
|
||||
if event_handles:
|
||||
self.doc.start_paragraph("PLC-Section")
|
||||
@@ -272,11 +272,6 @@ class PlaceReport(Report):
|
||||
person = self.database.get_person_from_handle(ref_handle)
|
||||
nameEntry = "%s (%s)" % (_nd.display(person),
|
||||
person.get_gramps_id())
|
||||
if person_dict.has_key(nameEntry):
|
||||
person_dict[nameEntry].append(evt_handle)
|
||||
else:
|
||||
person_dict[nameEntry] = []
|
||||
person_dict[nameEntry].append(evt_handle)
|
||||
else:
|
||||
family = self.database.get_family_from_handle(ref_handle)
|
||||
f_handle = family.get_father_handle()
|
||||
@@ -289,7 +284,7 @@ class PlaceReport(Report):
|
||||
father.get_gramps_id(),
|
||||
_nd.display(mother),
|
||||
mother.get_gramps_id())
|
||||
else:
|
||||
elif f_handle or m_handle:
|
||||
if f_handle:
|
||||
p_handle = f_handle
|
||||
else:
|
||||
@@ -299,12 +294,15 @@ class PlaceReport(Report):
|
||||
nameEntry = "%s (%s)" % \
|
||||
(_nd.display(person),
|
||||
person.get_gramps_id())
|
||||
|
||||
if person_dict.has_key(nameEntry):
|
||||
person_dict[nameEntry].append(evt_handle)
|
||||
else:
|
||||
person_dict[nameEntry] = []
|
||||
person_dict[nameEntry].append(evt_handle)
|
||||
# No parents - bug #7299
|
||||
continue
|
||||
|
||||
if person_dict.has_key(nameEntry):
|
||||
person_dict[nameEntry].append(evt_handle)
|
||||
else:
|
||||
person_dict[nameEntry] = []
|
||||
person_dict[nameEntry].append(evt_handle)
|
||||
|
||||
keys = person_dict.keys()
|
||||
keys.sort()
|
||||
@@ -318,6 +316,10 @@ class PlaceReport(Report):
|
||||
date = DateHandler.get_date(event)
|
||||
descr = event.get_description()
|
||||
event_type = str(event.get_type())
|
||||
else:
|
||||
date = ''
|
||||
descr = ''
|
||||
event_type = ''
|
||||
event_details = [people, event_type, descr, date]
|
||||
self.doc.start_row()
|
||||
for detail in event_details:
|
||||
|
||||
@@ -1098,7 +1098,7 @@ class CheckIntegrity(object):
|
||||
'exist in the database' %
|
||||
{'gid' : family.gramps_id,
|
||||
'hand' : event_handle})
|
||||
Utils.make_unknown(event_handle, self.explanation,
|
||||
Utils.make_unknown(event_handle, self.explanation.handle,
|
||||
self.class_event, self.commit_event, self.trans)
|
||||
self.invalid_events.add(key)
|
||||
if none_handle:
|
||||
|
||||
@@ -58,6 +58,47 @@ import LdsUtils
|
||||
from gen.db.dbconst import *
|
||||
import const
|
||||
|
||||
LDS_ORD_BAPT_STATUS = (
|
||||
gen.lib.LdsOrd.STATUS_NONE,
|
||||
gen.lib.LdsOrd.STATUS_CHILD, gen.lib.LdsOrd.STATUS_CLEARED,
|
||||
gen.lib.LdsOrd.STATUS_COMPLETED, gen.lib.LdsOrd.STATUS_INFANT,
|
||||
gen.lib.LdsOrd.STATUS_PRE_1970, gen.lib.LdsOrd.STATUS_QUALIFIED,
|
||||
gen.lib.LdsOrd.STATUS_STILLBORN, gen.lib.LdsOrd.STATUS_SUBMITTED,
|
||||
gen.lib.LdsOrd.STATUS_UNCLEARED)
|
||||
|
||||
LDS_ORD_CHILD_SEALING_STATUS = (
|
||||
gen.lib.LdsOrd.STATUS_NONE,
|
||||
gen.lib.LdsOrd.STATUS_BIC, gen.lib.LdsOrd.STATUS_CLEARED,
|
||||
gen.lib.LdsOrd.STATUS_COMPLETED,gen.lib.LdsOrd.STATUS_DNS,
|
||||
gen.lib.LdsOrd.STATUS_PRE_1970, gen.lib.LdsOrd.STATUS_QUALIFIED,
|
||||
gen.lib.LdsOrd.STATUS_STILLBORN, gen.lib.LdsOrd.STATUS_SUBMITTED,
|
||||
gen.lib.LdsOrd.STATUS_UNCLEARED)
|
||||
|
||||
LDS_ENDOWMENT_DATE_STATUS = (
|
||||
gen.lib.LdsOrd.STATUS_NONE,
|
||||
gen.lib.LdsOrd.STATUS_CHILD, gen.lib.LdsOrd.STATUS_CLEARED,
|
||||
gen.lib.LdsOrd.STATUS_COMPLETED, gen.lib.LdsOrd.STATUS_INFANT,
|
||||
gen.lib.LdsOrd.STATUS_PRE_1970, gen.lib.LdsOrd.STATUS_QUALIFIED,
|
||||
gen.lib.LdsOrd.STATUS_STILLBORN, gen.lib.LdsOrd.STATUS_SUBMITTED,
|
||||
gen.lib.LdsOrd.STATUS_UNCLEARED)
|
||||
|
||||
LDS_SPOUSE_SEALING_DATE_STATUS = (
|
||||
gen.lib.LdsOrd.STATUS_NONE,
|
||||
gen.lib.LdsOrd.STATUS_CANCELED, gen.lib.LdsOrd.STATUS_CLEARED,
|
||||
gen.lib.LdsOrd.STATUS_COMPLETED, gen.lib.LdsOrd.STATUS_DNS,
|
||||
gen.lib.LdsOrd.STATUS_DNS_CAN, gen.lib.LdsOrd.STATUS_PRE_1970,
|
||||
gen.lib.LdsOrd.STATUS_QUALIFIED, gen.lib.LdsOrd.STATUS_SUBMITTED,
|
||||
gen.lib.LdsOrd.STATUS_UNCLEARED)
|
||||
|
||||
LDS_INDIVIDUAL_ORD = [(gen.lib.LdsOrd.BAPTISM, LDS_ORD_BAPT_STATUS),
|
||||
(gen.lib.LdsOrd.CONFIRMATION, LDS_ORD_BAPT_STATUS),
|
||||
(gen.lib.LdsOrd.ENDOWMENT, LDS_ENDOWMENT_DATE_STATUS),
|
||||
(gen.lib.LdsOrd.SEAL_TO_PARENTS,
|
||||
LDS_ORD_CHILD_SEALING_STATUS)]
|
||||
|
||||
LDS_SPOUSE_SEALING = [(gen.lib.LdsOrd.SEAL_TO_SPOUSE,
|
||||
LDS_SPOUSE_SEALING_DATE_STATUS)]
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
@@ -1541,14 +1582,17 @@ class TestcaseGenerator(tool.BatchTool):
|
||||
while randint(0,1) == 1:
|
||||
ldsord = gen.lib.LdsOrd()
|
||||
self.fill_object( ldsord)
|
||||
# TODO: adapt type and status to family/person
|
||||
#if isinstance(o,gen.lib.Person):
|
||||
#if isinstance(o,gen.lib.Family):
|
||||
ldsord.set_type( choice(
|
||||
[item[0] for item in gen.lib.LdsOrd._TYPE_MAP] ))
|
||||
ldsord.set_status( randint(0,len(gen.lib.LdsOrd._STATUS_MAP)-1))
|
||||
if self.generated_families:
|
||||
ldsord.set_family_handle( choice(self.generated_families))
|
||||
if isinstance(o,gen.lib.Person):
|
||||
lds_type = choice([item for item in LDS_INDIVIDUAL_ORD] )
|
||||
if isinstance(o,gen.lib.Family):
|
||||
lds_type = LDS_SPOUSE_SEALING[0]
|
||||
if self.generated_families:
|
||||
ldsord.set_family_handle(
|
||||
choice(self.generated_families))
|
||||
ldsord.set_type(lds_type[0])
|
||||
status = choice(lds_type[1])
|
||||
if status != gen.lib.LdsOrd.STATUS_NONE:
|
||||
ldsord.set_status(status)
|
||||
o.add_lds_ord( ldsord)
|
||||
|
||||
if isinstance(o,gen.lib.Location):
|
||||
|
||||
@@ -168,6 +168,7 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow4">
|
||||
<property name="height_request">150</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">automatic</property>
|
||||
|
||||
@@ -277,8 +277,7 @@ class RendererWebkit(Renderer):
|
||||
self.browser = WEBKIT
|
||||
self.title = None
|
||||
self.frame = self.window.get_main_frame()
|
||||
self.frame.connect("load-done", self.page_loaded)
|
||||
self.frame.connect("title-changed", self.get_title)
|
||||
self.window.connect("document-load-finished", self.page_loaded)
|
||||
self.fct = None
|
||||
|
||||
def page_loaded(self, *args):
|
||||
@@ -306,12 +305,6 @@ class RendererWebkit(Renderer):
|
||||
"""
|
||||
self.window.reload()
|
||||
|
||||
def get_title(self, *args):
|
||||
"""
|
||||
We need to get the html title page.
|
||||
"""
|
||||
self.title = self.frame.get_title()
|
||||
|
||||
def execute_script(self, url):
|
||||
"""
|
||||
We need to execute a javascript function into the browser
|
||||
|
||||
@@ -140,7 +140,7 @@ from libhtml import Html
|
||||
# import styled notes from src/plugins/lib/libhtmlbackend.py
|
||||
from libhtmlbackend import HtmlBackend, process_spaces
|
||||
|
||||
from libgedcom import make_gedcom_date
|
||||
from libgedcom import make_gedcom_date, DATE_QUALITY
|
||||
from PlaceUtils import conv_lat_lon
|
||||
from gui.pluginmanager import GuiPluginManager
|
||||
|
||||
@@ -519,14 +519,20 @@ def format_date(date):
|
||||
cal = date.get_calendar()
|
||||
mod = date.get_modifier()
|
||||
quality = date.get_quality()
|
||||
if quality in libgedcom.DATE_QUALITY:
|
||||
qual_text = libgedcom.DATE_QUALITY[quality] + " "
|
||||
else:
|
||||
qual_text = ""
|
||||
if mod == Date.MOD_SPAN:
|
||||
val = "FROM %s TO %s" % (
|
||||
make_gedcom_date(start, cal, mod, quality),
|
||||
make_gedcom_date(date.get_stop_date(), cal, mod, quality))
|
||||
val = "%sFROM %s TO %s" % (
|
||||
qual_text,
|
||||
make_gedcom_date(start, cal, mod, None),
|
||||
make_gedcom_date(date.get_stop_date(), cal, mod, None))
|
||||
elif mod == Date.MOD_RANGE:
|
||||
val = "BET %s AND %s" % (
|
||||
make_gedcom_date(start, cal, mod, quality),
|
||||
make_gedcom_date(date.get_stop_date(), cal, mod, quality))
|
||||
val = "%sBET %s AND %s" % (
|
||||
qual_text,
|
||||
make_gedcom_date(start, cal, mod, None),
|
||||
make_gedcom_date(date.get_stop_date(), cal, mod, None))
|
||||
else:
|
||||
val = make_gedcom_date(start, cal, mod, quality)
|
||||
return val
|
||||
@@ -2577,7 +2583,7 @@ class BasePage(object):
|
||||
@param: uplink - whether to add "../../.." or not
|
||||
@param: usedescr - add description to hyperlink
|
||||
"""
|
||||
url = self.report.build_url_fname(handle, "img", uplink)
|
||||
url = self.report.build_url_fname_html(handle, "img", uplink)
|
||||
name = html_escape(name)
|
||||
|
||||
# begin thumbnail division
|
||||
@@ -5058,14 +5064,14 @@ class DownloadPage(BasePage):
|
||||
else:
|
||||
tcell += " "
|
||||
|
||||
# clear line for proper styling
|
||||
# create footer section
|
||||
footer = self.write_footer()
|
||||
body += (fullclear, footer)
|
||||
# clear line for proper styling
|
||||
# create footer section
|
||||
footer = self.write_footer()
|
||||
body += (fullclear, footer)
|
||||
|
||||
# send page out for processing
|
||||
# and close the file
|
||||
self.XHTMLWriter(downloadpage, of, sio)
|
||||
# send page out for processing
|
||||
# and close the file
|
||||
self.XHTMLWriter(downloadpage, of, sio)
|
||||
|
||||
class ContactPage(BasePage):
|
||||
def __init__(self, report, title):
|
||||
|
||||
@@ -56,8 +56,9 @@ def load_on_reg(dbstate, uistate, plugin):
|
||||
# id, user selectable?, translated_name, fullpath, navigation target name, images, javascript
|
||||
# "default" is used as default
|
||||
|
||||
# default style sheet in the options
|
||||
# Basic Ash style sheet
|
||||
["Basic-Ash", 1, _("Basic-Ash"),
|
||||
["default", 1, _("Basic-Ash"),
|
||||
path_css('Web_Basic-Ash.css'), None, [], [] ],
|
||||
|
||||
# Basic Blue style sheet with navigation menus
|
||||
@@ -110,10 +111,6 @@ def load_on_reg(dbstate, uistate, plugin):
|
||||
["NarrativeMaps", 0, "",
|
||||
path_css("narrative-maps.css"), None, [], [] ],
|
||||
|
||||
# default style sheet in the options
|
||||
["default", 0, _("Basic-Ash"),
|
||||
path_css('Web_Basic-Ash.css'), None, [], [] ],
|
||||
|
||||
# default printer style sheet
|
||||
["Print-Default", 0, "Print-Default",
|
||||
path_css('Web_Print-Default.css'), None, [], [] ],
|
||||
|
||||
Reference in New Issue
Block a user