Compare commits
266 Commits
maintenanc
...
geps/gep-0
Author | SHA1 | Date | |
---|---|---|---|
|
04638a9dcb | ||
|
0ffc0cdd12 | ||
|
e424e5cdbb | ||
|
9c2e0ca760 | ||
|
abeda15fa7 | ||
|
18e1150010 | ||
|
8108adbef8 | ||
|
8453ac9119 | ||
|
da9106834a | ||
|
9c7a058ef4 | ||
|
8066052641 | ||
|
8bbcc2c341 | ||
|
b287b13b9a | ||
|
d48148ed65 | ||
|
9e48884a5b | ||
|
79e2ab25af | ||
|
3659944f4d | ||
|
40fce3c091 | ||
|
ffa4ac4eeb | ||
|
f5f7445692 | ||
|
463549b179 | ||
|
2587bfe73e | ||
|
94a16c85c2 | ||
|
859293f74b | ||
|
7ae88f69aa | ||
|
f1dc4c891f | ||
|
1e864415f1 | ||
|
ae8bd2d4e0 | ||
|
ec40418f5d | ||
|
ccffe86db1 | ||
|
81a702e9af | ||
|
5596d0c47e | ||
|
ffdb23230d | ||
|
4d24c4cf66 | ||
|
1a7ad93476 | ||
|
5a54d1ecd5 | ||
|
cc564061f9 | ||
|
e62596bf2c | ||
|
29873cc9d4 | ||
|
f644717309 | ||
|
ee7e69a616 | ||
|
2ceeb7143b | ||
|
a50e83fa5f | ||
|
b34eea702b | ||
|
e6a43370bd | ||
|
11df6b2b29 | ||
|
578c7345fa | ||
|
681ae03901 | ||
|
adb94b1974 | ||
|
ef9464006e | ||
|
9b48321f9f | ||
|
773443aec0 | ||
|
5afe501e94 | ||
|
deaba77b3b | ||
|
e7281fcde2 | ||
|
24b337ec5d | ||
|
c8bfe1db3b | ||
|
a65dbaddcb | ||
|
b67df8930d | ||
|
9285b289b4 | ||
|
8c820e1ce2 | ||
|
1e7b512c7c | ||
|
5557ae2643 | ||
|
33fa3c2fea | ||
|
8a6da23737 | ||
|
3795974c6f | ||
|
8c73137ffd | ||
|
77c0645acf | ||
|
88f3176f91 | ||
|
672fd4e8f0 | ||
|
46ded3e7db | ||
|
bc202fb9ac | ||
|
1cc9e43cfe | ||
|
af7c0e5e5f | ||
|
8f71da6ec4 | ||
|
1dcdc52b1d | ||
|
60729859f2 | ||
|
20289c20a3 | ||
|
fecf9e4e19 | ||
|
fe775c19bd | ||
|
f479a876e3 | ||
|
99c54b5e2e | ||
|
32b30ccc09 | ||
|
5f4665b3a8 | ||
|
64671663dd | ||
|
6c90a89612 | ||
|
f8f250ad71 | ||
|
774ceff34b | ||
|
0cf2bc0032 | ||
|
fe09b8342b | ||
|
f16db81075 | ||
|
3b9890d9c4 | ||
|
296e2f4f86 | ||
|
c7f9b52003 | ||
|
90e07c8cfc | ||
|
87c5b6632a | ||
|
fba8cdddd1 | ||
|
9e8b2af5c1 | ||
|
fc609ef3d5 | ||
|
9a515bfde6 | ||
|
08d8d4c775 | ||
|
5781e8ac72 | ||
|
4b6afc33fe | ||
|
c6e51d841d | ||
|
69d2b09ed6 | ||
|
4dd31fc7aa | ||
|
42610bdb97 | ||
|
b2ba4c3a6d | ||
|
bd6b4ce012 | ||
|
38b9ae0e6a | ||
|
cb268dac1f | ||
|
b6136261aa | ||
|
a2acb593ec | ||
|
7860fa5221 | ||
|
6fa7b75550 | ||
|
f17f4cc0ac | ||
|
011f40ad75 | ||
|
b46640039d | ||
|
ffc935599d | ||
|
d23aca2481 | ||
|
ccc0b540da | ||
|
cf1456319f | ||
|
c3edd2c359 | ||
|
a030be6100 | ||
|
d84df82c55 | ||
|
7b6abfeb03 | ||
|
1e7d0f847e | ||
|
6a559ad827 | ||
|
d4e85e7336 | ||
|
7a5e277b38 | ||
|
f85a78a50d | ||
|
49766e00a7 | ||
|
7704bd435a | ||
|
ba25ce0b97 | ||
|
6cfffee22d | ||
|
ce373e3036 | ||
|
6400f61b29 | ||
|
864f9c667a | ||
|
065d11647d | ||
|
d8d345772c | ||
|
9c9cb508ed | ||
|
d6f66f3856 | ||
|
f0da385b33 | ||
|
fb930c4560 | ||
|
3dbd69ad31 | ||
|
d9c1a330f3 | ||
|
976dd620a2 | ||
|
0ffe2869d6 | ||
|
ce7192c034 | ||
|
549434612e | ||
|
fdc926d942 | ||
|
31d2a7e3a0 | ||
|
9155b2feb6 | ||
|
7fd98348ee | ||
|
cc62366d42 | ||
|
dd296535de | ||
|
f8f152c1f0 | ||
|
be608b715e | ||
|
96a727e825 | ||
|
9979159717 | ||
|
622cabe1c2 | ||
|
b85845d6a8 | ||
|
35073e9185 | ||
|
fd227ef251 | ||
|
6bf8994fbb | ||
|
378558de5f | ||
|
330b8388d7 | ||
|
37c01ad307 | ||
|
1fe37cae6f | ||
|
2e88ca5bb3 | ||
|
186d7e0ec4 | ||
|
b1da20254a | ||
|
d5b71cc6b7 | ||
|
83fdd19efe | ||
|
f14b5d8944 | ||
|
e07ec97571 | ||
|
98958cb164 | ||
|
9b1ab12514 | ||
|
d5870ff1f4 | ||
|
2380586eff | ||
|
cce7313605 | ||
|
565638fed8 | ||
|
a7a82a6947 | ||
|
e84ccb92db | ||
|
c194bda8ce | ||
|
ae31189b32 | ||
|
30173f5910 | ||
|
57dc4c0118 | ||
|
12496556f0 | ||
|
f549a582e9 | ||
|
79576762c4 | ||
|
28a51a72d5 | ||
|
71e5bb4c81 | ||
|
b380a6b04f | ||
|
b115da9699 | ||
|
812b3503bf | ||
|
042732687f | ||
|
10d5436eba | ||
|
e0253d125f | ||
|
6ab5a23503 | ||
|
4bf5b00fd7 | ||
|
b2e5f1ea0d | ||
|
cc878faf8f | ||
|
d6214118e2 | ||
|
945a491e18 | ||
|
55248663b8 | ||
|
c5889d7857 | ||
|
7242f9d662 | ||
|
edc74447d1 | ||
|
c8708ae3bc | ||
|
0d49ad046f | ||
|
6ddfed1244 | ||
|
268b3e467b | ||
|
0523ef0197 | ||
|
91173ba2a8 | ||
|
a54c1badb7 | ||
|
8f95806107 | ||
|
b82496eada | ||
|
771ae761e2 | ||
|
1c240f9bef | ||
|
a86b39d078 | ||
|
b2b4b39d03 | ||
|
dc18499c7e | ||
|
62e56c09ac | ||
|
a2b941140c | ||
|
6841776261 | ||
|
34c7d6baee | ||
|
97fbe91426 | ||
|
b08cdbe36c | ||
|
59d54b9ba5 | ||
|
6a78da4b25 | ||
|
43b6e62d2d | ||
|
1096342cb5 | ||
|
7bff2f915f | ||
|
ffbac653e0 | ||
|
9cfc5f4863 | ||
|
f055e2748e | ||
|
af456e12b7 | ||
|
91abba9d20 | ||
|
5fb66f3918 | ||
|
d64e11dc1d | ||
|
c0e7bb1cdc | ||
|
a4239f83d3 | ||
|
51a53ccebd | ||
|
2e86a12c39 | ||
|
28c25286ad | ||
|
e434d618a1 | ||
|
57dccb292b | ||
|
8a8bf7c72e | ||
|
44e33f0ad6 | ||
|
2787429b8a | ||
|
08010776aa | ||
|
29a170b678 | ||
|
424fe3bd5b | ||
|
261df75bea | ||
|
66cdba1d8d | ||
|
8fa4de8f9a | ||
|
163545089c | ||
|
99a1729794 | ||
|
1d9aeb81d0 | ||
|
d0d2c59cd5 | ||
|
64f67aa204 | ||
|
c2092a71bd | ||
|
3eb9594a98 | ||
|
0758e411fd | ||
|
e2c48ddb54 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -2,11 +2,12 @@
|
|||||||
*.py[cod]
|
*.py[cod]
|
||||||
|
|
||||||
# Distutils
|
# Distutils
|
||||||
|
MANIFEST
|
||||||
build/
|
build/
|
||||||
sdist/
|
dist/
|
||||||
|
|
||||||
# Gramps
|
# Gramps
|
||||||
gramps/data/tips.xml
|
data/tips.xml
|
||||||
gramps/gen/const.py
|
gramps/gen/const.py
|
||||||
gramps/plugins/lib/holidays.xml
|
gramps/plugins/lib/holidays.xml
|
||||||
po/.intltool-merge-cache
|
po/.intltool-merge-cache
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
#! /usr/bin/env python
|
||||||
#
|
#
|
||||||
# Gramps - a GTK+/GNOME based genealogy program
|
# Gramps - a GTK+/GNOME based genealogy program
|
||||||
#
|
#
|
||||||
|
24
MANIFEST.in
24
MANIFEST.in
@@ -11,34 +11,22 @@ include TestPlan.txt
|
|||||||
recursive-include data *
|
recursive-include data *
|
||||||
recursive-include debian *
|
recursive-include debian *
|
||||||
recursive-include docs *
|
recursive-include docs *
|
||||||
|
recursive-include gramps *
|
||||||
recursive-include help *
|
recursive-include help *
|
||||||
|
recursive-include images *
|
||||||
recursive-include mac *
|
recursive-include mac *
|
||||||
recursive-include po *
|
recursive-include po *
|
||||||
recursive-include gramps *
|
|
||||||
recursive-include test *
|
recursive-include test *
|
||||||
recursive-include windows *
|
recursive-include windows *
|
||||||
|
|
||||||
# Remove files created in the build
|
# Remove files created in the build
|
||||||
exclude data/gramps.desktop
|
exclude data/tips.xml
|
||||||
exclude data/gramps.keys
|
exclude gramps/gen/const.py
|
||||||
exclude data/gramps.xml
|
|
||||||
recursive-exclude data/man *.1
|
|
||||||
recursive-exclude data/man *.1.gz
|
|
||||||
exclude gramps/const.py
|
|
||||||
exclude gramps/data/tips.xml
|
|
||||||
exclude gramps/plugins/lib/holidays.xml
|
exclude gramps/plugins/lib/holidays.xml
|
||||||
exclude po/*.gmo
|
|
||||||
exclude po/.intltool-merge-cache
|
exclude po/.intltool-merge-cache
|
||||||
exclude po/stamp-it
|
|
||||||
exclude po/POTFILES
|
|
||||||
global-exclude *.pyc
|
global-exclude *.pyc
|
||||||
global-exclude *.py~
|
|
||||||
global-exclude *.pyo
|
global-exclude *.pyo
|
||||||
global-exclude *.bak
|
|
||||||
|
|
||||||
# Remove directories which should not be included in the distribution
|
# Remove directories which should not be included in the distribution
|
||||||
prune src/guiQML
|
prune gramps/guiQML
|
||||||
prune src/webapp
|
#prune gramps/webapp
|
||||||
|
|
||||||
# Remove Makefiles used by autotools
|
|
||||||
global-exclude Makefile*
|
|
||||||
|
14
README
14
README
@@ -8,6 +8,7 @@ The following packages *MUST* be installed in order for Gramps to work:
|
|||||||
Python 2.7 or greater, Python 3.2 or greater (python version cannot be mixed)
|
Python 2.7 or greater, Python 3.2 or greater (python version cannot be mixed)
|
||||||
GTK 3.0 or greater
|
GTK 3.0 or greater
|
||||||
pygobject 3.3.2 or greater
|
pygobject 3.3.2 or greater
|
||||||
|
cairo, pango, pangocairo with instrospection bindings (the gi packages)
|
||||||
librsvg2 (svg icon view)
|
librsvg2 (svg icon view)
|
||||||
xdg-utils
|
xdg-utils
|
||||||
|
|
||||||
@@ -23,7 +24,7 @@ to your language:
|
|||||||
The following packages are *STRONGLY RECOMMENDED* to be installed:
|
The following packages are *STRONGLY RECOMMENDED* to be installed:
|
||||||
osmgpsmap Used to show maps in the geography view.
|
osmgpsmap Used to show maps in the geography view.
|
||||||
Without this the GeoView will not be active, see
|
Without this the GeoView will not be active, see
|
||||||
http://gramps-project.org/wiki/index.php?title=Gramps_3.3_Wiki_Manual_-_Main_Window#Geography_Category
|
http://gramps-project.org/wiki/index.php?title=Gramps_4.0_Wiki_Manual_-_Main_Window#Geography_Category
|
||||||
The package is named osmgpsmap, osm-gps-map
|
The package is named osmgpsmap, osm-gps-map
|
||||||
or python-osmgpsmap. Or obtain it from: http://nzjrs.github.com/osm-gps-map/
|
or python-osmgpsmap. Or obtain it from: http://nzjrs.github.com/osm-gps-map/
|
||||||
GraphViz Enable creation of graphs using GraphViz engine.
|
GraphViz Enable creation of graphs using GraphViz engine.
|
||||||
@@ -38,6 +39,14 @@ The following packages are optional
|
|||||||
enchant. A version of gtkspell with gobject introspection
|
enchant. A version of gtkspell with gobject introspection
|
||||||
is needed, so minimally version 3.0.0
|
is needed, so minimally version 3.0.0
|
||||||
|
|
||||||
|
rcs The GNU Revision Control System (RCS) can be used to manage
|
||||||
|
multiple revisions of your family trees. See info at
|
||||||
|
http://www.gramps-project.org/wiki/index.php?title=Gramps_4.0_Wiki_Manual_-_Manage_Family_Trees#Archiving_a_Family_Tree
|
||||||
|
Only rcs is needed, NO python bindings are required
|
||||||
|
|
||||||
|
PIL Python Image Library is needed to convert non jpg images to
|
||||||
|
jpg so as to include them in LaTeX output
|
||||||
|
|
||||||
ttf-freefont More font support in the reports
|
ttf-freefont More font support in the reports
|
||||||
|
|
||||||
gir-webkit GObject introspection data of WebKit is required for the
|
gir-webkit GObject introspection data of WebKit is required for the
|
||||||
@@ -62,9 +71,6 @@ No longer needed in 3.2:
|
|||||||
No longer needed in 3.1:
|
No longer needed in 3.1:
|
||||||
yelp Gnome help browser. At the moment no help is shipped
|
yelp Gnome help browser. At the moment no help is shipped
|
||||||
|
|
||||||
Remark: There is a conflict when using python-gnome2 in Ubuntu. This is evident
|
|
||||||
with the error: TypeError: Error when calling the metaclass bases
|
|
||||||
metaclass conflict
|
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
@@ -1,24 +1,33 @@
|
|||||||
Gramps 3.2 Release Notes
|
"UNSTABLE Gramps 4.0.0 Alpha1 release.
|
||||||
|
|
||||||
General Improvements
|
This is a technology preview to allow plugin writers and packagers-installer
|
||||||
|
writers to update their plugins and scripts. This release is not production
|
||||||
|
ready, so use for testing!"
|
||||||
|
|
||||||
* New Plugin System
|
It is recommended to use Gramps 4.0.0 with python 3.2 so as to be ready
|
||||||
In the Help Menu -> Menu Status, all available plugins are visible. All plugins can be hidden, saving resources and hiding options you do not need. Eg: You don't use the Pedigree View? Hide it in the Plugin Status, and it will not be present anymore. You don't use vcard export? Hide it in the Plugin Status, and it will not be offered anymore.
|
for the future (python 2.7 works though).
|
||||||
|
|
||||||
* Faster
|
The dependencies for Gramps 4.0.0 are _completely_ different than 3.4 due
|
||||||
Many under the hood improvements have occurred that should improve perfamance enormously. Yes, new features are present to use all your processing power, but they are all implemented as plugins that can be hidden. Eg: Insert of a person in a 30000 people family tree took 4sec on 1.4Ghz PC in 3.1, Now it is done in milliseconds.
|
to the switch to GObject introspection, and the removal of autotools. So
|
||||||
|
only install 4.0.0 if you are certain you can obtain the dependencies,
|
||||||
|
see README and INSTALL.
|
||||||
|
|
||||||
*New Views
|
For linux, in Ubuntu 12.10 you can install 4.0.0, but you will need to
|
||||||
There are new views, and some views have been greatly improved
|
compile and install osmgpsmap manually to have the maps working (see
|
||||||
- People view can now be sorted on the columns
|
http://www.gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion#OsmGpsMap_for_Geography )
|
||||||
- A Place treeview is present, nicely grouping your places under country groups
|
|
||||||
- GeoView has left it's beta status behind and shows your data on an
|
|
||||||
online map (Openstreetmap or google maps, fast internet connection required)
|
|
||||||
- Help Menu -> Extra Reports/Tools open a webpage with downloadable extra views
|
|
||||||
|
|
||||||
|
|
||||||
Other Improvements
|
Major enhancements in Gramps 4.0.0:
|
||||||
|
|
||||||
* Styled Notes now in most output formats that support styles, eg in the web report
|
* GEP 8: code reorganization: http://www.gramps-project.org/wiki/index.php?title=GEPS_008:_File_Organization
|
||||||
* New languages
|
|
||||||
* Select language in which report should be created (only present now in some reports)
|
* GEP 26: Replace make: http://www.gramps-project.org/wiki/index.php?title=GEPS_026:_Replace_%27make%27_for_Gramps_build
|
||||||
|
|
||||||
|
* GEP 29: Gtk 3 :http://www.gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion
|
||||||
|
|
||||||
|
* GEP 31: Python 3 support: http://www.gramps-project.org/wiki/index.php?title=GEPS_031:_Python_3_support
|
||||||
|
|
||||||
|
More info in the manual
|
||||||
|
http://www.gramps-project.org/wiki/index.php?title=Gramps_4.0_Wiki_Manual_-_What%27s_new%3F
|
||||||
|
|
||||||
|
Everybody is invited to update the manual to make it current!
|
||||||
|
@@ -25,15 +25,15 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
This is the Document Type Definition file for v1.5.0
|
This is the Document Type Definition file for v1.6.0
|
||||||
of the GRAMPS XML genealogy data format.
|
of the GRAMPS XML genealogy data format.
|
||||||
Please use the following formal public identifier to identify it:
|
Please use the following formal public identifier to identify it:
|
||||||
|
|
||||||
"-//GRAMPS//DTD GRAMPS XML V1.5.0//EN"
|
"-//GRAMPS//DTD GRAMPS XML V1.6.0//EN"
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
<!DOCTYPE database PUBLIC "-//GRAMPS//DTD GRAMPS XML V1.5.0//EN"
|
<!DOCTYPE database PUBLIC "-//GRAMPS//DTD GRAMPS XML V1.6.0//EN"
|
||||||
"http://gramps-project.org/xml/1.5.0/grampsxml.dtd"
|
"http://gramps-project.org/xml/1.6.0/grampsxml.dtd"
|
||||||
[...]>
|
[...]>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@@ -215,7 +215,8 @@ EVENT
|
|||||||
<!ELEMENT events (event)*>
|
<!ELEMENT events (event)*>
|
||||||
|
|
||||||
<!ELEMENT event (type?, (daterange|datespan|dateval|datestr)?, place?, cause?,
|
<!ELEMENT event (type?, (daterange|datespan|dateval|datestr)?, place?, cause?,
|
||||||
description?, attribute*, noteref*, citationref*, objref*)>
|
description?, attribute*, noteref*, citationref*, objref*,
|
||||||
|
tagref*)>
|
||||||
<!ATTLIST event
|
<!ATTLIST event
|
||||||
id CDATA #IMPLIED
|
id CDATA #IMPLIED
|
||||||
handle ID #REQUIRED
|
handle ID #REQUIRED
|
||||||
@@ -229,7 +230,7 @@ SOURCES
|
|||||||
|
|
||||||
<!ELEMENT sources (source)*>
|
<!ELEMENT sources (source)*>
|
||||||
<!ELEMENT source (stitle?, sauthor?, spubinfo?, sabbrev?,
|
<!ELEMENT source (stitle?, sauthor?, spubinfo?, sabbrev?,
|
||||||
noteref*, objref*, data_item*, reporef*)>
|
noteref*, objref*, data_item*, reporef*, tagref*)>
|
||||||
<!ATTLIST source
|
<!ATTLIST source
|
||||||
id CDATA #IMPLIED
|
id CDATA #IMPLIED
|
||||||
handle ID #REQUIRED
|
handle ID #REQUIRED
|
||||||
@@ -248,7 +249,7 @@ PLACES
|
|||||||
<!ELEMENT places (placeobj)*>
|
<!ELEMENT places (placeobj)*>
|
||||||
|
|
||||||
<!ELEMENT placeobj (ptitle?, coord?, location*, objref*, url*, noteref*,
|
<!ELEMENT placeobj (ptitle?, coord?, location*, objref*, url*, noteref*,
|
||||||
citationref*)>
|
citationref*, tagref*)>
|
||||||
<!ATTLIST placeobj
|
<!ATTLIST placeobj
|
||||||
id CDATA #IMPLIED
|
id CDATA #IMPLIED
|
||||||
handle ID #REQUIRED
|
handle ID #REQUIRED
|
||||||
@@ -305,7 +306,7 @@ REPOSITORIES
|
|||||||
|
|
||||||
<!ELEMENT repositories (repository)*>
|
<!ELEMENT repositories (repository)*>
|
||||||
|
|
||||||
<!ELEMENT repository (rname, type, address*, url*, noteref*)>
|
<!ELEMENT repository (rname, type, address*, url*, noteref*, tagref*)>
|
||||||
<!ATTLIST repository
|
<!ATTLIST repository
|
||||||
id CDATA #IMPLIED
|
id CDATA #IMPLIED
|
||||||
handle ID #REQUIRED
|
handle ID #REQUIRED
|
||||||
@@ -368,7 +369,7 @@ CITATIONS
|
|||||||
<!ELEMENT citations (citation)*>
|
<!ELEMENT citations (citation)*>
|
||||||
|
|
||||||
<!ELEMENT citation ((daterange|datespan|dateval|datestr)?, page?, confidence?,
|
<!ELEMENT citation ((daterange|datespan|dateval|datestr)?, page?, confidence?,
|
||||||
noteref*, objref*, data_item*, sourceref)>
|
noteref*, objref*, data_item*, sourceref, tagref*)>
|
||||||
<!ATTLIST citation
|
<!ATTLIST citation
|
||||||
id CDATA #IMPLIED
|
id CDATA #IMPLIED
|
||||||
handle ID #REQUIRED
|
handle ID #REQUIRED
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<grammar
|
<grammar
|
||||||
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
|
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
|
||||||
ns="http://gramps-project.org/xml/1.5.0/"
|
ns="http://gramps-project.org/xml/1.6.0/"
|
||||||
xmlns="http://relaxng.org/ns/structure/1.0">
|
xmlns="http://relaxng.org/ns/structure/1.0">
|
||||||
|
|
||||||
<start><element name="database">
|
<start><element name="database">
|
||||||
@@ -160,6 +160,9 @@
|
|||||||
<value>0</value>
|
<value>0</value>
|
||||||
<value>1</value>
|
<value>1</value>
|
||||||
</choice></attribute></optional>
|
</choice></attribute></optional>
|
||||||
|
<zeroOrMore><element name="tagref">
|
||||||
|
<ref name="tagref-content"/>
|
||||||
|
</element></zeroOrMore>
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
<define name="person-content">
|
<define name="person-content">
|
||||||
@@ -205,9 +208,6 @@
|
|||||||
<zeroOrMore><element name="citationref">
|
<zeroOrMore><element name="citationref">
|
||||||
<ref name="citationref-content"/>
|
<ref name="citationref-content"/>
|
||||||
</element></zeroOrMore>
|
</element></zeroOrMore>
|
||||||
<zeroOrMore><element name="tagref">
|
|
||||||
<ref name="tagref-content"/>
|
|
||||||
</element></zeroOrMore>
|
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
<define name="child-rel">
|
<define name="child-rel">
|
||||||
@@ -403,9 +403,6 @@
|
|||||||
<zeroOrMore><element name="citationref">
|
<zeroOrMore><element name="citationref">
|
||||||
<ref name="citationref-content"/>
|
<ref name="citationref-content"/>
|
||||||
</element></zeroOrMore>
|
</element></zeroOrMore>
|
||||||
<zeroOrMore><element name="tagref">
|
|
||||||
<ref name="tagref-content"/>
|
|
||||||
</element></zeroOrMore>
|
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
<define name="event-content">
|
<define name="event-content">
|
||||||
@@ -520,9 +517,6 @@
|
|||||||
<zeroOrMore><element name="citationref">
|
<zeroOrMore><element name="citationref">
|
||||||
<ref name="citationref-content"/>
|
<ref name="citationref-content"/>
|
||||||
</element></zeroOrMore>
|
</element></zeroOrMore>
|
||||||
<zeroOrMore><element name="tagref">
|
|
||||||
<ref name="tagref-content"/>
|
|
||||||
</element></zeroOrMore>
|
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
<define name="repository-content">
|
<define name="repository-content">
|
||||||
@@ -581,9 +575,6 @@
|
|||||||
</choice></attribute></optional>
|
</choice></attribute></optional>
|
||||||
<attribute name="type"><text/></attribute>
|
<attribute name="type"><text/></attribute>
|
||||||
<ref name="styledtext"/>
|
<ref name="styledtext"/>
|
||||||
<zeroOrMore><element name="tagref">
|
|
||||||
<ref name="tagref-content"/>
|
|
||||||
</element></zeroOrMore>
|
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
<define name="styledtext">
|
<define name="styledtext">
|
||||||
|
@@ -1,14 +0,0 @@
|
|||||||
# This is the data/man level Makefile for Gramps
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
SUBDIRS = fr sv nl pl cs pt_BR
|
|
||||||
|
|
||||||
man_IN_FILES = gramps.1.in
|
|
||||||
man_MANS = $(man_IN_FILES:.1.in=.1)
|
|
||||||
|
|
||||||
EXTRA_DIST = $(man_MANS) $(man_IN_FILES)
|
|
||||||
|
|
||||||
gramps.1: $(top_builddir)/config.status gramps.1.in
|
|
||||||
cd $(top_builddir) && CONFIG_FILES=data/man/$@ $(SHELL) ./config.status
|
|
||||||
|
|
||||||
CLEANFILES=$(man_MANS)
|
|
@@ -48,9 +48,9 @@ copyright = u'2012, Gramps project'
|
|||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = '4.0'
|
version = '4.1'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = '4.0.0'
|
release = 'trunk'
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
@@ -1,14 +0,0 @@
|
|||||||
# This is the data/man/sv level Makefile for Gramps
|
|
||||||
# $Id: Makefile.am 6189 2006-03-21 19:05:46Z rshura $
|
|
||||||
|
|
||||||
man_IN_FILES = gramps.1.in
|
|
||||||
man_MANS = $(man_IN_FILES:.1.in=.1)
|
|
||||||
|
|
||||||
mandir = @mandir@/cs
|
|
||||||
|
|
||||||
EXTRA_DIST = $(man_MANS) $(man_IN_FILES)
|
|
||||||
|
|
||||||
gramps.1: $(top_builddir)/config.status gramps.1.in
|
|
||||||
cd $(top_builddir) && CONFIG_FILES=data/man/cs/$@ $(SHELL) ./config.status
|
|
||||||
|
|
||||||
CLEANFILES=$(man_MANS)
|
|
@@ -249,7 +249,9 @@ gramps(1) 3.4.0 gramps(1)
|
|||||||
|
|
||||||
*${PREFIX}/bin/gramps*
|
*${PREFIX}/bin/gramps*
|
||||||
|
|
||||||
*${PREFIX}/share/gramps*
|
*${PREFIX}/lib/python/dist-packages/gramps/*
|
||||||
|
|
||||||
|
*${PREFIX}/share/*
|
||||||
|
|
||||||
*${HOME}/.gramps*
|
*${HOME}/.gramps*
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
English
|
English
|
||||||
=======
|
=======
|
||||||
|
|
||||||
gramps(1) 4.0.0 gramps(1)
|
gramps(1) @VERSION@ gramps(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -262,11 +262,14 @@ gramps(1) 4.0.0 gramps(1)
|
|||||||
|
|
||||||
|
|
||||||
**KNOWN BUGS AND LIMITATIONS**
|
**KNOWN BUGS AND LIMITATIONS**
|
||||||
**FILES**
|
|
||||||
|
|
||||||
|
**FILES**
|
||||||
|
|
||||||
*${PREFIX}/bin/gramps*
|
*${PREFIX}/bin/gramps*
|
||||||
|
|
||||||
*${PREFIX}/share/gramps*
|
*${PREFIX}/lib/python/dist-packages/gramps/*
|
||||||
|
|
||||||
|
*${PREFIX}/share/*
|
||||||
|
|
||||||
*${HOME}/.gramps*
|
*${HOME}/.gramps*
|
||||||
|
|
||||||
@@ -293,4 +296,4 @@ gramps(1) 4.0.0 gramps(1)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
January 2013 4.0.0 gramps(1)
|
gramps(1) @VERSION@ gramps(1)
|
||||||
|
@@ -1,14 +0,0 @@
|
|||||||
# This is the data/man/fr level Makefile for Gramps
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
man_IN_FILES = gramps.1.in
|
|
||||||
man_MANS = $(man_IN_FILES:.1.in=.1)
|
|
||||||
|
|
||||||
mandir = @mandir@/fr
|
|
||||||
|
|
||||||
EXTRA_DIST = $(man_MANS) $(man_IN_FILES)
|
|
||||||
|
|
||||||
gramps.1: $(top_builddir)/config.status gramps.1.in
|
|
||||||
cd $(top_builddir) && CONFIG_FILES=data/man/fr/$@ $(SHELL) ./config.status
|
|
||||||
|
|
||||||
CLEANFILES=$(man_MANS)
|
|
@@ -48,9 +48,9 @@ copyright = u'2012, Gramps project'
|
|||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = '4.0'
|
version = '4.1'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = '4.0.0'
|
release = 'trunk'
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
@@ -1,9 +1,7 @@
|
|||||||
French
|
French
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
gramps(1) @VERSION@ gramps(1)
|
||||||
gramps(1) 4.0.0 gramps(1)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**NOM**
|
**NOM**
|
||||||
@@ -34,33 +32,33 @@ gramps(1) 4.0.0 gramps(1)
|
|||||||
|
|
||||||
**OPTIONS**
|
**OPTIONS**
|
||||||
**gramps** *FICHIER*
|
**gramps** *FICHIER*
|
||||||
Si *FICHIER* est désigné (sans autres commandes) comme arbre
|
Si *FICHIER* est désigné (sans autres commandes) comme arbre
|
||||||
familial ou comme répertoire d'arbre familial, alors une session
|
familial ou comme répertoire d'arbre familial, alors une session
|
||||||
interactive est ouverte. Si *FICHIER* est un format de fichier
|
interactive est ouverte. Si *FICHIER* est un format de fichier
|
||||||
supporté par Gramps, une base vide est créée dont le nom est
|
supporté par Gramps, une base vide est créée dont le nom est
|
||||||
celui du *FICHIER* et les données y seront importées. Les autres
|
celui du *FICHIER* et les données y seront importées. Les autres
|
||||||
options sont ignorées. Ce type de lancement permet d'utiliser
|
options sont ignorées. Ce type de lancement permet d'utiliser
|
||||||
gramps pour manipuler des données comme dans un navigateur web.
|
gramps pour manipuler des données comme dans un navigateur web.
|
||||||
Les formats natifs de gramps sont acceptés, voir ci-dessous.
|
Les formats natifs de gramps sont acceptés, voir ci-dessous.
|
||||||
|
|
||||||
|
|
||||||
**-f** , **--format=** *FORMAT*
|
**-f** , **--format=** *FORMAT*
|
||||||
Le format spécifique du *FICHIER* est précédé par les arguments
|
Le format spécifique du *FICHIER* est précédé par les arguments
|
||||||
**-i** , ou **-e** . Si l'option **-f** n'est pas donnée pour le *FICHIER* ,
|
**-i** , ou **-e** . Si l'option **-f** n'est pas donnée pour le *FICHIER* ,
|
||||||
alors le format sera celui de l'extension ou du type-MIME.
|
alors le format sera celui de l'extension ou du type-MIME.
|
||||||
|
|
||||||
Les formats de sortie disponibles sont **gramps-xml** (deviné si
|
Les formats de sortie disponibles sont **gramps-xml** (deviné si
|
||||||
*FICHIER* se termine par **.gramps** ), et **gedcom** (deviné si *FICHIER* se
|
*FICHIER* se termine par **.gramps** ), et **gedcom** (deviné si *FICHIER* se
|
||||||
termine par **.ged** ), ou tout autre fichier d'exportation
|
termine par **.ged** ), ou tout autre fichier d'exportation
|
||||||
disponible dans le système de plugin Gramps.
|
disponible dans le système de plugin Gramps.
|
||||||
|
|
||||||
Les formats disponibles pour l'importation sont **grdb** ,
|
Les formats disponibles pour l'importation sont **grdb** ,
|
||||||
**gramps-xml** , **gedcom** , **gramps-pkg** (deviné si *FICHIER* se termine par
|
**gramps-xml** , **gedcom** , **gramps-pkg** (deviné si *FICHIER* se termine par
|
||||||
**.gpkg** ), et **geneweb** (deviné si *FICHIER* se termine par **.gw** ).
|
**.gpkg** ), et **geneweb** (deviné si *FICHIER* se termine par **.gw** ).
|
||||||
|
|
||||||
Les formats disponibles pour l'exportation sont **gramps-xml** , **ged‐
|
Les formats disponibles pour l'exportation sont **gramps-xml** , **ged‐
|
||||||
com** , **gramps-pkg** , **wft** (deviné si *FICHIER* se termine par **.wft** ),
|
com** , **gramps-pkg** , **wft** (deviné si *FICHIER* se termine par **.wft** ),
|
||||||
**geneweb** .
|
**geneweb** .
|
||||||
|
|
||||||
|
|
||||||
**-l**
|
**-l**
|
||||||
@@ -68,29 +66,29 @@ gramps(1) 4.0.0 gramps(1)
|
|||||||
|
|
||||||
|
|
||||||
**-u** , **--force-unlock**
|
**-u** , **--force-unlock**
|
||||||
Débloquer une base de données verrouillée.
|
Débloquer une base de données verrouillée.
|
||||||
|
|
||||||
|
|
||||||
**-O** , **--open=** *BASE_DE_DONNEES*
|
**-O** , **--open=** *BASE_DE_DONNEES*
|
||||||
Ouvrir une *BASE_DE_DONNEES* qui doit être une base présente dans
|
Ouvrir une *BASE_DE_DONNEES* qui doit être une base présente dans
|
||||||
le répertoire des bases ou le nom d'un arbre familial existant.
|
le répertoire des bases ou le nom d'un arbre familial existant.
|
||||||
Si aucune action n'est définie, les options d'import ou d'export
|
Si aucune action n'est définie, les options d'import ou d'export
|
||||||
sont données par la ligne de commande puis une session interac‐
|
sont données par la ligne de commande puis une session interactive
|
||||||
tive est ouverte, utilisant cette base de données.
|
est ouverte, utilisant cette base de données.
|
||||||
|
|
||||||
Seulement une base peut être ouverte. Si vous utilisez plusieurs
|
Seulement une base peut être ouverte. Si vous utilisez plusieurs
|
||||||
sources, vous devez utiliser l'option d'import.
|
sources, vous devez utiliser l'option d'import.
|
||||||
|
|
||||||
|
|
||||||
**-i** , **--import=** *FICHIER*
|
**-i** , **--import=** *FICHIER*
|
||||||
Importer des données depuis un *FICHIER* . Si vous n'avez pas
|
Importer des données depuis un *FICHIER* . Si vous n'avez pas
|
||||||
spécifié de base de données alors une base de données temporaire
|
spécifié de base de données alors une base de données temporaire
|
||||||
est utilisée; elle sera effacée quand vous quitterez gramps.
|
est utilisée; elle sera effacée quand vous quitterez gramps.
|
||||||
|
|
||||||
Quand plus d'un fichier doit être importé, chacun doit être
|
Quand plus d'un fichier doit être importé, chacun doit être
|
||||||
précédé par la commande **-i** . Ces fichiers sont importés dans le
|
précédé par la commande **-i** . Ces fichiers sont importés dans le
|
||||||
même ordre, i.e. **-i** *FICHIER1* **-i** *FICHIER2* et **-i** *FICHIER2* **-i**
|
même ordre, **-i** *FICHIER1* **-i** *FICHIER2* et **-i** *FICHIER2* **-i**
|
||||||
*FICHIER1* vont tous les deux produire différents IDs gramps.
|
*FICHIER1* vont tous les deux produire différents IDs gramps.
|
||||||
|
|
||||||
|
|
||||||
**-e** , **--export=** *FICHIER*
|
**-e** , **--export=** *FICHIER*
|
||||||
@@ -104,38 +102,38 @@ gramps(1) 4.0.0 gramps(1)
|
|||||||
|
|
||||||
|
|
||||||
**-a** , **--action=** *ACTION*
|
**-a** , **--action=** *ACTION*
|
||||||
Accomplir une *ACTION* sur les données importées. C'est effectué à
|
Accomplir une *ACTION* sur les données importées. C'est effectué à
|
||||||
la fin de l'importation. Les actions possibles sont **summary**
|
la fin de l'importation. Les actions possibles sont **summary**
|
||||||
(comme le rapport -> Afficher -> Statistiques sur la base),
|
(comme le rapport -> Afficher -> Statistiques sur la base),
|
||||||
**check** (comme l'outil -> Réparation de la base -> Vérifier et
|
**check** (comme l'outil -> Réparation de la base -> Vérifier et
|
||||||
réparer), **report** (produit un rapport) et **tool** (utilise un
|
réparer), **report** (produit un rapport) et **tool** (utilise un
|
||||||
outil), ces derniers ont besoin de *OPTION* précédé par la commande -p.
|
outil), ces derniers ont besoin de *OPTION* précédé par la commande -p.
|
||||||
|
|
||||||
L' *OPTION* doit satisfaire ces conditions:
|
L' *OPTION* doit satisfaire ces conditions:
|
||||||
Il ne doit pas y avoir d'espace. Si certains arguments doivent
|
Il ne doit pas y avoir d'espace. Si certains arguments doivent
|
||||||
utiliser des espaces, la chaîne doit être encadrée par des
|
utiliser des espaces, la chaîne doit être encadrée par des
|
||||||
guillemets. Les options vont par paire nom et valeur. Une
|
guillemets. Les options vont par paire nom et valeur. Une
|
||||||
paire est séparée par un signe égal. Différentes paires sont
|
paire est séparée par un signe égal. Différentes paires sont
|
||||||
séparées par une virgule.
|
séparées par une virgule.
|
||||||
|
|
||||||
La plupart des options sont spécifiques à chaque rapport. Même
|
La plupart des options sont spécifiques à chaque rapport. Même
|
||||||
s'il existe des options communes.
|
s'il existe des options communes.
|
||||||
|
|
||||||
**name=name**
|
**name=name**
|
||||||
Cette option est obligatoire, elle détermine quel rapport ou
|
Cette option est obligatoire, elle détermine quel rapport ou
|
||||||
outil sera utilisé. Si le name saisi ne correspond à aucun
|
outil sera utilisé. Si le name saisi ne correspond à aucun
|
||||||
module disponible, un message d'erreur sera ajouté.
|
module disponible, un message d'erreur sera ajouté.
|
||||||
|
|
||||||
**show=all**
|
**show=all**
|
||||||
Cette option produit une liste avec les noms des options
|
Cette option produit une liste avec les noms des options
|
||||||
disponibles pour un rapport donné.
|
disponibles pour un rapport donné.
|
||||||
|
|
||||||
**show=optionname**
|
**show=optionname**
|
||||||
Cette option affiche une description de toutes les fonctionnalités
|
Cette option affiche une description de toutes les fonctionnalités
|
||||||
proposées par optionname, aussi bien les types que les valeurs pour une option.
|
proposées par optionname, aussi bien les types que les valeurs pour une option.
|
||||||
|
|
||||||
Utiliser les options ci-dessus pour trouver tout sur un rapport
|
Utiliser les options ci-dessus pour trouver tout sur un rapport
|
||||||
choisi.
|
choisi.
|
||||||
|
|
||||||
|
|
||||||
Quand plus d'une action doit être effectuée, chacune doit être précédée
|
Quand plus d'une action doit être effectuée, chacune doit être précédée
|
||||||
@@ -144,23 +142,23 @@ gramps(1) 4.0.0 gramps(1)
|
|||||||
|
|
||||||
|
|
||||||
**-d** , **--debug=** *NOM_LOGGER*
|
**-d** , **--debug=** *NOM_LOGGER*
|
||||||
Permet les logs de debug pour le développement et les tests.
|
Permet les logs de debug pour le développement et les tests.
|
||||||
Regarder le code source pour les détails.
|
Regarder le code source pour les détails.
|
||||||
|
|
||||||
**--version**
|
**--version**
|
||||||
Imprime le numéro de version pour gramps puis quitte.
|
Imprime le numéro de version pour gramps puis quitte.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**Opération**
|
**Opération**
|
||||||
Si le premie argument de la ligne de commande ne commence pas par un
|
Si le premie argument de la ligne de commande ne commence pas par un
|
||||||
tiret (i.e. pas d'instruction), gramps va essayer d'ouvrir la base de
|
tiret (i.e. pas d'instruction), gramps va essayer d'ouvrir la base de
|
||||||
données avec le nom donné par le premier argument et démarrer une ses‐
|
données avec le nom donné par le premier argument et démarrer une ses‐
|
||||||
sion interactive, en ignorant le reste de la ligne de commande.
|
sion interactive, en ignorant le reste de la ligne de commande.
|
||||||
|
|
||||||
|
|
||||||
Si la commande **-O** est notée, alors gramps va essayer le fichier défini
|
Si la commande **-O** est notée, alors gramps va essayer le fichier défini
|
||||||
et va travailler avec ses données, comme pour les autres paramètres de
|
et va travailler avec ses données, comme pour les autres paramètres de
|
||||||
la ligne de commande.
|
la ligne de commande.
|
||||||
|
|
||||||
@@ -183,7 +181,7 @@ gramps(1) 4.0.0 gramps(1)
|
|||||||
Cette base sera **import_db.grdb** dans le répertoire **~/.gramps/import**.
|
Cette base sera **import_db.grdb** dans le répertoire **~/.gramps/import**.
|
||||||
|
|
||||||
|
|
||||||
Les erreurs rencontrées lors d'importation, d'exportation, ou d'action, seront
|
Les erreurs rencontrées lors d'importation, d'exportation, ou d'action, seront
|
||||||
mémorisées en *stdout* (si elles sont le fait de la manipulation par
|
mémorisées en *stdout* (si elles sont le fait de la manipulation par
|
||||||
gramps) ou en *stderr* (si elles ne sont pas le fait d'une manipulation).
|
gramps) ou en *stderr* (si elles ne sont pas le fait d'une manipulation).
|
||||||
Utilisez les shell de redirection de *stdout* et *stderr* pour sauver
|
Utilisez les shell de redirection de *stdout* et *stderr* pour sauver
|
||||||
@@ -191,16 +189,16 @@ gramps(1) 4.0.0 gramps(1)
|
|||||||
|
|
||||||
|
|
||||||
**EXEMPLES**
|
**EXEMPLES**
|
||||||
Pour ouvrir un arbre familial et y importer un fichier XML, on peut
|
Pour ouvrir un arbre familial et y importer un fichier XML, on peut
|
||||||
saisir:
|
saisir:
|
||||||
|
|
||||||
**gramps -O** *'Mon Arbre Familial'* **-i** *~/db3.gramps*
|
**gramps -O** *'Mon Arbre Familial'* **-i** *~/db3.gramps*
|
||||||
|
|
||||||
Ceci ouvre un arbre familial, pour faire la même chose, mais importer
|
Ceci ouvre un arbre familial, pour faire la même chose, mais importer
|
||||||
dans un arbre familial temporaire et démarrer une session interactive,
|
dans un arbre familial temporaire et démarrer une session interactive,
|
||||||
on peut saisir:
|
on peut saisir :
|
||||||
|
|
||||||
**gramps -i** *'Mon Arbre Familial'* **-i** *~/db3.gramps*
|
**gramps -i** *'Mon Arbre Familial'* **-i** *~/db3.gramps*
|
||||||
|
|
||||||
Lecture de quatre bases de données dont les formats peuvent être
|
Lecture de quatre bases de données dont les formats peuvent être
|
||||||
devinés d'après les noms, puis vérification des données:
|
devinés d'après les noms, puis vérification des données:
|
||||||
@@ -225,12 +223,12 @@ gramps(1) 4.0.0 gramps(1)
|
|||||||
Pour lire trois ensembles de données puis lancer une session
|
Pour lire trois ensembles de données puis lancer une session
|
||||||
interactive de gramps sur le tout :
|
interactive de gramps sur le tout :
|
||||||
|
|
||||||
**gramps -i** *file1.ged* **-i** *file2.tgz* **-i** *~/db3.gramps*
|
**gramps -i** *file1.ged* **-i** *file2.tgz* **-i** *~/db3.gramps*
|
||||||
|
|
||||||
Pour lancer l'outil de vérification de la base de données depuis la
|
Pour lancer l'outil de vérification de la base de données depuis la
|
||||||
ligne de commande et obtenir le résultat :
|
ligne de commande et obtenir le résultat :
|
||||||
|
|
||||||
**gramps -O** *'My Family Tree'* **-a** *tool* **-p name=** *verify*
|
**gramps -O** *'My Family Tree'* **-a** *tool* **-p name=** *verify*
|
||||||
|
|
||||||
Enfin, pour lancer une session interactive normale, entrer :
|
Enfin, pour lancer une session interactive normale, entrer :
|
||||||
|
|
||||||
@@ -253,21 +251,24 @@ gramps(1) 4.0.0 gramps(1)
|
|||||||
|
|
||||||
**CONCEPTS**
|
**CONCEPTS**
|
||||||
Gramps est un système basé sur le support de plugin-python, permettant
|
Gramps est un système basé sur le support de plugin-python, permettant
|
||||||
d'importer et d'exporter, la saisie, générer des rapports, des outils,
|
d'importer et d'exporter, la saisie, générer des rapports, des outils,
|
||||||
et afficher des filtres pouvant être ajoutés sans modifier le programme.
|
et afficher des filtres pouvant être ajoutés sans modifier le programme.
|
||||||
|
|
||||||
Par ailleurs, gramps permet la génération directe : impression, rap‐
|
Par ailleurs, gramps permet la génération directe : impression, rap‐
|
||||||
ports avec sortie vers d'autres formats, comme *LibreOffice.org* ,
|
ports avec sortie vers d'autres formats, comme *LibreOffice.org* ,
|
||||||
*HTML* , ou *LaTeX* pour permettre à l'utilisateur de choisir selon ses
|
*HTML* , ou *LaTeX* pour permettre à l'utilisateur de choisir selon ses
|
||||||
besoins
|
besoins
|
||||||
|
|
||||||
|
|
||||||
**BUGS CONNUS ET LIMITATIONS**
|
**BUGS CONNUS ET LIMITATIONS**
|
||||||
|
|
||||||
**FICHIERS**
|
**FICHIERS**
|
||||||
|
|
||||||
*${PREFIX}/bin/gramps*
|
*${PREFIX}/bin/gramps*
|
||||||
|
|
||||||
*${PREFIX}/share/gramps*
|
*${PREFIX}/lib/python/dist-packages/gramps/*
|
||||||
|
|
||||||
|
*${PREFIX}/share/*
|
||||||
|
|
||||||
*${HOME}/.gramps*
|
*${HOME}/.gramps*
|
||||||
|
|
||||||
@@ -296,4 +297,4 @@ gramps(1) 4.0.0 gramps(1)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Janvier 2013 4.0.0 gramps(1)
|
gramps(1) @VERSION@ gramps(1)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.TH "GRAMPS" "1" "04 December 2012" "4.0" "Gramps"
|
.TH "GRAMPS" "1" "28 December 2012" "4.0" "Gramps"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
gramps \- Gramps Documentation
|
gramps \- Gramps Documentation
|
||||||
.
|
.
|
||||||
@@ -28,10 +28,10 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|||||||
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
||||||
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
||||||
..
|
..
|
||||||
.\" Man page generated from reStructeredText.
|
.\" Man page generated from reStructuredText.
|
||||||
.
|
.
|
||||||
.sp
|
.sp
|
||||||
gramps(1) 4.0.0 gramps(1)
|
gramps(1) @VERSION@ gramps(1)
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
.B \fBNOM\fP
|
.B \fBNOM\fP
|
||||||
@@ -72,7 +72,7 @@ Les formats natifs de gramps sont acceptés, voir ci\-dessous.
|
|||||||
.TP
|
.TP
|
||||||
.B \fB\-f\fP , \fB\-\-format=\fP \fIFORMAT\fP
|
.B \fB\-f\fP , \fB\-\-format=\fP \fIFORMAT\fP
|
||||||
Le format spécifique du \fIFICHIER\fP est précédé par les arguments
|
Le format spécifique du \fIFICHIER\fP est précédé par les arguments
|
||||||
\fB\-i\fP , ou \fB\-e\fP . Si l\(aqoption \fB\-f\fP n\(aqest pas donnée pour le \fIFICHIER\fP ,
|
\fB\-i\fP , ou \fB\-e\fP . Si l\(aqoption \fB\-f\fP n\(aqest pas donnée pour le \fIFICHIER\fP ,
|
||||||
alors le format sera celui de l\(aqextension ou du type\-MIME.
|
alors le format sera celui de l\(aqextension ou du type\-MIME.
|
||||||
.sp
|
.sp
|
||||||
Les formats de sortie disponibles sont \fBgramps\-xml\fP (deviné si
|
Les formats de sortie disponibles sont \fBgramps\-xml\fP (deviné si
|
||||||
@@ -96,10 +96,10 @@ Débloquer une base de données verrouillée.
|
|||||||
.TP
|
.TP
|
||||||
.B \fB\-O\fP , \fB\-\-open=\fP \fIBASE_DE_DONNEES\fP
|
.B \fB\-O\fP , \fB\-\-open=\fP \fIBASE_DE_DONNEES\fP
|
||||||
Ouvrir une \fIBASE_DE_DONNEES\fP qui doit être une base présente dans
|
Ouvrir une \fIBASE_DE_DONNEES\fP qui doit être une base présente dans
|
||||||
le répertoire des bases ou le nom d\(aqun arbre familial existant.
|
le répertoire des bases ou le nom d\(aqun arbre familial existant.
|
||||||
Si aucune action n\(aqest définie, les options d\(aqimport ou d\(aqexport
|
Si aucune action n\(aqest définie, les options d\(aqimport ou d\(aqexport
|
||||||
sont données par la ligne de commande puis une session interac‐
|
sont données par la ligne de commande puis une session interactive
|
||||||
tive est ouverte, utilisant cette base de données.
|
est ouverte, utilisant cette base de données.
|
||||||
.sp
|
.sp
|
||||||
Seulement une base peut être ouverte. Si vous utilisez plusieurs
|
Seulement une base peut être ouverte. Si vous utilisez plusieurs
|
||||||
sources, vous devez utiliser l\(aqoption d\(aqimport.
|
sources, vous devez utiliser l\(aqoption d\(aqimport.
|
||||||
@@ -109,9 +109,9 @@ Importer des données depuis un \fIFICHIER\fP . Si vous n\(aqavez pas
|
|||||||
spécifié de base de données alors une base de données temporaire
|
spécifié de base de données alors une base de données temporaire
|
||||||
est utilisée; elle sera effacée quand vous quitterez gramps.
|
est utilisée; elle sera effacée quand vous quitterez gramps.
|
||||||
.sp
|
.sp
|
||||||
Quand plus d\(aqun fichier doit être importé, chacun doit être
|
Quand plus d\(aqun fichier doit être importé, chacun doit être
|
||||||
précédé par la commande \fB\-i\fP . Ces fichiers sont importés dans le
|
précédé par la commande \fB\-i\fP . Ces fichiers sont importés dans le
|
||||||
même ordre, i.e. \fB\-i\fP \fIFICHIER1\fP \fB\-i\fP \fIFICHIER2\fP et \fB\-i\fP \fIFICHIER2\fP \fB\-i\fP
|
même ordre, \fB\-i\fP \fIFICHIER1\fP \fB\-i\fP \fIFICHIER2\fP et \fB\-i\fP \fIFICHIER2\fP \fB\-i\fP
|
||||||
\fIFICHIER1\fP vont tous les deux produire différents IDs gramps.
|
\fIFICHIER1\fP vont tous les deux produire différents IDs gramps.
|
||||||
.TP
|
.TP
|
||||||
.B \fB\-e\fP , \fB\-\-export=\fP \fIFICHIER\fP
|
.B \fB\-e\fP , \fB\-\-export=\fP \fIFICHIER\fP
|
||||||
@@ -124,17 +124,15 @@ précédé par la commande \fB\-e\fP . Ces fichiers sont importés dans le
|
|||||||
même ordre.
|
même ordre.
|
||||||
.TP
|
.TP
|
||||||
.B \fB\-a\fP , \fB\-\-action=\fP \fIACTION\fP
|
.B \fB\-a\fP , \fB\-\-action=\fP \fIACTION\fP
|
||||||
.INDENT 7.0
|
|
||||||
.INDENT 3.5
|
|
||||||
Accomplir une \fIACTION\fP sur les données importées. C\(aqest effectué à
|
Accomplir une \fIACTION\fP sur les données importées. C\(aqest effectué à
|
||||||
la fin de l\(aqimportation. Les actions possibles sont \fBsummary\fP
|
la fin de l\(aqimportation. Les actions possibles sont \fBsummary\fP
|
||||||
(comme le rapport \-> Afficher \-> Statistiques sur la base),
|
(comme le rapport \-> Afficher \-> Statistiques sur la base),
|
||||||
\fBcheck\fP (comme l\(aqoutil \-> Réparation de la base \-> Vérifier et
|
\fBcheck\fP (comme l\(aqoutil \-> Réparation de la base \-> Vérifier et
|
||||||
réparer), \fBreport\fP (produit un rapport) et \fBtool\fP (utilise un
|
réparer), \fBreport\fP (produit un rapport) et \fBtool\fP (utilise un
|
||||||
outil), ces derniers ont besoin de \fIOPTION\fP précédé par la commande \-p.
|
outil), ces derniers ont besoin de \fIOPTION\fP précédé par la commande \-p.
|
||||||
.sp
|
.sp
|
||||||
L\(aq \fIOPTION\fP doit satisfaire ces conditions:
|
L\(aq \fIOPTION\fP doit satisfaire ces conditions:
|
||||||
Il ne doit pas y avoir d\(aqespace. Si certains arguments doivent
|
Il ne doit pas y avoir d\(aqespace. Si certains arguments doivent
|
||||||
utiliser des espaces, la chaîne doit être encadrée par des
|
utiliser des espaces, la chaîne doit être encadrée par des
|
||||||
guillemets. Les options vont par paire nom et valeur. Une
|
guillemets. Les options vont par paire nom et valeur. Une
|
||||||
paire est séparée par un signe égal. Différentes paires sont
|
paire est séparée par un signe égal. Différentes paires sont
|
||||||
@@ -144,25 +142,21 @@ La plupart des options sont spécifiques à chaque rapport. Même
|
|||||||
s\(aqil existe des options communes.
|
s\(aqil existe des options communes.
|
||||||
.sp
|
.sp
|
||||||
\fBname=name\fP
|
\fBname=name\fP
|
||||||
Cette option est obligatoire, elle détermine quel rapport ou
|
Cette option est obligatoire, elle détermine quel rapport ou
|
||||||
outil sera utilisé. Si le name saisi ne correspond à aucun
|
outil sera utilisé. Si le name saisi ne correspond à aucun
|
||||||
module disponible, un message d\(aqerreur sera ajouté.
|
module disponible, un message d\(aqerreur sera ajouté.
|
||||||
.sp
|
.sp
|
||||||
\fBshow=all\fP
|
\fBshow=all\fP
|
||||||
Cette option produit une liste avec les noms des options
|
Cette option produit une liste avec les noms des options
|
||||||
disponibles pour un rapport donné.
|
disponibles pour un rapport donné.
|
||||||
.UNINDENT
|
|
||||||
.UNINDENT
|
|
||||||
.sp
|
.sp
|
||||||
\fBshow=optionname\fP
|
\fBshow=optionname\fP
|
||||||
Cette option affiche une description de toutes les fonctionnalités
|
Cette option affiche une description de toutes les fonctionnalités
|
||||||
proposées par optionname, aussi bien les types que les valeurs pour une option.
|
proposées par optionname, aussi bien les types que les valeurs pour une option.
|
||||||
.INDENT 7.0
|
.sp
|
||||||
.TP
|
Utiliser les options ci\-dessus pour trouver tout sur un rapport
|
||||||
.B Utiliser les options ci\-dessus pour trouver tout sur un rapport
|
|
||||||
choisi.
|
choisi.
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.UNINDENT
|
|
||||||
.sp
|
.sp
|
||||||
Quand plus d\(aqune action doit être effectuée, chacune doit être précédée
|
Quand plus d\(aqune action doit être effectuée, chacune doit être précédée
|
||||||
par la commande \fB\-a\fP . Les actions seront réalisées une à une, dans
|
par la commande \fB\-a\fP . Les actions seront réalisées une à une, dans
|
||||||
@@ -179,11 +173,11 @@ Imprime le numéro de version pour gramps puis quitte.
|
|||||||
.TP
|
.TP
|
||||||
.B \fBOpération\fP
|
.B \fBOpération\fP
|
||||||
Si le premie argument de la ligne de commande ne commence pas par un
|
Si le premie argument de la ligne de commande ne commence pas par un
|
||||||
tiret (i.e. pas d\(aqinstruction), gramps va essayer d\(aqouvrir la base de
|
tiret (i.e. pas d\(aqinstruction), gramps va essayer d\(aqouvrir la base de
|
||||||
données avec le nom donné par le premier argument et démarrer une ses‐
|
données avec le nom donné par le premier argument et démarrer une ses‐
|
||||||
sion interactive, en ignorant le reste de la ligne de commande.
|
sion interactive, en ignorant le reste de la ligne de commande.
|
||||||
.sp
|
.sp
|
||||||
Si la commande \fB\-O\fP est notée, alors gramps va essayer le fichier défini
|
Si la commande \fB\-O\fP est notée, alors gramps va essayer le fichier défini
|
||||||
et va travailler avec ses données, comme pour les autres paramètres de
|
et va travailler avec ses données, comme pour les autres paramètres de
|
||||||
la ligne de commande.
|
la ligne de commande.
|
||||||
.sp
|
.sp
|
||||||
@@ -208,7 +202,7 @@ Utilisez les shell de redirection de \fIstdout\fP et \fIstderr\fP pour sauver
|
|||||||
les messages et les erreurs dans les fichiers.
|
les messages et les erreurs dans les fichiers.
|
||||||
.TP
|
.TP
|
||||||
.B \fBEXEMPLES\fP
|
.B \fBEXEMPLES\fP
|
||||||
Pour ouvrir un arbre familial et y importer un fichier XML, on peut
|
Pour ouvrir un arbre familial et y importer un fichier XML, on peut
|
||||||
saisir:
|
saisir:
|
||||||
.INDENT 7.0
|
.INDENT 7.0
|
||||||
.INDENT 3.5
|
.INDENT 3.5
|
||||||
@@ -217,8 +211,8 @@ saisir:
|
|||||||
.UNINDENT
|
.UNINDENT
|
||||||
.sp
|
.sp
|
||||||
Ceci ouvre un arbre familial, pour faire la même chose, mais importer
|
Ceci ouvre un arbre familial, pour faire la même chose, mais importer
|
||||||
dans un arbre familial temporaire et démarrer une session interactive,
|
dans un arbre familial temporaire et démarrer une session interactive,
|
||||||
on peut saisir:
|
on peut saisir :
|
||||||
.INDENT 7.0
|
.INDENT 7.0
|
||||||
.INDENT 3.5
|
.INDENT 3.5
|
||||||
\fBgramps \-i\fP \fI\(aqMon Arbre Familial\(aq\fP \fB\-i\fP \fI~/db3.gramps\fP
|
\fBgramps \-i\fP \fI\(aqMon Arbre Familial\(aq\fP \fB\-i\fP \fI~/db3.gramps\fP
|
||||||
@@ -292,22 +286,25 @@ PROFILE pour Windows 2000/XP).
|
|||||||
.TP
|
.TP
|
||||||
.B \fBCONCEPTS\fP
|
.B \fBCONCEPTS\fP
|
||||||
Gramps est un système basé sur le support de plugin\-python, permettant
|
Gramps est un système basé sur le support de plugin\-python, permettant
|
||||||
d\(aqimporter et d\(aqexporter, la saisie, générer des rapports, des outils,
|
d\(aqimporter et d\(aqexporter, la saisie, générer des rapports, des outils,
|
||||||
et afficher des filtres pouvant être ajoutés sans modifier le programme.
|
et afficher des filtres pouvant être ajoutés sans modifier le programme.
|
||||||
.sp
|
.sp
|
||||||
Par ailleurs, gramps permet la génération directe : impression, rap‐
|
Par ailleurs, gramps permet la génération directe : impression, rap‐
|
||||||
ports avec sortie vers d\(aqautres formats, comme \fILibreOffice.org\fP ,
|
ports avec sortie vers d\(aqautres formats, comme \fILibreOffice.org\fP ,
|
||||||
\fIHTML\fP , ou \fILaTeX\fP pour permettre à l\(aqutilisateur de choisir selon ses
|
\fIHTML\fP , ou \fILaTeX\fP pour permettre à l\(aqutilisateur de choisir selon ses
|
||||||
besoins
|
besoins
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.sp
|
.sp
|
||||||
\fBBUGS CONNUS ET LIMITATIONS\fP
|
\fBBUGS CONNUS ET LIMITATIONS\fP
|
||||||
|
.sp
|
||||||
\fBFICHIERS\fP
|
\fBFICHIERS\fP
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.INDENT 3.5
|
.INDENT 3.5
|
||||||
\fI${PREFIX}/bin/gramps\fP
|
\fI${PREFIX}/bin/gramps\fP
|
||||||
.sp
|
.sp
|
||||||
\fI${PREFIX}/share/gramps\fP
|
\fI${PREFIX}/lib/python/dist\-packages/gramps/\fP
|
||||||
|
.sp
|
||||||
|
\fI${PREFIX}/share/\fP
|
||||||
.sp
|
.sp
|
||||||
\fI${HOME}/.gramps\fP
|
\fI${HOME}/.gramps\fP
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
@@ -336,11 +333,10 @@ La documentation pour développeur est disponible sur le site
|
|||||||
\fI\%http://www.gramps-project.org/wiki/index.php?title=Portal:Developers\fP .
|
\fI\%http://www.gramps-project.org/wiki/index.php?title=Portal:Developers\fP .
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.sp
|
.sp
|
||||||
Janvier 2013 4.0.0 gramps(1)
|
gramps(1) @VERSION@ gramps(1)
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
Jerome Rapinat
|
Jerome Rapinat
|
||||||
.SH COPYRIGHT
|
.SH COPYRIGHT
|
||||||
2012, Gramps project
|
2012, Gramps project
|
||||||
.\" Generated by docutils manpage writer.
|
.\" Generated by docutils manpage writer.
|
||||||
.\"
|
|
||||||
.
|
.
|
||||||
|
@@ -298,9 +298,11 @@ or LaTeX to allow the users to modify the format to suit their needs.
|
|||||||
|
|
||||||
.SH FILES
|
.SH FILES
|
||||||
.LP
|
.LP
|
||||||
\fI${PREFIX}/bin/gramps\fP
|
\fI${PREFIX}/bin/gramps\fP
|
||||||
.br
|
.br
|
||||||
\fI${PREFIX}/share/gramps\fP
|
\fI${PREFIX}/lib/python/dist\-packages/gramps/\fP
|
||||||
|
.br
|
||||||
|
\fI${PREFIX}/share/\fP
|
||||||
.br
|
.br
|
||||||
\fI${HOME}/.gramps\fP
|
\fI${HOME}/.gramps\fP
|
||||||
|
|
||||||
|
@@ -1,15 +0,0 @@
|
|||||||
# This is the data/man/nl level Makefile for Gramps
|
|
||||||
# $Id: Makefile.am 9819 2008-01-15 15:42:10Z bmcage $
|
|
||||||
|
|
||||||
mandir = @mandir@/nl
|
|
||||||
|
|
||||||
man_IN_FILES = gramps.1.in
|
|
||||||
man_MANS = $(man_IN_FILES:.1.in=.1)
|
|
||||||
|
|
||||||
EXTRA_DIST = $(man_MANS) $(man_IN_FILES)
|
|
||||||
|
|
||||||
gramps.1: $(top_builddir)/config.status gramps.1.in
|
|
||||||
cd $(top_builddir) && CONFIG_FILES=data/man/nl/$@ $(SHELL) ./config.status
|
|
||||||
|
|
||||||
CLEANFILES=$(man_MANS)
|
|
||||||
|
|
@@ -227,11 +227,14 @@ gramps(1) 3.4.0 gramps(1)
|
|||||||
|
|
||||||
|
|
||||||
**GEKENDE BUGS EN BEPERKINGEN**
|
**GEKENDE BUGS EN BEPERKINGEN**
|
||||||
|
|
||||||
**BESTANDEN**
|
**BESTANDEN**
|
||||||
|
|
||||||
*${PREFIX}/bin/gramps*
|
*${PREFIX}/bin/gramps*
|
||||||
|
|
||||||
*${PREFIX}/share/gramps*
|
*${PREFIX}/lib/python/dist-packages/gramps/*
|
||||||
|
|
||||||
|
*${PREFIX}/share/*
|
||||||
|
|
||||||
*${HOME}/.gramps*
|
*${HOME}/.gramps*
|
||||||
|
|
||||||
|
@@ -1,14 +0,0 @@
|
|||||||
# This is the data/man/sv level Makefile for Gramps
|
|
||||||
# $Id: Makefile.am 6189 2006-03-21 19:05:46Z rshura $
|
|
||||||
|
|
||||||
man_IN_FILES = gramps.1.in
|
|
||||||
man_MANS = $(man_IN_FILES:.1.in=.1)
|
|
||||||
|
|
||||||
mandir = @mandir@/pl
|
|
||||||
|
|
||||||
EXTRA_DIST = $(man_MANS) $(man_IN_FILES)
|
|
||||||
|
|
||||||
gramps.1: $(top_builddir)/config.status gramps.1.in
|
|
||||||
cd $(top_builddir) && CONFIG_FILES=data/man/pl/$@ $(SHELL) ./config.status
|
|
||||||
|
|
||||||
CLEANFILES=$(man_MANS)
|
|
@@ -276,7 +276,9 @@ gramps(1) 3.4.0 gramps(1)
|
|||||||
|
|
||||||
*${PREFIX}/bin/gramps*
|
*${PREFIX}/bin/gramps*
|
||||||
|
|
||||||
*${PREFIX}/share/gramps*
|
*${PREFIX}/lib/python/dist-packages/gramps/*
|
||||||
|
|
||||||
|
*${PREFIX}/share/*
|
||||||
|
|
||||||
*${HOME}/.gramps (jeśli nie użyta została zmienna środowiskowa GRAMP‐
|
*${HOME}/.gramps (jeśli nie użyta została zmienna środowiskowa GRAMP‐
|
||||||
SHOME)*
|
SHOME)*
|
||||||
|
@@ -1,14 +0,0 @@
|
|||||||
# This is the data/pt_BR level Makefile for Gramps
|
|
||||||
# $Id: Makefile.am 16377 2011-01-13 18:32:42Z matlas $
|
|
||||||
|
|
||||||
man_IN_FILES = gramps.1.in
|
|
||||||
man_MANS = $(man_IN_FILES:.1.in=.1)
|
|
||||||
|
|
||||||
mandir = @mandir@/pt_BR
|
|
||||||
|
|
||||||
EXTRA_DIST = $(man_MANS) $(man_IN_FILES)
|
|
||||||
|
|
||||||
gramps.1: $(top_builddir)/config.status gramps.1.in
|
|
||||||
cd $(top_builddir) && CONFIG_FILES=data/man/pt_BR/$@ $(SHELL) ./config.status
|
|
||||||
|
|
||||||
CLEANFILES=$(man_MANS)
|
|
@@ -255,9 +255,11 @@ gramps(1) 4.0.0 gramps(1)
|
|||||||
*ARQUIVOS**
|
*ARQUIVOS**
|
||||||
|
|
||||||
*${PREFIX}/bin/gramps*
|
*${PREFIX}/bin/gramps*
|
||||||
|
|
||||||
*${PREFIX}/share/gramps*
|
*${PREFIX}/lib/python/dist-packages/gramps/*
|
||||||
|
|
||||||
|
*${PREFIX}/share/*
|
||||||
|
|
||||||
*${HOME}/.gramps*
|
*${HOME}/.gramps*
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,14 +0,0 @@
|
|||||||
# This is the data/man/sv level Makefile for Gramps
|
|
||||||
# $Id: Makefile.am 6189 2006-03-21 19:05:46Z rshura $
|
|
||||||
|
|
||||||
man_IN_FILES = gramps.1.in
|
|
||||||
man_MANS = $(man_IN_FILES:.1.in=.1)
|
|
||||||
|
|
||||||
mandir = @mandir@/sv
|
|
||||||
|
|
||||||
EXTRA_DIST = $(man_MANS) $(man_IN_FILES)
|
|
||||||
|
|
||||||
gramps.1: $(top_builddir)/config.status gramps.1.in
|
|
||||||
cd $(top_builddir) && CONFIG_FILES=data/man/sv/$@ $(SHELL) ./config.status
|
|
||||||
|
|
||||||
CLEANFILES=$(man_MANS)
|
|
@@ -246,7 +246,9 @@ Gramps(1) 3.4.0 Gramps(1)
|
|||||||
|
|
||||||
*${PREFIX}/bin/gramps*
|
*${PREFIX}/bin/gramps*
|
||||||
|
|
||||||
*${PREFIX}/share/gramps*
|
*${PREFIX}/lib/python/dist-packages/gramps/*
|
||||||
|
|
||||||
|
*${PREFIX}/share/*
|
||||||
|
|
||||||
*${HOME}/.gramps*
|
*${HOME}/.gramps*
|
||||||
|
|
||||||
|
@@ -52,11 +52,11 @@ SPHINXBUILD = 'sphinx-build'
|
|||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
|
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
|
||||||
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
|
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
|
||||||
elif sys.platform == 'linux2' or os.name == 'darwin':
|
elif sys.platform in ['linux2', 'darwin', 'cygwin']:
|
||||||
pythonCmd = os.path.join(sys.prefix, 'bin', 'python')
|
pythonCmd = os.path.join(sys.prefix, 'bin', 'python')
|
||||||
sphinxCmd = SPHINXBUILD
|
sphinxCmd = SPHINXBUILD
|
||||||
else:
|
else:
|
||||||
print ("ERROR: unknown system, don't know sphinx, ... commands")
|
print ("Update Man ERROR: unknown system, don't know sphinx, ... commands")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
def tests():
|
def tests():
|
||||||
|
@@ -42,11 +42,11 @@ SPHINXBUILD = 'sphinx-build'
|
|||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
|
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
|
||||||
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
|
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
|
||||||
elif sys.platform == 'linux2' or os.name == 'darwin':
|
elif sys.platform in ['linux2', 'darwin', 'cygwin']:
|
||||||
pythonCmd = os.path.join(sys.prefix, 'bin', 'python')
|
pythonCmd = os.path.join(sys.prefix, 'bin', 'python')
|
||||||
sphinxCmd = SPHINXBUILD
|
sphinxCmd = SPHINXBUILD
|
||||||
else:
|
else:
|
||||||
print ("ERROR: unknown system, don't know sphinx, ... commands")
|
print ("Update Docs ERROR: unknown system, don't know sphinx, ... commands")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
def tests():
|
def tests():
|
||||||
|
7
example/csv/example.csv
Normal file
7
example/csv/example.csv
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
person,surname,given
|
||||||
|
a,"CSV Surname","Given 1"
|
||||||
|
b,"CSV Surname","Given 2"
|
||||||
|
|
||||||
|
marriage,mother,father
|
||||||
|
1,a,b
|
||||||
|
|
|
Binary file not shown.
@@ -39,7 +39,8 @@ Module responsible for handling the command line arguments for GRAMPS.
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from gramps.gen.ggettext import gettext as _
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@@ -185,9 +186,9 @@ class ArgHandler(object):
|
|||||||
else:
|
else:
|
||||||
# Need to convert to system file encoding before printing
|
# Need to convert to system file encoding before printing
|
||||||
# For non latin characters in path/file/user names
|
# For non latin characters in path/file/user names
|
||||||
print(msg1.encode(sys.getfilesystemencoding()), file=sys.stderr)
|
print(msg1.encode(sys.stdout.encoding, 'backslashreplace'), file=sys.stderr)
|
||||||
if msg2 is not None:
|
if msg2 is not None:
|
||||||
print(msg2.encode(sys.getfilesystemencoding()), file=sys.stderr)
|
print(msg2.encode(sys.stdout.encoding, 'backslashreplace'), file=sys.stderr)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
# Argument parser: sorts out given arguments
|
# Argument parser: sorts out given arguments
|
||||||
@@ -294,7 +295,7 @@ class ArgHandler(object):
|
|||||||
else:
|
else:
|
||||||
ask = input
|
ask = input
|
||||||
ans = ask(_('OK to overwrite? (yes/no) ') \
|
ans = ask(_('OK to overwrite? (yes/no) ') \
|
||||||
.encode(sys.getfilesystemencoding()))
|
.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||||
except EOFError:
|
except EOFError:
|
||||||
print()
|
print()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
@@ -408,26 +409,26 @@ class ArgHandler(object):
|
|||||||
|
|
||||||
if self.list:
|
if self.list:
|
||||||
print(_('List of known family trees in your database path\n').\
|
print(_('List of known family trees in your database path\n').\
|
||||||
encode(sys.getfilesystemencoding()))
|
encode(sys.stdout.encoding, 'backslashreplace'))
|
||||||
for name, dirname in sorted(self.dbman.family_tree_list(),
|
for name, dirname in sorted(self.dbman.family_tree_list(),
|
||||||
key=lambda pair: pair[0].lower()):
|
key=lambda pair: pair[0].lower()):
|
||||||
|
|
||||||
print((_("%(full_DB_path)s with name \"%(f_t_name)s\"") % \
|
print((_("%(full_DB_path)s with name \"%(f_t_name)s\"") % \
|
||||||
{'full_DB_path' : dirname,
|
{'full_DB_path' : dirname,
|
||||||
'f_t_name' : name}).encode(sys.getfilesystemencoding()))
|
'f_t_name' : name}).encode(sys.stdout.encoding, 'backslashreplace'))
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
if self.list_more:
|
if self.list_more:
|
||||||
print(_('Gramps Family Trees:').encode(sys.getfilesystemencoding()))
|
print(_('Gramps Family Trees:').encode(sys.stdout.encoding, 'backslashreplace'))
|
||||||
summary_list = self.dbman.family_tree_summary()
|
summary_list = self.dbman.family_tree_summary()
|
||||||
for summary in sorted(summary_list,
|
for summary in sorted(summary_list,
|
||||||
key=lambda sum: sum["Family tree"].lower()):
|
key=lambda sum: sum["Family tree"].lower()):
|
||||||
print(_("Family Tree \"%s\":").\
|
print(_("Family Tree \"%s\":").\
|
||||||
encode(sys.getfilesystemencoding()) % summary["Family tree"])
|
encode(sys.stdout.encoding, 'backslashreplace') % summary["Family tree"])
|
||||||
for item in sorted(summary):
|
for item in sorted(summary):
|
||||||
if item != "Family tree":
|
if item != "Family tree":
|
||||||
print((" %s: %s" % (item, summary[item])).\
|
print((" %s: %s" % (item, summary[item])).\
|
||||||
encode(sys.getfilesystemencoding()))
|
encode(sys.stdout.encoding, 'backslashreplace'))
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
self.__open_action()
|
self.__open_action()
|
||||||
@@ -442,7 +443,7 @@ class ArgHandler(object):
|
|||||||
for expt in self.exports:
|
for expt in self.exports:
|
||||||
# Need to convert path/filename to str before printing
|
# Need to convert path/filename to str before printing
|
||||||
# For non latin characters in Windows path/file/user names
|
# For non latin characters in Windows path/file/user names
|
||||||
fn = expt[0].encode(sys.getfilesystemencoding())
|
fn = expt[0].encode(sys.stdout.encoding, 'backslashreplace')
|
||||||
fmt = str(expt[1])
|
fmt = str(expt[1])
|
||||||
print(_("Exporting: file %(filename)s, "
|
print(_("Exporting: file %(filename)s, "
|
||||||
"format %(format)s.") % \
|
"format %(format)s.") % \
|
||||||
@@ -480,7 +481,7 @@ class ArgHandler(object):
|
|||||||
self.imp_db_path, title = self.dbman.create_new_db_cli()
|
self.imp_db_path, title = self.dbman.create_new_db_cli()
|
||||||
else:
|
else:
|
||||||
self.imp_db_path = get_empty_tempdir("import_dbdir") \
|
self.imp_db_path = get_empty_tempdir("import_dbdir") \
|
||||||
.encode(sys.getfilesystemencoding())
|
.encode(sys.stdout.encoding, 'backslashreplace')
|
||||||
newdb = DbBsddb()
|
newdb = DbBsddb()
|
||||||
newdb.write_version(self.imp_db_path)
|
newdb.write_version(self.imp_db_path)
|
||||||
|
|
||||||
@@ -494,7 +495,7 @@ class ArgHandler(object):
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
for imp in self.imports:
|
for imp in self.imports:
|
||||||
fn = imp[0].encode(sys.getfilesystemencoding())
|
fn = imp[0].encode(sys.stdout.encoding, 'backslashreplace')
|
||||||
fmt = str(imp[1])
|
fmt = str(imp[1])
|
||||||
msg = _("Importing: file %(filename)s, format %(format)s.") % \
|
msg = _("Importing: file %(filename)s, format %(format)s.") % \
|
||||||
{'filename' : fn, 'format' : fmt}
|
{'filename' : fn, 'format' : fmt}
|
||||||
@@ -623,10 +624,10 @@ class ArgHandler(object):
|
|||||||
# Print cli report name ([item[0]), GUI report name (item[4])
|
# Print cli report name ([item[0]), GUI report name (item[4])
|
||||||
if len(pdata.id) <= 25:
|
if len(pdata.id) <= 25:
|
||||||
print(" %s%s- %s" % ( pdata.id, " " * (26 - len(pdata.id)),
|
print(" %s%s- %s" % ( pdata.id, " " * (26 - len(pdata.id)),
|
||||||
pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
|
pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
|
||||||
else:
|
else:
|
||||||
print(" %s\t- %s" % (pdata.id,
|
print(" %s\t- %s" % (pdata.id,
|
||||||
pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
|
pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
|
||||||
|
|
||||||
elif action == "tool":
|
elif action == "tool":
|
||||||
from gramps.gui.plug import tool
|
from gramps.gui.plug import tool
|
||||||
@@ -664,10 +665,10 @@ class ArgHandler(object):
|
|||||||
# Print cli report name ([item[0]), GUI report name (item[4])
|
# Print cli report name ([item[0]), GUI report name (item[4])
|
||||||
if len(pdata.id) <= 25:
|
if len(pdata.id) <= 25:
|
||||||
print(" %s%s- %s" % ( pdata.id, " " * (26 - len(pdata.id)),
|
print(" %s%s- %s" % ( pdata.id, " " * (26 - len(pdata.id)),
|
||||||
pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
|
pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
|
||||||
else:
|
else:
|
||||||
print(" %s\t- %s" % (pdata.id,
|
print(" %s\t- %s" % (pdata.id,
|
||||||
pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
|
pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
|
||||||
|
|
||||||
elif action == "book":
|
elif action == "book":
|
||||||
try:
|
try:
|
||||||
|
@@ -39,7 +39,8 @@ Module responsible for handling the command line arguments for GRAMPS.
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import sys
|
import sys
|
||||||
import getopt
|
import getopt
|
||||||
from gramps.gen.ggettext import gettext as _
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@@ -292,7 +293,7 @@ class ArgParser(object):
|
|||||||
self.list_more = True
|
self.list_more = True
|
||||||
elif option in ('-s','--show'):
|
elif option in ('-s','--show'):
|
||||||
print ("Gramps config settings from %s:" % \
|
print ("Gramps config settings from %s:" % \
|
||||||
config.filename.encode(sys.getfilesystemencoding()))
|
config.filename.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||||
for section in config.data:
|
for section in config.data:
|
||||||
for setting in config.data[section]:
|
for setting in config.data[section]:
|
||||||
print ("%s.%s=%s" % (
|
print ("%s.%s=%s" % (
|
||||||
@@ -402,7 +403,7 @@ class ArgParser(object):
|
|||||||
"""
|
"""
|
||||||
if self.help:
|
if self.help:
|
||||||
# Convert Help messages to file system encoding before printing
|
# Convert Help messages to file system encoding before printing
|
||||||
print (_HELP.encode(sys.getfilesystemencoding()))
|
print (_HELP.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
def print_usage(self):
|
def print_usage(self):
|
||||||
@@ -411,5 +412,5 @@ class ArgParser(object):
|
|||||||
"""
|
"""
|
||||||
if self.usage:
|
if self.usage:
|
||||||
# Convert Help messages to file system encoding before printing
|
# Convert Help messages to file system encoding before printing
|
||||||
print (_USAGE.encode(sys.getfilesystemencoding()))
|
print (_USAGE.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
@@ -44,7 +44,6 @@ else:
|
|||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from urllib.request import urlopen, url2pathname
|
from urllib.request import urlopen, url2pathname
|
||||||
import tempfile
|
import tempfile
|
||||||
from gramps.gen.ggettext import gettext as _
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# set up logging
|
# set up logging
|
||||||
@@ -58,6 +57,8 @@ LOG = logging.getLogger(".clidbman")
|
|||||||
# gramps modules
|
# gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
from gramps.gen.db import DbBsddb
|
from gramps.gen.db import DbBsddb
|
||||||
from gramps.gen.plug import BasePluginManager
|
from gramps.gen.plug import BasePluginManager
|
||||||
from gramps.gen.config import config
|
from gramps.gen.config import config
|
||||||
@@ -158,6 +159,7 @@ class CLIDbManager(object):
|
|||||||
try:
|
try:
|
||||||
dbmap1.open(fname, META, db.DB_HASH, db.DB_RDONLY)
|
dbmap1.open(fname, META, db.DB_HASH, db.DB_RDONLY)
|
||||||
except:
|
except:
|
||||||
|
env.close()
|
||||||
return "Unknown", "Unknown"
|
return "Unknown", "Unknown"
|
||||||
version = dbmap1.get('version', default=None)
|
version = dbmap1.get('version', default=None)
|
||||||
dbmap1.close()
|
dbmap1.close()
|
||||||
@@ -191,7 +193,7 @@ class CLIDbManager(object):
|
|||||||
retval["Locked?"] = "no"
|
retval["Locked?"] = "no"
|
||||||
retval["DB version"] = version
|
retval["DB version"] = version
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
retval["Family tree"] = name.encode(sys.getfilesystemencoding())
|
retval["Family tree"] = name.encode(glocale.getfilesystemencoding())
|
||||||
else:
|
else:
|
||||||
retval["Family tree"] = name
|
retval["Family tree"] = name
|
||||||
retval["Path"] = dirpath
|
retval["Path"] = dirpath
|
||||||
@@ -206,7 +208,7 @@ class CLIDbManager(object):
|
|||||||
# make the default directory if it does not exist
|
# make the default directory if it does not exist
|
||||||
dbdir = os.path.expanduser(config.get('behavior.database-path'))
|
dbdir = os.path.expanduser(config.get('behavior.database-path'))
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
dbdir = dbdir.encode(sys.getfilesystemencoding())
|
dbdir = dbdir.encode(glocale.getfilesystemencoding())
|
||||||
db_ok = make_dbdir(dbdir)
|
db_ok = make_dbdir(dbdir)
|
||||||
|
|
||||||
self.current_names = []
|
self.current_names = []
|
||||||
@@ -217,6 +219,7 @@ class CLIDbManager(object):
|
|||||||
if os.path.isfile(path_name):
|
if os.path.isfile(path_name):
|
||||||
file = open(path_name)
|
file = open(path_name)
|
||||||
name = file.readline().strip()
|
name = file.readline().strip()
|
||||||
|
file.close()
|
||||||
|
|
||||||
(tval, last) = time_val(dirpath)
|
(tval, last) = time_val(dirpath)
|
||||||
(enable, stock_id) = self.icon_values(dirpath, self.active,
|
(enable, stock_id) = self.icon_values(dirpath, self.active,
|
||||||
@@ -413,7 +416,7 @@ def make_dbdir(dbdir):
|
|||||||
if not os.path.isdir(dbdir):
|
if not os.path.isdir(dbdir):
|
||||||
os.makedirs(dbdir)
|
os.makedirs(dbdir)
|
||||||
except (IOError, OSError) as msg:
|
except (IOError, OSError) as msg:
|
||||||
msg = conv_to_unicode(str(msg), sys.getfilesystemencoding())
|
msg = conv_to_unicode(str(msg), glocale.getfilesystemencoding())
|
||||||
LOG.error(_("\nERROR: Wrong database path in Edit Menu->Preferences.\n"
|
LOG.error(_("\nERROR: Wrong database path in Edit Menu->Preferences.\n"
|
||||||
"Open preferences and set correct database path.\n\n"
|
"Open preferences and set correct database path.\n\n"
|
||||||
"Details: Could not make database directory:\n %s\n\n") % msg)
|
"Details: Could not make database directory:\n %s\n\n") % msg)
|
||||||
@@ -442,7 +445,7 @@ def find_next_db_dir():
|
|||||||
base = "%x" % int(time.time())
|
base = "%x" % int(time.time())
|
||||||
dbdir = os.path.expanduser(config.get('behavior.database-path'))
|
dbdir = os.path.expanduser(config.get('behavior.database-path'))
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
dbdir = dbdir.encode(sys.getfilesystemencoding())
|
dbdir = dbdir.encode(glocale.getfilesystemencoding())
|
||||||
new_path = os.path.join(dbdir, base)
|
new_path = os.path.join(dbdir, base)
|
||||||
if not os.path.isdir(new_path):
|
if not os.path.isdir(new_path):
|
||||||
break
|
break
|
||||||
@@ -485,7 +488,7 @@ def find_locker_name(dirpath):
|
|||||||
# Convert username to unicode according to system encoding
|
# Convert username to unicode according to system encoding
|
||||||
# Otherwise problems with non ASCII characters in
|
# Otherwise problems with non ASCII characters in
|
||||||
# username in Windows
|
# username in Windows
|
||||||
username = conv_to_unicode(username, sys.getfilesystemencoding())
|
username = conv_to_unicode(username, glocale.getfilesystemencoding())
|
||||||
# feature request 2356: avoid genitive form
|
# feature request 2356: avoid genitive form
|
||||||
last = _("Locked by %s") % username
|
last = _("Locked by %s") % username
|
||||||
ifile.close()
|
ifile.close()
|
||||||
|
@@ -35,7 +35,8 @@ Provides also two small base classes: CLIDbLoader, CLIManager
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
from gramps.gen.ggettext import gettext as _
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@@ -296,10 +297,10 @@ def startcli(errors, argparser):
|
|||||||
#already errors encountered. Show first one on terminal and exit
|
#already errors encountered. Show first one on terminal and exit
|
||||||
# Convert error message to file system encoding before print
|
# Convert error message to file system encoding before print
|
||||||
errmsg = _('Error encountered: %s') % errors[0][0]
|
errmsg = _('Error encountered: %s') % errors[0][0]
|
||||||
errmsg = errmsg.encode(sys.getfilesystemencoding())
|
errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
|
||||||
print(errmsg)
|
print(errmsg)
|
||||||
errmsg = _(' Details: %s') % errors[0][1]
|
errmsg = _(' Details: %s') % errors[0][1]
|
||||||
errmsg = errmsg.encode(sys.getfilesystemencoding())
|
errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
|
||||||
print(errmsg)
|
print(errmsg)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
@@ -307,10 +308,10 @@ def startcli(errors, argparser):
|
|||||||
# Convert error message to file system encoding before print
|
# Convert error message to file system encoding before print
|
||||||
errmsg = _('Error encountered in argument parsing: %s') \
|
errmsg = _('Error encountered in argument parsing: %s') \
|
||||||
% argparser.errors[0][0]
|
% argparser.errors[0][0]
|
||||||
errmsg = errmsg.encode(sys.getfilesystemencoding())
|
errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
|
||||||
print(errmsg)
|
print(errmsg)
|
||||||
errmsg = _(' Details: %s') % argparser.errors[0][1]
|
errmsg = _(' Details: %s') % argparser.errors[0][1]
|
||||||
errmsg = errmsg.encode(sys.getfilesystemencoding())
|
errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
|
||||||
print(errmsg)
|
print(errmsg)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
@@ -35,7 +35,8 @@
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
from gramps.gen.ggettext import gettext as _
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
import traceback
|
import traceback
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@@ -570,11 +571,11 @@ class CommandLineReport(object):
|
|||||||
# Make the output nicer to read, assume a tab has 8 spaces
|
# Make the output nicer to read, assume a tab has 8 spaces
|
||||||
tabs = '\t\t' if len(key) < 10 else '\t'
|
tabs = '\t\t' if len(key) < 10 else '\t'
|
||||||
optmsg = " %s%s%s (%s)" % (key, tabs, opt[1], opt[0])
|
optmsg = " %s%s%s (%s)" % (key, tabs, opt[1], opt[0])
|
||||||
print(optmsg.encode(sys.getfilesystemencoding()))
|
print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||||
else:
|
else:
|
||||||
optmsg = " %s%s%s" % (key, tabs,
|
optmsg = " %s%s%s" % (key, tabs,
|
||||||
_('(no help available)'))
|
_('(no help available)'))
|
||||||
print(optmsg.encode(sys.getfilesystemencoding()))
|
print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||||
print((_(" Use '%(donottranslate)s' to see description "
|
print((_(" Use '%(donottranslate)s' to see description "
|
||||||
"and acceptable values") %
|
"and acceptable values") %
|
||||||
{'donottranslate' : "show=option"}))
|
{'donottranslate' : "show=option"}))
|
||||||
@@ -587,10 +588,10 @@ class CommandLineReport(object):
|
|||||||
if isinstance(vals, (list, tuple)):
|
if isinstance(vals, (list, tuple)):
|
||||||
for val in vals:
|
for val in vals:
|
||||||
optmsg = " %s" % val
|
optmsg = " %s" % val
|
||||||
print(optmsg.encode(sys.getfilesystemencoding()))
|
print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||||
else:
|
else:
|
||||||
optmsg = " %s" % opt[2]
|
optmsg = " %s" % opt[2]
|
||||||
print(optmsg.encode(sys.getfilesystemencoding()))
|
print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
#there was a show option given, but the option is invalid
|
#there was a show option given, but the option is invalid
|
||||||
@@ -726,6 +727,7 @@ def cl_book(database, name, book, options_str_dict):
|
|||||||
clr.marginr, clr.margint, clr.marginb))
|
clr.marginr, clr.margint, clr.marginb))
|
||||||
user = User()
|
user = User()
|
||||||
rptlist = []
|
rptlist = []
|
||||||
|
global_style = None
|
||||||
for item in book.get_item_list():
|
for item in book.get_item_list():
|
||||||
|
|
||||||
# The option values were loaded magically by the book parser.
|
# The option values were loaded magically by the book parser.
|
||||||
@@ -743,6 +745,12 @@ def cl_book(database, name, book, options_str_dict):
|
|||||||
report_class, item.option_class, user)
|
report_class, item.option_class, user)
|
||||||
style_sheet = create_style_sheet(item)
|
style_sheet = create_style_sheet(item)
|
||||||
rptlist.append((obj, style_sheet))
|
rptlist.append((obj, style_sheet))
|
||||||
|
if ( item.name == 'table_of_contents' or
|
||||||
|
item.name == 'alphabetical_index' ): # ugly hack: FIXME
|
||||||
|
if global_style is None:
|
||||||
|
global_style = style_sheet
|
||||||
|
else:
|
||||||
|
global_style = create_style_sheet(item, global_style)
|
||||||
|
|
||||||
doc.open(clr.option_class.get_output())
|
doc.open(clr.option_class.get_output())
|
||||||
doc.init()
|
doc.init()
|
||||||
@@ -754,6 +762,8 @@ def cl_book(database, name, book, options_str_dict):
|
|||||||
newpage = 1
|
newpage = 1
|
||||||
rpt.begin_report()
|
rpt.begin_report()
|
||||||
rpt.write_report()
|
rpt.write_report()
|
||||||
|
if global_style:
|
||||||
|
doc.set_style_sheet(global_style)
|
||||||
doc.close()
|
doc.close()
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
|
@@ -38,7 +38,8 @@ import sys
|
|||||||
# Gramps Modules
|
# Gramps Modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from gramps.gen.ggettext import gettext as _
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
from gramps.gen.user import User
|
from gramps.gen.user import User
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
|
@@ -1,21 +0,0 @@
|
|||||||
# This is the src/data level Makefile for gramps
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
SUBDIRS =
|
|
||||||
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@/data
|
|
||||||
|
|
||||||
dist_pkgdata_DATA = \
|
|
||||||
authors.xml \
|
|
||||||
papersize.xml \
|
|
||||||
tips.xml\
|
|
||||||
lds.xml
|
|
||||||
|
|
||||||
# Rules for files with translatable strings
|
|
||||||
# These are taken care of by the intltool
|
|
||||||
xml_in_files = tips.xml.in
|
|
||||||
xml_files = $(xml_in_files:.xml.in=.xml)
|
|
||||||
@INTLTOOL_XML_NOMERGE_RULE@
|
|
||||||
|
|
||||||
EXTRA_DIST = $(xml_in_files)
|
|
||||||
CLEANFILES = $(xml_files)
|
|
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2005-2007 Donald N. Allingham
|
# Copyright (C) 2005-2007 Donald N. Allingham
|
||||||
# Copyright (C) 2008-2009 Gary Burton
|
# Copyright (C) 2008-2009 Gary Burton
|
||||||
# Copyright (C) 2009 Doug Blank <doug.blank@gmail.com>
|
# Copyright (C) 2009-2012 Doug Blank <doug.blank@gmail.com>
|
||||||
# Copyright (C) 2011 Tim G L Lyons
|
# Copyright (C) 2011 Tim G L Lyons
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
@@ -41,7 +41,8 @@ import logging
|
|||||||
# Gramps imports
|
# Gramps imports
|
||||||
#
|
#
|
||||||
#---------------------------------------------------------------
|
#---------------------------------------------------------------
|
||||||
from .ggettext import gettext as _
|
from .const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
from .const import HOME_DIR, USER_HOME, VERSION_DIR
|
from .const import HOME_DIR, USER_HOME, VERSION_DIR
|
||||||
from .utils.configmanager import ConfigManager
|
from .utils.configmanager import ConfigManager
|
||||||
|
|
||||||
@@ -151,6 +152,7 @@ register('behavior.surname-guessing', 0)
|
|||||||
register('behavior.use-tips', False)
|
register('behavior.use-tips', False)
|
||||||
register('behavior.welcome', 100)
|
register('behavior.welcome', 100)
|
||||||
register('behavior.web-search-url', 'http://google.com/#&q=%(text)s')
|
register('behavior.web-search-url', 'http://google.com/#&q=%(text)s')
|
||||||
|
register('behavior.addons-url', "http://svn.code.sf.net/p/gramps-addons/code/trunk/")
|
||||||
|
|
||||||
register('export.proxy-order', [
|
register('export.proxy-order', [
|
||||||
["privacy", 0],
|
["privacy", 0],
|
||||||
@@ -187,7 +189,7 @@ register('interface.clipboard-height', 300)
|
|||||||
register('interface.clipboard-width', 300)
|
register('interface.clipboard-width', 300)
|
||||||
register('interface.dont-ask', False)
|
register('interface.dont-ask', False)
|
||||||
register('interface.view-categories',
|
register('interface.view-categories',
|
||||||
["Gramplets", "People", "Relationships", "Families",
|
["Dashboard", "People", "Relationships", "Families",
|
||||||
"Ancestry", "Events", "Places", "Geography", "Sources",
|
"Ancestry", "Events", "Places", "Geography", "Sources",
|
||||||
"Citations", "Repositories", "Media", "Notes"])
|
"Citations", "Repositories", "Media", "Notes"])
|
||||||
register('interface.edit-filter-width', 500)
|
register('interface.edit-filter-width', 500)
|
||||||
@@ -208,6 +210,7 @@ register('interface.filter', False)
|
|||||||
register('interface.filter-editor-width', 400)
|
register('interface.filter-editor-width', 400)
|
||||||
register('interface.filter-editor-height', 350)
|
register('interface.filter-editor-height', 350)
|
||||||
register('interface.fullscreen', False)
|
register('interface.fullscreen', False)
|
||||||
|
register('interface.grampletbar-close', False)
|
||||||
register('interface.height', 500)
|
register('interface.height', 500)
|
||||||
register('interface.lds-height', 450)
|
register('interface.lds-height', 450)
|
||||||
register('interface.lds-width', 600)
|
register('interface.lds-width', 600)
|
||||||
@@ -278,6 +281,8 @@ register('preferences.date-format', 0)
|
|||||||
register('preferences.calendar-format-report', 0)
|
register('preferences.calendar-format-report', 0)
|
||||||
register('preferences.cprefix', 'C%04d')
|
register('preferences.cprefix', 'C%04d')
|
||||||
register('preferences.default-source', False)
|
register('preferences.default-source', False)
|
||||||
|
register('preferences.tag-on-import', False)
|
||||||
|
register('preferences.tag-on-import-format', _("Imported %Y/%m/%d %H:%M:%S"))
|
||||||
register('preferences.eprefix', 'E%04d')
|
register('preferences.eprefix', 'E%04d')
|
||||||
register('preferences.family-warn', True)
|
register('preferences.family-warn', True)
|
||||||
register('preferences.fprefix', 'F%04d')
|
register('preferences.fprefix', 'F%04d')
|
||||||
|
@@ -42,7 +42,7 @@ import uuid
|
|||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .ggettext import sgettext as _
|
from .svn_revision import get_svn_revision
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@@ -50,11 +50,20 @@ from .ggettext import sgettext as _
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
PROGRAM_NAME = "Gramps"
|
PROGRAM_NAME = "Gramps"
|
||||||
if "@VERSIONSTRING@" == "@" + "VERSIONSTRING" + "@":
|
VERSION = "@VERSIONSTRING@"
|
||||||
VERSION = "4.0.0"
|
if VERSION == "@" + "VERSIONSTRING" + "@":
|
||||||
else:
|
raise Exception("Please run 'python setup.py build'")
|
||||||
VERSION = "@VERSIONSTRING@"
|
def get_version_tuple(v):
|
||||||
VERSION_TUPLE = (4, 0, 0)
|
""" Get the numeric-dotted part of version number"""
|
||||||
|
retval = ""
|
||||||
|
for c in v:
|
||||||
|
if c.isdigit() or (c == "." and retval.count(".") <= 1):
|
||||||
|
retval += c
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
return tuple(map(int, retval.split(".")))
|
||||||
|
VERSION_TUPLE = get_version_tuple(VERSION)
|
||||||
|
major_version = "%s.%s" % (VERSION_TUPLE[0], VERSION_TUPLE[1])
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@@ -65,11 +74,11 @@ URL_HOMEPAGE = "http://gramps-project.org/"
|
|||||||
URL_MAILINGLIST = "http://sourceforge.net/mail/?group_id=25770"
|
URL_MAILINGLIST = "http://sourceforge.net/mail/?group_id=25770"
|
||||||
URL_BUGTRACKER = "http://bugs.gramps-project.org/bug_report_advanced_page.php"
|
URL_BUGTRACKER = "http://bugs.gramps-project.org/bug_report_advanced_page.php"
|
||||||
URL_WIKISTRING = "http://gramps-project.org/wiki/index.php?title="
|
URL_WIKISTRING = "http://gramps-project.org/wiki/index.php?title="
|
||||||
URL_MANUAL_PAGE = "Gramps_4.0_Wiki_Manual"
|
URL_MANUAL_PAGE = "Gramps_%s_Wiki_Manual" % major_version
|
||||||
WIKI_FAQ = "FAQ"
|
WIKI_FAQ = "FAQ"
|
||||||
WIKI_KEYBINDINGS = "Gramps_4.0_Wiki_Manual_-_Keybindings"
|
WIKI_KEYBINDINGS = "Gramps_%s_Wiki_Manual_-_Keybindings" % major_version
|
||||||
WIKI_EXTRAPLUGINS= "4.0_Addons"
|
WIKI_EXTRAPLUGINS= "%s_Addons" % major_version
|
||||||
WIKI_EXTRAPLUGINS_RAWDATA = "Plugins4.0&action=raw"
|
WIKI_EXTRAPLUGINS_RAWDATA = "Plugins%s&action=raw" % major_version
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@@ -84,25 +93,6 @@ APP_GRAMPS_PKG = "application/x-gramps-package"
|
|||||||
APP_GENEWEB = "application/x-geneweb"
|
APP_GENEWEB = "application/x-geneweb"
|
||||||
APP_VCARD = ["text/x-vcard", "text/x-vcalendar"]
|
APP_VCARD = ["text/x-vcard", "text/x-vcalendar"]
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# system paths
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
if sys.platform == "win32":
|
|
||||||
if sys.prefix == os.path.dirname(os.getcwd()):
|
|
||||||
PREFIXDIR = sys.prefix
|
|
||||||
SYSCONFDIR = os.path.join(sys.prefix, "etc")
|
|
||||||
else:
|
|
||||||
PREFIXDIR = os.path.join(os.path.dirname(__file__), os.pardir)
|
|
||||||
SYSCONFDIR = os.path.join(PREFIXDIR, "etc")
|
|
||||||
elif sys.platform == "darwin" and sys.prefix != sys.exec_prefix:
|
|
||||||
PREFIXDIR = sys.prefix
|
|
||||||
SYSCONFDIR = os.path.join(sys.prefix, "etc")
|
|
||||||
else:
|
|
||||||
PREFIXDIR = "@prefix@"
|
|
||||||
SYSCONFDIR = "@sysconfdir@"
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Platforms
|
# Platforms
|
||||||
@@ -145,24 +135,6 @@ if sys.version_info[0] < 3:
|
|||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Paths to files - assumes that files reside in the same directory as
|
|
||||||
# this one, and that the plugins directory is in a directory below this.
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(
|
|
||||||
__file__), os.pardir))
|
|
||||||
if sys.version_info[0] < 3:
|
|
||||||
# test for sys.frozen to detect a py2exe executable on Windows
|
|
||||||
if hasattr(sys, "frozen"):
|
|
||||||
ROOT_DIR = os.path.abspath(os.path.dirname(
|
|
||||||
unicode(sys.executable, sys.getfilesystemencoding())))
|
|
||||||
else:
|
|
||||||
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(
|
|
||||||
unicode(__file__, sys.getfilesystemencoding())), os.pardir))
|
|
||||||
|
|
||||||
IMAGE_DIR = os.path.join(ROOT_DIR, "images")
|
|
||||||
VERSION_DIR = os.path.join(
|
VERSION_DIR = os.path.join(
|
||||||
HOME_DIR, "gramps%s%s" % (VERSION_TUPLE[0], VERSION_TUPLE[1]))
|
HOME_DIR, "gramps%s%s" % (VERSION_TUPLE[0], VERSION_TUPLE[1]))
|
||||||
|
|
||||||
@@ -180,15 +152,28 @@ USER_PLUGINS = os.path.join(VERSION_DIR, "plugins")
|
|||||||
USER_DIRLIST = (HOME_DIR, VERSION_DIR, ENV_DIR, TEMP_DIR, THUMB_DIR,
|
USER_DIRLIST = (HOME_DIR, VERSION_DIR, ENV_DIR, TEMP_DIR, THUMB_DIR,
|
||||||
THUMB_NORMAL, THUMB_LARGE, USER_PLUGINS)
|
THUMB_NORMAL, THUMB_LARGE, USER_PLUGINS)
|
||||||
|
|
||||||
ICON = os.path.join(ROOT_DIR, "images", "gramps.png")
|
#-------------------------------------------------------------------------
|
||||||
LOGO = os.path.join(ROOT_DIR, "images", "logo.png")
|
#
|
||||||
SPLASH = os.path.join(ROOT_DIR, "images", "splash.jpg")
|
# Paths to python modules - assumes that the root directory is one level
|
||||||
LICENSE_FILE = os.path.join(ROOT_DIR, "COPYING")
|
# above this one, and that the plugins directory is below the root directory.
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(
|
||||||
|
__file__), os.pardir))
|
||||||
|
if sys.version_info[0] < 3:
|
||||||
|
# test for sys.frozen to detect a py2exe executable on Windows
|
||||||
|
if hasattr(sys, "frozen"):
|
||||||
|
ROOT_DIR = os.path.abspath(os.path.dirname(
|
||||||
|
unicode(sys.executable, sys.getfilesystemencoding())))
|
||||||
|
else:
|
||||||
|
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(
|
||||||
|
unicode(__file__, sys.getfilesystemencoding())), os.pardir))
|
||||||
|
|
||||||
|
VERSION += get_svn_revision(ROOT_DIR)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Glade files
|
# Glade files
|
||||||
#
|
#
|
||||||
|
|
||||||
GLADE_DIR = os.path.join(ROOT_DIR, "gui", "glade")
|
GLADE_DIR = os.path.join(ROOT_DIR, "gui", "glade")
|
||||||
GLADE_FILE = os.path.join(GLADE_DIR, "gramps.glade")
|
GLADE_FILE = os.path.join(GLADE_DIR, "gramps.glade")
|
||||||
PERSON_GLADE = os.path.join(GLADE_DIR, "edit_person.glade")
|
PERSON_GLADE = os.path.join(GLADE_DIR, "edit_person.glade")
|
||||||
@@ -198,29 +183,51 @@ RULE_GLADE = os.path.join(GLADE_DIR, "rule.glade")
|
|||||||
|
|
||||||
|
|
||||||
PLUGINS_DIR = os.path.join(ROOT_DIR, "plugins")
|
PLUGINS_DIR = os.path.join(ROOT_DIR, "plugins")
|
||||||
DATA_DIR = os.path.join(ROOT_DIR, "data")
|
|
||||||
WEB_DIR = os.path.join(ROOT_DIR, 'webapp')
|
WEB_DIR = os.path.join(ROOT_DIR, 'webapp')
|
||||||
#SYSTEM_FILTERS = os.path.join(DATA_DIR, "system_filters.xml")
|
|
||||||
TIP_DATA = os.path.join(DATA_DIR, "tips.xml")
|
|
||||||
WEBSTUFF_DIR = os.path.join(PLUGINS_DIR, "webstuff")
|
WEBSTUFF_DIR = os.path.join(PLUGINS_DIR, "webstuff")
|
||||||
WEBSTUFF_IMAGE_DIR = os.path.join(WEBSTUFF_DIR, "images")
|
WEBSTUFF_IMAGE_DIR = os.path.join(WEBSTUFF_DIR, "images")
|
||||||
|
|
||||||
PAPERSIZE = os.path.join(DATA_DIR, "papersize.xml")
|
USE_TIPS = False
|
||||||
|
|
||||||
USE_TIPS = False
|
|
||||||
|
|
||||||
if os.sys.platform in WINDOWS:
|
if os.sys.platform in WINDOWS:
|
||||||
USE_THUMBNAILER = False
|
USE_THUMBNAILER = False
|
||||||
else:
|
else:
|
||||||
USE_THUMBNAILER = True
|
USE_THUMBNAILER = True
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Paths to data files.
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
LOCALE_DIR = "@LOCALE_DIR@"
|
||||||
|
DATA_DIR = "@DATA_DIR@"
|
||||||
|
IMAGE_DIR = "@IMAGE_DIR@"
|
||||||
|
DOC_DIR = "@DOC_DIR@"
|
||||||
|
|
||||||
|
TIP_DATA = os.path.join(DATA_DIR, "tips.xml")
|
||||||
|
PAPERSIZE = os.path.join(DATA_DIR, "papersize.xml")
|
||||||
|
|
||||||
|
ICON = os.path.join(IMAGE_DIR, "gramps.png")
|
||||||
|
LOGO = os.path.join(IMAGE_DIR, "logo.png")
|
||||||
|
SPLASH = os.path.join(IMAGE_DIR, "splash.jpg")
|
||||||
|
|
||||||
|
LICENSE_FILE = os.path.join(DOC_DIR, 'COPYING')
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Init Localization
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from .utils.grampslocale import GrampsLocale
|
||||||
|
GRAMPS_LOCALE = GrampsLocale()
|
||||||
|
_ = GRAMPS_LOCALE.get_translation().sgettext
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# About box information
|
# About box information
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
COPYRIGHT_MSG = "© 2001-2006 Donald N. Allingham\n" \
|
COPYRIGHT_MSG = "© 2001-2006 Donald N. Allingham\n" \
|
||||||
"© 2007-2012 The Gramps Developers"
|
"© 2007-2013 The Gramps Developers"
|
||||||
COMMENTS = _("Gramps (Genealogical Research and Analysis "
|
COMMENTS = _("Gramps (Genealogical Research and Analysis "
|
||||||
"Management Programming System) is a personal "
|
"Management Programming System) is a personal "
|
||||||
"genealogy program.")
|
"genealogy program.")
|
||||||
@@ -325,3 +332,29 @@ LONGOPTS = [
|
|||||||
SHORTOPTS = "O:C:i:e:f:a:p:d:c:lLhuv?s"
|
SHORTOPTS = "O:C:i:e:f:a:p:d:c:lLhuv?s"
|
||||||
|
|
||||||
GRAMPS_UUID = uuid.UUID('516cd010-5a41-470f-99f8-eb22f1098ad6')
|
GRAMPS_UUID = uuid.UUID('516cd010-5a41-470f-99f8-eb22f1098ad6')
|
||||||
|
|
||||||
|
def need_to_update_const():
|
||||||
|
""" Check to see if this file is older than
|
||||||
|
setup.py or const.py.in """
|
||||||
|
this_file = os.path.join(ROOT_DIR, "gen", "const.py")
|
||||||
|
in_file = os.path.join(ROOT_DIR, "gen", "const.py.in")
|
||||||
|
setup_file = os.path.join(ROOT_DIR, "..", "setup.py")
|
||||||
|
|
||||||
|
if (os.path.exists(this_file) and
|
||||||
|
os.path.exists(in_file) and
|
||||||
|
os.path.exists(setup_file)):
|
||||||
|
|
||||||
|
this_file_time = os.path.getmtime(this_file)
|
||||||
|
in_file_time = os.path.getmtime(in_file)
|
||||||
|
setup_file_time = os.path.getmtime(setup_file)
|
||||||
|
|
||||||
|
# Is this file older than others? If so,
|
||||||
|
# need to run setup
|
||||||
|
return (this_file_time < in_file_time or
|
||||||
|
this_file_time < setup_file_time)
|
||||||
|
else:
|
||||||
|
# Can't tell because can't find the files
|
||||||
|
return False
|
||||||
|
|
||||||
|
if need_to_update_const():
|
||||||
|
print("Outdated gramps.gen.const; please run 'python setup.py build'")
|
||||||
|
@@ -64,6 +64,13 @@ else:
|
|||||||
STRTYPE = str
|
STRTYPE = str
|
||||||
UNITYPE = str
|
UNITYPE = str
|
||||||
cuni = conv_to_unicode_direct
|
cuni = conv_to_unicode_direct
|
||||||
|
|
||||||
|
# handle in database is bytes, while internally Gramps wants unicode for py3
|
||||||
|
if sys.version_info[0] < 3:
|
||||||
|
handle2internal = lambda x: x
|
||||||
|
else:
|
||||||
|
handle2internal = lambda x: conv_to_unicode(x, 'utf-8')
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Platform determination functions
|
# Platform determination functions
|
||||||
|
@@ -176,4 +176,4 @@ class DateDisplayNb(DateDisplay):
|
|||||||
# Register classes
|
# Register classes
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
register_datehandler(('nb_NO', 'nb', 'norsk', 'Norwegian'), DateParserNb, DateDisplayNb)
|
register_datehandler(('nb_NO', 'nb', 'nn_NO', 'nn', 'norsk', 'Norwegian'), DateParserNb, DateDisplayNb)
|
||||||
|
@@ -25,6 +25,8 @@ import locale
|
|||||||
import sys
|
import sys
|
||||||
from ..constfunc import mac, win, conv_to_unicode
|
from ..constfunc import mac, win, conv_to_unicode
|
||||||
|
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Some OS environments do not support the locale.nl_langinfo() method
|
Some OS environments do not support the locale.nl_langinfo() method
|
||||||
of determing month names and other date related information.
|
of determing month names and other date related information.
|
||||||
@@ -41,7 +43,11 @@ else:
|
|||||||
#locale returns unicode in python 3
|
#locale returns unicode in python 3
|
||||||
to_uni = lambda x, y: x
|
to_uni = lambda x, y: x
|
||||||
try:
|
try:
|
||||||
codeset = locale.nl_langinfo(locale.CODESET)
|
codeset = glocale.get_translation().info()["charset"]
|
||||||
|
except KeyError:
|
||||||
|
codeset = "UTF-8"
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
month_to_int = {
|
month_to_int = {
|
||||||
to_uni(locale.nl_langinfo(locale.MON_1), codeset).lower() : 1,
|
to_uni(locale.nl_langinfo(locale.MON_1), codeset).lower() : 1,
|
||||||
@@ -137,69 +143,64 @@ try:
|
|||||||
|
|
||||||
except:
|
except:
|
||||||
import time
|
import time
|
||||||
codeset = None
|
|
||||||
if win() or mac():
|
|
||||||
codeset = locale.getlocale()[1]
|
|
||||||
if codeset is None:
|
|
||||||
codeset = locale.getpreferredencoding()
|
|
||||||
|
|
||||||
month_to_int = {
|
month_to_int = {
|
||||||
to_uni(time.strftime('%B',(0,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
|
to_uni(time.strftime('%B',(1,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
|
||||||
to_uni(time.strftime('%b',(0,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
|
to_uni(time.strftime('%b',(1,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
|
||||||
to_uni(time.strftime('%B',(0,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
|
to_uni(time.strftime('%B',(1,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
|
||||||
to_uni(time.strftime('%b',(0,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
|
to_uni(time.strftime('%b',(1,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
|
||||||
to_uni(time.strftime('%B',(0,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
|
to_uni(time.strftime('%B',(1,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
|
||||||
to_uni(time.strftime('%b',(0,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
|
to_uni(time.strftime('%b',(1,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
|
||||||
to_uni(time.strftime('%B',(0,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
|
to_uni(time.strftime('%B',(1,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
|
||||||
to_uni(time.strftime('%b',(0,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
|
to_uni(time.strftime('%b',(1,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
|
||||||
to_uni(time.strftime('%B',(0,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
|
to_uni(time.strftime('%B',(1,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
|
||||||
to_uni(time.strftime('%b',(0,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
|
to_uni(time.strftime('%b',(1,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
|
||||||
to_uni(time.strftime('%B',(0,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
|
to_uni(time.strftime('%B',(1,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
|
||||||
to_uni(time.strftime('%b',(0,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
|
to_uni(time.strftime('%b',(1,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
|
||||||
to_uni(time.strftime('%B',(0,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
|
to_uni(time.strftime('%B',(1,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
|
||||||
to_uni(time.strftime('%b',(0,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
|
to_uni(time.strftime('%b',(1,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
|
||||||
to_uni(time.strftime('%B',(0,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
|
to_uni(time.strftime('%B',(1,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
|
||||||
to_uni(time.strftime('%b',(0,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
|
to_uni(time.strftime('%b',(1,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
|
||||||
to_uni(time.strftime('%B',(0,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
|
to_uni(time.strftime('%B',(1,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
|
||||||
to_uni(time.strftime('%b',(0,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
|
to_uni(time.strftime('%b',(1,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
|
||||||
to_uni(time.strftime('%B',(0,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
|
to_uni(time.strftime('%B',(1,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
|
||||||
to_uni(time.strftime('%b',(0,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
|
to_uni(time.strftime('%b',(1,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
|
||||||
to_uni(time.strftime('%B',(0,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
|
to_uni(time.strftime('%B',(1,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
|
||||||
to_uni(time.strftime('%b',(0,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
|
to_uni(time.strftime('%b',(1,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
|
||||||
to_uni(time.strftime('%B',(0,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
|
to_uni(time.strftime('%B',(1,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
|
||||||
to_uni(time.strftime('%b',(0,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
|
to_uni(time.strftime('%b',(1,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
|
||||||
}
|
}
|
||||||
|
|
||||||
long_months = (
|
long_months = (
|
||||||
"",
|
"",
|
||||||
to_uni(time.strftime('%B',(0,1,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%B',(1,1,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%B',(0,2,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%B',(1,2,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%B',(0,3,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%B',(1,3,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%B',(0,4,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%B',(1,4,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%B',(0,5,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%B',(1,5,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%B',(0,6,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%B',(1,6,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%B',(0,7,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%B',(1,7,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%B',(0,8,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%B',(1,8,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%B',(0,9,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%B',(1,9,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%B',(0,10,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%B',(1,10,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%B',(0,11,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%B',(1,11,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%B',(0,12,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%B',(1,12,1,1,1,1,1,1,1)), codeset),
|
||||||
)
|
)
|
||||||
|
|
||||||
short_months = (
|
short_months = (
|
||||||
"",
|
"",
|
||||||
to_uni(time.strftime('%b',(0,1,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%b',(1,1,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%b',(0,2,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%b',(1,2,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%b',(0,3,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%b',(1,3,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%b',(0,4,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%b',(1,4,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%b',(0,5,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%b',(1,5,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%b',(0,6,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%b',(1,6,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%b',(0,7,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%b',(1,7,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%b',(0,8,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%b',(1,8,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%b',(0,9,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%b',(1,9,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%b',(0,10,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%b',(1,10,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%b',(0,11,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%b',(1,11,1,1,1,1,1,1,1)), codeset),
|
||||||
to_uni(time.strftime('%b',(0,12,1,1,1,1,1,1,1)), codeset),
|
to_uni(time.strftime('%b',(1,12,1,1,1,1,1,1,1)), codeset),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Gramps day number: Sunday => 1, Monday => 2, etc
|
# Gramps day number: Sunday => 1, Monday => 2, etc
|
||||||
@@ -213,24 +214,24 @@ except:
|
|||||||
# just a dummy.
|
# just a dummy.
|
||||||
long_days = (
|
long_days = (
|
||||||
"",
|
"",
|
||||||
to_uni(time.strftime('%A',(0,1,1,1,1,1,6,1,1)), codeset), # Sunday
|
to_uni(time.strftime('%A',(1,1,1,1,1,1,6,1,1)), codeset), # Sunday
|
||||||
to_uni(time.strftime('%A',(0,1,1,1,1,1,0,1,1)), codeset), # Monday
|
to_uni(time.strftime('%A',(1,1,1,1,1,1,0,1,1)), codeset), # Monday
|
||||||
to_uni(time.strftime('%A',(0,1,1,1,1,1,1,1,1)), codeset), # Tuesday
|
to_uni(time.strftime('%A',(1,1,1,1,1,1,1,1,1)), codeset), # Tuesday
|
||||||
to_uni(time.strftime('%A',(0,1,1,1,1,1,2,1,1)), codeset), # Wednesday
|
to_uni(time.strftime('%A',(1,1,1,1,1,1,2,1,1)), codeset), # Wednesday
|
||||||
to_uni(time.strftime('%A',(0,1,1,1,1,1,3,1,1)), codeset), # Thursday
|
to_uni(time.strftime('%A',(1,1,1,1,1,1,3,1,1)), codeset), # Thursday
|
||||||
to_uni(time.strftime('%A',(0,1,1,1,1,1,4,1,1)), codeset), # Friday
|
to_uni(time.strftime('%A',(1,1,1,1,1,1,4,1,1)), codeset), # Friday
|
||||||
to_uni(time.strftime('%A',(0,1,1,1,1,1,5,1,1)), codeset), # Saturday
|
to_uni(time.strftime('%A',(1,1,1,1,1,1,5,1,1)), codeset), # Saturday
|
||||||
)
|
)
|
||||||
|
|
||||||
short_days = (
|
short_days = (
|
||||||
"",
|
"",
|
||||||
to_uni(time.strftime('%a',(0,1,1,1,1,1,6,1,1)), codeset), # Sunday
|
to_uni(time.strftime('%a',(1,1,1,1,1,1,6,1,1)), codeset), # Sunday
|
||||||
to_uni(time.strftime('%a',(0,1,1,1,1,1,0,1,1)), codeset), # Monday
|
to_uni(time.strftime('%a',(1,1,1,1,1,1,0,1,1)), codeset), # Monday
|
||||||
to_uni(time.strftime('%a',(0,1,1,1,1,1,1,1,1)), codeset), # Tuesday
|
to_uni(time.strftime('%a',(1,1,1,1,1,1,1,1,1)), codeset), # Tuesday
|
||||||
to_uni(time.strftime('%a',(0,1,1,1,1,1,2,1,1)), codeset), # Wednesday
|
to_uni(time.strftime('%a',(1,1,1,1,1,1,2,1,1)), codeset), # Wednesday
|
||||||
to_uni(time.strftime('%a',(0,1,1,1,1,1,3,1,1)), codeset), # Thursday
|
to_uni(time.strftime('%a',(1,1,1,1,1,1,3,1,1)), codeset), # Thursday
|
||||||
to_uni(time.strftime('%a',(0,1,1,1,1,1,4,1,1)), codeset), # Friday
|
to_uni(time.strftime('%a',(1,1,1,1,1,1,4,1,1)), codeset), # Friday
|
||||||
to_uni(time.strftime('%a',(0,1,1,1,1,1,5,1,1)), codeset), # Saturday
|
to_uni(time.strftime('%a',(1,1,1,1,1,1,5,1,1)), codeset), # Saturday
|
||||||
)
|
)
|
||||||
|
|
||||||
# depending on the locale, the value returned for 20th Feb 2009 could be
|
# depending on the locale, the value returned for 20th Feb 2009 could be
|
||||||
|
@@ -67,8 +67,9 @@ else:
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from .exceptions import DbException
|
from .exceptions import DbException
|
||||||
from .write import FAMILY_TBL, PLACES_TBL, SOURCES_TBL, MEDIA_TBL, \
|
from .write import (FAMILY_TBL, PLACES_TBL, LOCATION_TBL, SOURCES_TBL,
|
||||||
EVENTS_TBL, PERSON_TBL, REPO_TBL, NOTE_TBL, TAG_TBL, META, CITATIONS_TBL
|
MEDIA_TBL, EVENTS_TBL, PERSON_TBL, REPO_TBL, NOTE_TBL,
|
||||||
|
TAG_TBL, META, CITATIONS_TBL)
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@@ -215,5 +216,6 @@ def __build_tbl_map(database):
|
|||||||
( MEDIA_TBL, database.media_map.db),
|
( MEDIA_TBL, database.media_map.db),
|
||||||
( EVENTS_TBL, database.event_map.db),
|
( EVENTS_TBL, database.event_map.db),
|
||||||
( TAG_TBL, database.tag_map.db),
|
( TAG_TBL, database.tag_map.db),
|
||||||
|
( LOCATION_TBL, database.location_map.db),
|
||||||
( META, database.metadata.db),
|
( META, database.metadata.db),
|
||||||
]
|
]
|
||||||
|
@@ -32,7 +32,8 @@ from this class.
|
|||||||
# Python libraries
|
# Python libraries
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from ..ggettext import gettext as _
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@@ -321,6 +322,27 @@ class DbReadBase(object):
|
|||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def get_location_cursor(self):
|
||||||
|
"""
|
||||||
|
Return a reference to a cursor over Location objects
|
||||||
|
"""
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def get_location_from_handle(self, handle):
|
||||||
|
"""
|
||||||
|
Find a Location in the database from the passed handle.
|
||||||
|
|
||||||
|
If no such Location exists, None is returned.
|
||||||
|
"""
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def get_location_handles(self):
|
||||||
|
"""
|
||||||
|
Return a list of database handles, one handle for each Location in
|
||||||
|
the database.
|
||||||
|
"""
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def get_media_attribute_types(self):
|
def get_media_attribute_types(self):
|
||||||
"""
|
"""
|
||||||
Return a list of all Attribute types associated with Media and MediaRef
|
Return a list of all Attribute types associated with Media and MediaRef
|
||||||
@@ -436,6 +458,12 @@ class DbReadBase(object):
|
|||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def get_number_of_locations(self):
|
||||||
|
"""
|
||||||
|
Return the number of locations currently in the database.
|
||||||
|
"""
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def get_number_of_media_objects(self):
|
def get_number_of_media_objects(self):
|
||||||
"""
|
"""
|
||||||
Return the number of media objects currently in the database.
|
Return the number of media objects currently in the database.
|
||||||
@@ -591,6 +619,12 @@ class DbReadBase(object):
|
|||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def get_raw_location_data(self, handle):
|
||||||
|
"""
|
||||||
|
Return raw (serialized and pickled) Location object from handle
|
||||||
|
"""
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def get_raw_note_data(self, handle):
|
def get_raw_note_data(self, handle):
|
||||||
"""
|
"""
|
||||||
Return raw (serialized and pickled) Note object from handle
|
Return raw (serialized and pickled) Note object from handle
|
||||||
@@ -867,6 +901,12 @@ class DbReadBase(object):
|
|||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def has_location_handle(self, handle):
|
||||||
|
"""
|
||||||
|
Return True if the handle exists in the current Location database.
|
||||||
|
"""
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def has_name_group_key(self, name):
|
def has_name_group_key(self, name):
|
||||||
"""
|
"""
|
||||||
Return if a key exists in the name_group table.
|
Return if a key exists in the name_group table.
|
||||||
@@ -945,6 +985,18 @@ class DbReadBase(object):
|
|||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def iter_location_handles(self):
|
||||||
|
"""
|
||||||
|
Return an iterator over handles for Locations in the database
|
||||||
|
"""
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def iter_locations(self):
|
||||||
|
"""
|
||||||
|
Return an iterator over objects for Locations in the database
|
||||||
|
"""
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def iter_media_object_handles(self):
|
def iter_media_object_handles(self):
|
||||||
"""
|
"""
|
||||||
Return an iterator over handles for Media in the database
|
Return an iterator over handles for Media in the database
|
||||||
@@ -1235,6 +1287,13 @@ class DbWriteBase(DbReadBase):
|
|||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def add_location(self, location, transaction):
|
||||||
|
"""
|
||||||
|
Add a Location to the database, assigning a handle if it has not already
|
||||||
|
been defined.
|
||||||
|
"""
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def add_note(self, obj, transaction, set_gid=True):
|
def add_note(self, obj, transaction, set_gid=True):
|
||||||
"""
|
"""
|
||||||
Add a Note to the database, assigning internal IDs if they have
|
Add a Note to the database, assigning internal IDs if they have
|
||||||
@@ -1343,6 +1402,13 @@ class DbWriteBase(DbReadBase):
|
|||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def commit_location(self, location, transaction, change_time=None):
|
||||||
|
"""
|
||||||
|
Commit the specified Location to the database, storing the changes as
|
||||||
|
part of the transaction.
|
||||||
|
"""
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def commit_media_object(self, obj, transaction, change_time=None):
|
def commit_media_object(self, obj, transaction, change_time=None):
|
||||||
"""
|
"""
|
||||||
Commit the specified MediaObject to the database, storing the changes
|
Commit the specified MediaObject to the database, storing the changes
|
||||||
@@ -1460,6 +1526,15 @@ class DbWriteBase(DbReadBase):
|
|||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def remove_location(self, handle, transaction):
|
||||||
|
"""
|
||||||
|
Remove the Location specified by the database handle from the
|
||||||
|
database, preserving the change in the passed transaction.
|
||||||
|
|
||||||
|
This method must be overridden in the derived class.
|
||||||
|
"""
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def remove_note(self, handle, transaction):
|
def remove_note(self, handle, transaction):
|
||||||
"""
|
"""
|
||||||
Remove the Note specified by the database handle from the
|
Remove the Note specified by the database handle from the
|
||||||
|
@@ -45,8 +45,8 @@ __all__ = (
|
|||||||
) +
|
) +
|
||||||
|
|
||||||
('PERSON_KEY', 'FAMILY_KEY', 'SOURCE_KEY', 'CITATION_KEY',
|
('PERSON_KEY', 'FAMILY_KEY', 'SOURCE_KEY', 'CITATION_KEY',
|
||||||
'EVENT_KEY', 'MEDIA_KEY', 'PLACE_KEY', 'REPOSITORY_KEY',
|
'EVENT_KEY', 'MEDIA_KEY', 'PLACE_KEY', 'LOCATION_KEY',
|
||||||
'NOTE_KEY', 'REFERENCE_KEY', 'TAG_KEY'
|
'REPOSITORY_KEY', 'NOTE_KEY', 'REFERENCE_KEY', 'TAG_KEY'
|
||||||
) +
|
) +
|
||||||
|
|
||||||
('TXNADD', 'TXNUPD', 'TXNDEL')
|
('TXNADD', 'TXNUPD', 'TXNDEL')
|
||||||
@@ -87,5 +87,6 @@ REFERENCE_KEY = 7
|
|||||||
NOTE_KEY = 8
|
NOTE_KEY = 8
|
||||||
TAG_KEY = 9
|
TAG_KEY = 9
|
||||||
CITATION_KEY = 10
|
CITATION_KEY = 10
|
||||||
|
LOCATION_KEY = 11
|
||||||
|
|
||||||
TXNADD, TXNUPD, TXNDEL = 0, 1, 2
|
TXNADD, TXNUPD, TXNDEL = 0, 1, 2
|
||||||
|
@@ -195,6 +195,7 @@ class DictionaryDb(DbWriteBase, DbReadBase):
|
|||||||
}
|
}
|
||||||
# skip GEDCOM cross-ref check for now:
|
# skip GEDCOM cross-ref check for now:
|
||||||
self.set_feature("skip-check-xref", True)
|
self.set_feature("skip-check-xref", True)
|
||||||
|
self.set_feature("skip-import-additions", True)
|
||||||
self.readonly = False
|
self.readonly = False
|
||||||
self.db_is_open = True
|
self.db_is_open = True
|
||||||
self.name_formats = []
|
self.name_formats = []
|
||||||
@@ -255,6 +256,20 @@ class DictionaryDb(DbWriteBase, DbReadBase):
|
|||||||
self.txn = DictionaryTxn("DbDictionary Transaction", self)
|
self.txn = DictionaryTxn("DbDictionary Transaction", self)
|
||||||
self.transaction = None
|
self.transaction = None
|
||||||
|
|
||||||
|
def version_supported(self):
|
||||||
|
"""Return True when the file has a supported version."""
|
||||||
|
return True
|
||||||
|
|
||||||
|
def get_table_names(self):
|
||||||
|
"""Return a list of valid table names."""
|
||||||
|
return list(self._tables.keys())
|
||||||
|
|
||||||
|
def get_table_metadata(self, table_name):
|
||||||
|
"""Return the metadata for a valid table name."""
|
||||||
|
if table_name in self._tables:
|
||||||
|
return self._tables[table_name]
|
||||||
|
return None
|
||||||
|
|
||||||
def transaction_commit(self, txn):
|
def transaction_commit(self, txn):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@@ -27,7 +27,8 @@
|
|||||||
# Standard python modules
|
# Standard python modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from ..ggettext import gettext as _
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
|
|
||||||
|
|
||||||
class DbException(Exception):
|
class DbException(Exception):
|
||||||
|
@@ -40,7 +40,6 @@ else:
|
|||||||
import pickle
|
import pickle
|
||||||
import time
|
import time
|
||||||
import random
|
import random
|
||||||
import locale
|
|
||||||
import os
|
import os
|
||||||
from sys import maxsize
|
from sys import maxsize
|
||||||
|
|
||||||
@@ -49,7 +48,8 @@ if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
|
|||||||
from bsddb3 import db
|
from bsddb3 import db
|
||||||
else:
|
else:
|
||||||
from bsddb import db
|
from bsddb import db
|
||||||
from ..ggettext import gettext as _
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
@@ -66,6 +66,7 @@ from ..lib.src import Source
|
|||||||
from ..lib.citation import Citation
|
from ..lib.citation import Citation
|
||||||
from ..lib.event import Event
|
from ..lib.event import Event
|
||||||
from ..lib.place import Place
|
from ..lib.place import Place
|
||||||
|
from ..lib.location import Location
|
||||||
from ..lib.repo import Repository
|
from ..lib.repo import Repository
|
||||||
from ..lib.note import Note
|
from ..lib.note import Note
|
||||||
from ..lib.tag import Tag
|
from ..lib.tag import Tag
|
||||||
@@ -80,6 +81,7 @@ from . import (BsddbBaseCursor, DbReadBase)
|
|||||||
from ..utils.id import create_id
|
from ..utils.id import create_id
|
||||||
from ..errors import DbError
|
from ..errors import DbError
|
||||||
from ..constfunc import UNITYPE, STRTYPE, cuni
|
from ..constfunc import UNITYPE, STRTYPE, cuni
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
|
||||||
LOG = logging.getLogger(DBLOGNAME)
|
LOG = logging.getLogger(DBLOGNAME)
|
||||||
LOG = logging.getLogger(".citation")
|
LOG = logging.getLogger(".citation")
|
||||||
@@ -91,7 +93,7 @@ LOG = logging.getLogger(".citation")
|
|||||||
from .dbconst import *
|
from .dbconst import *
|
||||||
|
|
||||||
_SIGBASE = ('person', 'family', 'source', 'citation',
|
_SIGBASE = ('person', 'family', 'source', 'citation',
|
||||||
'event', 'media', 'place', 'repository',
|
'event', 'media', 'place', 'location', 'repository',
|
||||||
'reference', 'note', 'tag')
|
'reference', 'note', 'tag')
|
||||||
|
|
||||||
DBERRS = (db.DBRunRecoveryError, db.DBAccessError,
|
DBERRS = (db.DBRunRecoveryError, db.DBAccessError,
|
||||||
@@ -102,6 +104,17 @@ DBERRS = (db.DBRunRecoveryError, db.DBAccessError,
|
|||||||
# Helper functions
|
# Helper functions
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
def find_byte_surname(key, data):
|
||||||
|
"""
|
||||||
|
Creating a surname from raw data of a person, to use for sort and index
|
||||||
|
returns a byte string
|
||||||
|
"""
|
||||||
|
surn = __index_surname(data[3][5])
|
||||||
|
# in python 3 we work with unicode internally, but need byte function sometimes
|
||||||
|
if isinstance(surn, UNITYPE):
|
||||||
|
return surn.encode('utf-8')
|
||||||
|
return surn
|
||||||
|
|
||||||
def find_surname(key, data):
|
def find_surname(key, data):
|
||||||
"""
|
"""
|
||||||
Creating a surname from raw data of a person, to use for sort and index
|
Creating a surname from raw data of a person, to use for sort and index
|
||||||
@@ -127,7 +140,10 @@ def __index_surname(surn_list):
|
|||||||
NameOriginType.PATRONYMIC, NameOriginType.MATRONYMIC]) ])
|
NameOriginType.PATRONYMIC, NameOriginType.MATRONYMIC]) ])
|
||||||
else:
|
else:
|
||||||
surn = ""
|
surn = ""
|
||||||
return surn.encode('utf-8')
|
if sys.version_info[0] < 3:
|
||||||
|
return surn.encode('utf-8')
|
||||||
|
else:
|
||||||
|
return surn
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@@ -175,6 +191,32 @@ class DbReadCursor(BsddbBaseCursor):
|
|||||||
self.cursor = source.db.cursor(txn)
|
self.cursor = source.db.cursor(txn)
|
||||||
self.source = source
|
self.source = source
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# DbBsddbTreeCursor
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
class DbBsddbTreeCursor(BsddbBaseCursor):
|
||||||
|
|
||||||
|
def __init__(self, source, txn=None, **kwargs):
|
||||||
|
BsddbBaseCursor.__init__(self, txn=txn, **kwargs)
|
||||||
|
self.cursor = source.cursor(txn)
|
||||||
|
self.source = source
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
"""
|
||||||
|
Iterator
|
||||||
|
"""
|
||||||
|
to_do = [None]
|
||||||
|
while to_do:
|
||||||
|
data = self.set(str(to_do.pop()))
|
||||||
|
_n = self.next_dup
|
||||||
|
while data:
|
||||||
|
payload = pickle.loads(data[1])
|
||||||
|
yield (payload[0], payload)
|
||||||
|
to_do.append(payload[0])
|
||||||
|
data = _n()
|
||||||
|
|
||||||
class DbBsddbRead(DbReadBase, Callback):
|
class DbBsddbRead(DbReadBase, Callback):
|
||||||
"""
|
"""
|
||||||
Read class for the GRAMPS databases. Implements methods necessary to read
|
Read class for the GRAMPS databases. Implements methods necessary to read
|
||||||
@@ -324,6 +366,13 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
"cursor_func": self.get_tag_cursor,
|
"cursor_func": self.get_tag_cursor,
|
||||||
"handles_func": self.get_tag_handles,
|
"handles_func": self.get_tag_handles,
|
||||||
},
|
},
|
||||||
|
'Location':
|
||||||
|
{
|
||||||
|
"handle_func": self.get_location_from_handle,
|
||||||
|
"gramps_id_func": None,
|
||||||
|
"class_func": Location,
|
||||||
|
"cursor_func": self.get_location_cursor,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
self.set_person_id_prefix('I%04d')
|
self.set_person_id_prefix('I%04d')
|
||||||
@@ -378,6 +427,7 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
self.nid_trans = {}
|
self.nid_trans = {}
|
||||||
self.eid_trans = {}
|
self.eid_trans = {}
|
||||||
self.tag_trans = {}
|
self.tag_trans = {}
|
||||||
|
self.loc_trans = {}
|
||||||
self.env = None
|
self.env = None
|
||||||
self.person_map = {}
|
self.person_map = {}
|
||||||
self.family_map = {}
|
self.family_map = {}
|
||||||
@@ -481,6 +531,9 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
def get_tag_cursor(self, *args, **kwargs):
|
def get_tag_cursor(self, *args, **kwargs):
|
||||||
return self.get_cursor(self.tag_map, *args, **kwargs)
|
return self.get_cursor(self.tag_map, *args, **kwargs)
|
||||||
|
|
||||||
|
def get_location_cursor(self, *args, **kwargs):
|
||||||
|
return DbBsddbTreeCursor(self.parents, self.txn)
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
"""
|
"""
|
||||||
Close the specified database.
|
Close the specified database.
|
||||||
@@ -529,6 +582,7 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
self.emit('repository-rebuild')
|
self.emit('repository-rebuild')
|
||||||
self.emit('note-rebuild')
|
self.emit('note-rebuild')
|
||||||
self.emit('tag-rebuild')
|
self.emit('tag-rebuild')
|
||||||
|
self.emit('location-rebuild')
|
||||||
|
|
||||||
def __find_next_gramps_id(self, prefix, map_index, trans):
|
def __find_next_gramps_id(self, prefix, map_index, trans):
|
||||||
"""
|
"""
|
||||||
@@ -744,7 +798,17 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
"""
|
"""
|
||||||
return self.get_from_handle(handle, Tag, self.tag_map)
|
return self.get_from_handle(handle, Tag, self.tag_map)
|
||||||
|
|
||||||
|
def get_location_from_handle(self, handle):
|
||||||
|
"""
|
||||||
|
Find a Location in the database from the passed handle.
|
||||||
|
|
||||||
|
If no such Location exists, None is returned.
|
||||||
|
"""
|
||||||
|
return self.get_from_handle(handle, Location, self.location_map)
|
||||||
|
|
||||||
def __get_obj_from_gramps_id(self, val, tbl, class_, prim_tbl):
|
def __get_obj_from_gramps_id(self, val, tbl, class_, prim_tbl):
|
||||||
|
if isinstance(tbl, dict):
|
||||||
|
return None ## trying to get object too early
|
||||||
if isinstance(val, UNITYPE):
|
if isinstance(val, UNITYPE):
|
||||||
val = val.encode('utf-8')
|
val = val.encode('utf-8')
|
||||||
try:
|
try:
|
||||||
@@ -950,6 +1014,12 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
"""
|
"""
|
||||||
return self.get_number_of_records(self.tag_map)
|
return self.get_number_of_records(self.tag_map)
|
||||||
|
|
||||||
|
def get_number_of_locations(self):
|
||||||
|
"""
|
||||||
|
Return the number of locations currently in the database.
|
||||||
|
"""
|
||||||
|
return self.get_number_of_records(self.location_map)
|
||||||
|
|
||||||
def all_handles(self, table):
|
def all_handles(self, table):
|
||||||
return table.keys(txn=self.txn)
|
return table.keys(txn=self.txn)
|
||||||
|
|
||||||
@@ -1074,6 +1144,15 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
return handle_list
|
return handle_list
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
def get_location_handles(self):
|
||||||
|
"""
|
||||||
|
Return a list of database handles, one handle for each Location in the
|
||||||
|
database.
|
||||||
|
"""
|
||||||
|
if self.db_is_open:
|
||||||
|
return self.all_handles(self.location_map)
|
||||||
|
return []
|
||||||
|
|
||||||
def _f(curs_):
|
def _f(curs_):
|
||||||
"""
|
"""
|
||||||
Closure that returns an iterator over handles in the database.
|
Closure that returns an iterator over handles in the database.
|
||||||
@@ -1096,6 +1175,7 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
iter_repository_handles = _f(get_repository_cursor)
|
iter_repository_handles = _f(get_repository_cursor)
|
||||||
iter_note_handles = _f(get_note_cursor)
|
iter_note_handles = _f(get_note_cursor)
|
||||||
iter_tag_handles = _f(get_tag_cursor)
|
iter_tag_handles = _f(get_tag_cursor)
|
||||||
|
iter_location_handles = _f(get_location_cursor)
|
||||||
del _f
|
del _f
|
||||||
|
|
||||||
def _f(curs_, obj_):
|
def _f(curs_, obj_):
|
||||||
@@ -1122,6 +1202,7 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
iter_repositories = _f(get_repository_cursor, Repository)
|
iter_repositories = _f(get_repository_cursor, Repository)
|
||||||
iter_notes = _f(get_note_cursor, Note)
|
iter_notes = _f(get_note_cursor, Note)
|
||||||
iter_tags = _f(get_tag_cursor, Tag)
|
iter_tags = _f(get_tag_cursor, Tag)
|
||||||
|
iter_locations = _f(get_location_cursor, Location)
|
||||||
del _f
|
del _f
|
||||||
|
|
||||||
def get_gramps_ids(self, obj_key):
|
def get_gramps_ids(self, obj_key):
|
||||||
@@ -1513,6 +1594,8 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
"""
|
"""
|
||||||
Helper method for get_raw_<object>_data methods
|
Helper method for get_raw_<object>_data methods
|
||||||
"""
|
"""
|
||||||
|
if table is None:
|
||||||
|
return None ## trying to get object too early
|
||||||
if isinstance(handle, UNITYPE):
|
if isinstance(handle, UNITYPE):
|
||||||
handle = handle.encode('utf-8')
|
handle = handle.encode('utf-8')
|
||||||
try:
|
try:
|
||||||
@@ -1551,6 +1634,9 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
def get_raw_tag_data(self, handle):
|
def get_raw_tag_data(self, handle):
|
||||||
return self.__get_raw_data(self.tag_map, handle)
|
return self.__get_raw_data(self.tag_map, handle)
|
||||||
|
|
||||||
|
def get_raw_location_data(self, handle):
|
||||||
|
return self.__get_raw_data(self.location_map, handle)
|
||||||
|
|
||||||
def __has_handle(self, table, handle):
|
def __has_handle(self, table, handle):
|
||||||
"""
|
"""
|
||||||
Helper function for has_<object>_handle methods
|
Helper function for has_<object>_handle methods
|
||||||
@@ -1623,10 +1709,16 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
"""
|
"""
|
||||||
return self.__has_handle(self.tag_map, handle)
|
return self.__has_handle(self.tag_map, handle)
|
||||||
|
|
||||||
|
def has_location_handle(self, handle):
|
||||||
|
"""
|
||||||
|
Return True if the handle exists in the current Location database.
|
||||||
|
"""
|
||||||
|
return self.__has_handle(self.location_map, handle)
|
||||||
|
|
||||||
def __sortbyperson_key(self, handle):
|
def __sortbyperson_key(self, handle):
|
||||||
if isinstance(handle, UNITYPE):
|
if isinstance(handle, UNITYPE):
|
||||||
handle = handle.encode('utf-8')
|
handle = handle.encode('utf-8')
|
||||||
return locale.strxfrm(find_surname(handle,
|
return glocale.sort_key(find_surname(handle,
|
||||||
self.person_map.get(handle)))
|
self.person_map.get(handle)))
|
||||||
|
|
||||||
def __sortbyplace(self, first, second):
|
def __sortbyplace(self, first, second):
|
||||||
@@ -1634,13 +1726,13 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
first = first.encode('utf-8')
|
first = first.encode('utf-8')
|
||||||
if isinstance(second, UNITYPE):
|
if isinstance(second, UNITYPE):
|
||||||
second = second.encode('utf-8')
|
second = second.encode('utf-8')
|
||||||
return locale.strcoll(self.place_map.get(first)[2],
|
return glocale.strcoll(self.place_map.get(first)[2],
|
||||||
self.place_map.get(second)[2])
|
self.place_map.get(second)[2])
|
||||||
|
|
||||||
def __sortbyplace_key(self, place):
|
def __sortbyplace_key(self, place):
|
||||||
if isinstance(place, UNITYPE):
|
if isinstance(place, UNITYPE):
|
||||||
place = place.encode('utf-8')
|
place = place.encode('utf-8')
|
||||||
return locale.strxfrm(self.place_map.get(place)[2])
|
return glocale.sort_key(self.place_map.get(place)[2])
|
||||||
|
|
||||||
def __sortbysource(self, first, second):
|
def __sortbysource(self, first, second):
|
||||||
if isinstance(first, UNITYPE):
|
if isinstance(first, UNITYPE):
|
||||||
@@ -1649,13 +1741,13 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
second = second.encode('utf-8')
|
second = second.encode('utf-8')
|
||||||
source1 = cuni(self.source_map[first][2])
|
source1 = cuni(self.source_map[first][2])
|
||||||
source2 = cuni(self.source_map[second][2])
|
source2 = cuni(self.source_map[second][2])
|
||||||
return locale.strcoll(source1, source2)
|
return glocale.strcoll(source1, source2)
|
||||||
|
|
||||||
def __sortbysource_key(self, key):
|
def __sortbysource_key(self, key):
|
||||||
if isinstance(key, UNITYPE):
|
if isinstance(key, UNITYPE):
|
||||||
key = key.encode('utf-8')
|
key = key.encode('utf-8')
|
||||||
source = cuni(self.source_map[key][2])
|
source = cuni(self.source_map[key][2])
|
||||||
return locale.strxfrm(source)
|
return glocale.sort_key(source)
|
||||||
|
|
||||||
def __sortbycitation(self, first, second):
|
def __sortbycitation(self, first, second):
|
||||||
if isinstance(first, UNITYPE):
|
if isinstance(first, UNITYPE):
|
||||||
@@ -1664,13 +1756,13 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
second = second.encode('utf-8')
|
second = second.encode('utf-8')
|
||||||
citation1 = cuni(self.citation_map[first][3])
|
citation1 = cuni(self.citation_map[first][3])
|
||||||
citation2 = cuni(self.citation_map[second][3])
|
citation2 = cuni(self.citation_map[second][3])
|
||||||
return locale.strcoll(citation1, citation2)
|
return glocale.strcoll(citation1, citation2)
|
||||||
|
|
||||||
def __sortbycitation_key(self, key):
|
def __sortbycitation_key(self, key):
|
||||||
if isinstance(key, UNITYPE):
|
if isinstance(key, UNITYPE):
|
||||||
key = key.encode('utf-8')
|
key = key.encode('utf-8')
|
||||||
citation = cuni(self.citation_map[key][3])
|
citation = cuni(self.citation_map[key][3])
|
||||||
return locale.strxfrm(citation)
|
return glocale.sort_key(citation)
|
||||||
|
|
||||||
def __sortbymedia(self, first, second):
|
def __sortbymedia(self, first, second):
|
||||||
if isinstance(first, UNITYPE):
|
if isinstance(first, UNITYPE):
|
||||||
@@ -1679,13 +1771,13 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
second = second.encode('utf-8')
|
second = second.encode('utf-8')
|
||||||
media1 = self.media_map[first][4]
|
media1 = self.media_map[first][4]
|
||||||
media2 = self.media_map[second][4]
|
media2 = self.media_map[second][4]
|
||||||
return locale.strcoll(media1, media2)
|
return glocale.strcoll(media1, media2)
|
||||||
|
|
||||||
def __sortbymedia_key(self, key):
|
def __sortbymedia_key(self, key):
|
||||||
if isinstance(key, UNITYPE):
|
if isinstance(key, UNITYPE):
|
||||||
key = key.encode('utf-8')
|
key = key.encode('utf-8')
|
||||||
media = self.media_map[key][4]
|
media = self.media_map[key][4]
|
||||||
return locale.strxfrm(media)
|
return glocale.sort_key(media)
|
||||||
|
|
||||||
def __sortbytag(self, first, second):
|
def __sortbytag(self, first, second):
|
||||||
if isinstance(first, UNITYPE):
|
if isinstance(first, UNITYPE):
|
||||||
@@ -1694,13 +1786,13 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
second = second.encode('utf-8')
|
second = second.encode('utf-8')
|
||||||
tag1 = self.tag_map[first][1]
|
tag1 = self.tag_map[first][1]
|
||||||
tag2 = self.tag_map[second][1]
|
tag2 = self.tag_map[second][1]
|
||||||
return locale.strcoll(tag1, tag2)
|
return glocale.strcoll(tag1, tag2)
|
||||||
|
|
||||||
def __sortbytag_key(self, key):
|
def __sortbytag_key(self, key):
|
||||||
if isinstance(key, UNITYPE):
|
if isinstance(key, UNITYPE):
|
||||||
key = key.encode('utf-8')
|
key = key.encode('utf-8')
|
||||||
tag = self.tag_map[key][1]
|
tag = self.tag_map[key][1]
|
||||||
return locale.strxfrm(tag)
|
return glocale.sort_key(tag)
|
||||||
|
|
||||||
def set_mediapath(self, path):
|
def set_mediapath(self, path):
|
||||||
"""Set the default media path for database, path should be utf-8."""
|
"""Set the default media path for database, path should be utf-8."""
|
||||||
@@ -1779,6 +1871,10 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
'cursor_func': self.get_tag_cursor,
|
'cursor_func': self.get_tag_cursor,
|
||||||
'class_func': Tag,
|
'class_func': Tag,
|
||||||
},
|
},
|
||||||
|
'Location': {
|
||||||
|
'cursor_func': self.get_location_cursor,
|
||||||
|
'class_func': Location,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
# Find which tables to iterate over
|
# Find which tables to iterate over
|
||||||
|
@@ -46,13 +46,15 @@ if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
|
|||||||
from bsddb3 import db
|
from bsddb3 import db
|
||||||
else:
|
else:
|
||||||
from bsddb import db
|
from bsddb import db
|
||||||
from ..ggettext import gettext as _
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
from ..constfunc import conv_to_unicode, handle2internal
|
||||||
from .dbconst import *
|
from .dbconst import *
|
||||||
from . import BSDDBTxn
|
from . import BSDDBTxn
|
||||||
from ..errors import DbError
|
from ..errors import DbError
|
||||||
@@ -65,8 +67,9 @@ from ..errors import DbError
|
|||||||
DBERRS = (db.DBRunRecoveryError, db.DBAccessError,
|
DBERRS = (db.DBRunRecoveryError, db.DBAccessError,
|
||||||
db.DBPageNotFoundError, db.DBInvalidArgError)
|
db.DBPageNotFoundError, db.DBInvalidArgError)
|
||||||
|
|
||||||
_SIGBASE = ('person', 'family', 'source', 'event', 'media',
|
_SIGBASE = ('person', 'family', 'source', 'event', 'media', 'place',
|
||||||
'place', 'repository', 'reference', 'note', 'tag', 'citation')
|
'location', 'repository', 'reference', 'note', 'tag', 'citation')
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# DbUndo class
|
# DbUndo class
|
||||||
@@ -104,6 +107,7 @@ class DbUndo(object):
|
|||||||
self.db.note_map,
|
self.db.note_map,
|
||||||
self.db.tag_map,
|
self.db.tag_map,
|
||||||
self.db.citation_map,
|
self.db.citation_map,
|
||||||
|
self.db.location_map,
|
||||||
)
|
)
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
@@ -315,7 +319,7 @@ class DbUndo(object):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
if data is None:
|
if data is None:
|
||||||
emit(signal_root + '-delete', ([handle],))
|
emit(signal_root + '-delete', ([handle2internal(handle)],))
|
||||||
db_map.delete(handle, txn=self.txn)
|
db_map.delete(handle, txn=self.txn)
|
||||||
else:
|
else:
|
||||||
ex_data = db_map.get(handle, txn=self.txn)
|
ex_data = db_map.get(handle, txn=self.txn)
|
||||||
@@ -324,7 +328,7 @@ class DbUndo(object):
|
|||||||
else:
|
else:
|
||||||
signal = signal_root + '-add'
|
signal = signal_root + '-add'
|
||||||
db_map.put(handle, data, txn=self.txn)
|
db_map.put(handle, data, txn=self.txn)
|
||||||
emit(signal, ([handle],))
|
emit(signal, ([handle2internal(handle)],))
|
||||||
|
|
||||||
except DBERRS as msg:
|
except DBERRS as msg:
|
||||||
self.db._log_error()
|
self.db._log_error()
|
||||||
@@ -479,6 +483,7 @@ def testundo():
|
|||||||
self.place_map = {}
|
self.place_map = {}
|
||||||
self.note_map = {}
|
self.note_map = {}
|
||||||
self.tag_map = {}
|
self.tag_map = {}
|
||||||
|
self.location_map = {}
|
||||||
self.repository_map = {}
|
self.repository_map = {}
|
||||||
self.reference_map = {}
|
self.reference_map = {}
|
||||||
|
|
||||||
|
@@ -30,7 +30,8 @@ import time
|
|||||||
import logging
|
import logging
|
||||||
LOG = logging.getLogger(".citation")
|
LOG = logging.getLogger(".citation")
|
||||||
|
|
||||||
from ..ggettext import gettext as _
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
from ..constfunc import cuni
|
from ..constfunc import cuni
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -42,12 +43,166 @@ if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
|
|||||||
else:
|
else:
|
||||||
from bsddb import db
|
from bsddb import db
|
||||||
from . import BSDDBTxn
|
from . import BSDDBTxn
|
||||||
|
from ..constfunc import UNITYPE
|
||||||
from ..lib.nameorigintype import NameOriginType
|
from ..lib.nameorigintype import NameOriginType
|
||||||
from .write import _mkname, SURNAMES
|
from .write import _mkname, SURNAMES
|
||||||
from .dbconst import (PERSON_KEY, FAMILY_KEY, EVENT_KEY,
|
from .dbconst import (PERSON_KEY, FAMILY_KEY, EVENT_KEY, MEDIA_KEY, PLACE_KEY,
|
||||||
MEDIA_KEY, PLACE_KEY, REPOSITORY_KEY)
|
LOCATION_KEY, REPOSITORY_KEY)
|
||||||
from gramps.gui.dialog import (InfoDialog)
|
from gramps.gui.dialog import (InfoDialog)
|
||||||
|
|
||||||
|
def gramps_upgrade_18(self):
|
||||||
|
self.set_total(len(self.place_map))
|
||||||
|
self.children = {None: []}
|
||||||
|
for handle in self.place_map.keys():
|
||||||
|
place = self.place_map[handle]
|
||||||
|
new_place = list(place)
|
||||||
|
lat_long = (new_place[4], new_place[3])
|
||||||
|
if new_place[5] is not None:
|
||||||
|
new_place[5] = process_location(self, new_place[5], lat_long)
|
||||||
|
else:
|
||||||
|
new_place[5] = process_location(self, None, lat_long)
|
||||||
|
add_reference(self, handle, new_place[5])
|
||||||
|
alt_locs = []
|
||||||
|
for alt_loc in new_place[6]:
|
||||||
|
ref_handle = process_location(self, alt_loc, lat_long)
|
||||||
|
add_reference(self, handle, ref_handle)
|
||||||
|
alt_locs.append(ref_handle)
|
||||||
|
new_place[6] = alt_locs
|
||||||
|
new_place = tuple(new_place[:3] + new_place[5:])
|
||||||
|
with BSDDBTxn(self.env, self.place_map) as txn:
|
||||||
|
txn.put(str(handle), new_place)
|
||||||
|
self.update()
|
||||||
|
|
||||||
|
with BSDDBTxn(self.env, self.metadata) as txn:
|
||||||
|
txn.put(b'version', 18)
|
||||||
|
|
||||||
|
def add_reference(self, pri_handle, ref_handle):
|
||||||
|
key = (PLACE_KEY, pri_handle)
|
||||||
|
data = ((PLACE_KEY, pri_handle), (LOCATION_KEY, ref_handle))
|
||||||
|
with BSDDBTxn(self.env, self.reference_map) as txn:
|
||||||
|
txn.put(str(key), data)
|
||||||
|
|
||||||
|
def process_location(self, loc, lat_long):
|
||||||
|
if loc is None:
|
||||||
|
location = ['Unknown']
|
||||||
|
else:
|
||||||
|
# (street, locality, parish, city, county, state, country)
|
||||||
|
# We need to think about where to put ZIP code and Phone number
|
||||||
|
location = loc[0][:2] + (loc[1],) + loc[0][2:6]
|
||||||
|
location = list(location)
|
||||||
|
location.reverse()
|
||||||
|
items = [x for x in enumerate(location) if x[1]]
|
||||||
|
parent = None
|
||||||
|
for item in items:
|
||||||
|
parent = match_location(self, parent, item, lat_long)
|
||||||
|
return parent
|
||||||
|
|
||||||
|
def match_location(self, parent, item, lat_long):
|
||||||
|
for handle in self.children[parent]:
|
||||||
|
if self.location_map[handle][2] == item[1]:
|
||||||
|
return handle
|
||||||
|
handle = self.create_id()
|
||||||
|
self.children[handle] = []
|
||||||
|
self.children[parent].append(handle)
|
||||||
|
new_location = (handle,
|
||||||
|
str(parent),
|
||||||
|
item[1], # Name
|
||||||
|
item[0]+1, # Type
|
||||||
|
lat_long[0],
|
||||||
|
lat_long[1],
|
||||||
|
int(time.time()))
|
||||||
|
with BSDDBTxn(self.env, self.location_map) as txn:
|
||||||
|
txn.put(str(handle), new_location)
|
||||||
|
return handle
|
||||||
|
|
||||||
|
def gramps_upgrade_17(self):
|
||||||
|
"""Upgrade database from version 16 to 17. This upgrade adds tags to
|
||||||
|
event, place, repository, source and citation objects.
|
||||||
|
"""
|
||||||
|
length = (len(self.event_map) + len(self.place_map) +
|
||||||
|
len(self.repository_map) + len(self.source_map) +
|
||||||
|
len(self.citation_map))
|
||||||
|
self.set_total(length)
|
||||||
|
|
||||||
|
# ---------------------------------
|
||||||
|
# Modify Event
|
||||||
|
# ---------------------------------
|
||||||
|
# Add new tag_list field.
|
||||||
|
for handle in self.event_map.keys():
|
||||||
|
event = self.event_map[handle]
|
||||||
|
new_event = list(event)
|
||||||
|
new_event = new_event[:11] + [[]] + new_event[11:]
|
||||||
|
new_event = tuple(new_event)
|
||||||
|
with BSDDBTxn(self.env, self.event_map) as txn:
|
||||||
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_event)
|
||||||
|
self.update()
|
||||||
|
|
||||||
|
# ---------------------------------
|
||||||
|
# Modify Place
|
||||||
|
# ---------------------------------
|
||||||
|
# Add new tag_list field.
|
||||||
|
for handle in self.place_map.keys():
|
||||||
|
place = self.place_map[handle]
|
||||||
|
new_place = list(place)
|
||||||
|
new_place = new_place[:12] + [[]] + new_place[12:]
|
||||||
|
new_place = tuple(new_place)
|
||||||
|
with BSDDBTxn(self.env, self.place_map) as txn:
|
||||||
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_place)
|
||||||
|
self.update()
|
||||||
|
|
||||||
|
# ---------------------------------
|
||||||
|
# Modify Repository
|
||||||
|
# ---------------------------------
|
||||||
|
# Add new tag_list field.
|
||||||
|
for handle in self.repository_map.keys():
|
||||||
|
repository = self.repository_map[handle]
|
||||||
|
new_repository = list(repository)
|
||||||
|
new_repository = new_repository[:8] + [[]] + new_repository[8:]
|
||||||
|
new_repository = tuple(new_repository)
|
||||||
|
with BSDDBTxn(self.env, self.repository_map) as txn:
|
||||||
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_repository)
|
||||||
|
self.update()
|
||||||
|
|
||||||
|
# ---------------------------------
|
||||||
|
# Modify Source
|
||||||
|
# ---------------------------------
|
||||||
|
# Add new tag_list field.
|
||||||
|
for handle in self.source_map.keys():
|
||||||
|
source = self.source_map[handle]
|
||||||
|
new_source = list(source)
|
||||||
|
new_source = new_source[:11] + [[]] + new_source[11:]
|
||||||
|
new_source = tuple(new_source)
|
||||||
|
with BSDDBTxn(self.env, self.source_map) as txn:
|
||||||
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_source)
|
||||||
|
self.update()
|
||||||
|
|
||||||
|
# ---------------------------------
|
||||||
|
# Modify Citation
|
||||||
|
# ---------------------------------
|
||||||
|
# Add new tag_list field.
|
||||||
|
for handle in self.citation_map.keys():
|
||||||
|
citation = self.citation_map[handle]
|
||||||
|
new_citation = list(citation)
|
||||||
|
new_citation = new_citation[:10] + [[]] + new_citation[10:]
|
||||||
|
new_citation = tuple(new_citation)
|
||||||
|
with BSDDBTxn(self.env, self.citation_map) as txn:
|
||||||
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_citation)
|
||||||
|
self.update()
|
||||||
|
|
||||||
|
# Bump up database version. Separate transaction to save metadata.
|
||||||
|
with BSDDBTxn(self.env, self.metadata) as txn:
|
||||||
|
txn.put(b'version', 17)
|
||||||
|
|
||||||
def gramps_upgrade_16(self):
|
def gramps_upgrade_16(self):
|
||||||
"""Upgrade database from version 15 to 16. This upgrade converts all
|
"""Upgrade database from version 15 to 16. This upgrade converts all
|
||||||
SourceRef child objects to Citation Primary objects.
|
SourceRef child objects to Citation Primary objects.
|
||||||
@@ -144,7 +299,9 @@ def gramps_upgrade_16(self):
|
|||||||
new_citation_list, note_list, change, tag_list,
|
new_citation_list, note_list, change, tag_list,
|
||||||
private, person_ref_list)
|
private, person_ref_list)
|
||||||
with BSDDBTxn(self.env, self.person_map) as txn:
|
with BSDDBTxn(self.env, self.person_map) as txn:
|
||||||
txn.put(str(handle), new_person)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_person)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
LOG.debug("%d persons upgraded with %d citations in %d seconds. " %
|
LOG.debug("%d persons upgraded with %d citations in %d seconds. " %
|
||||||
@@ -176,7 +333,9 @@ def gramps_upgrade_16(self):
|
|||||||
change, date, tag_list, private)
|
change, date, tag_list, private)
|
||||||
LOG.debug(" upgrade new_media %s" % [new_media])
|
LOG.debug(" upgrade new_media %s" % [new_media])
|
||||||
with BSDDBTxn(self.env, self.media_map) as txn:
|
with BSDDBTxn(self.env, self.media_map) as txn:
|
||||||
txn.put(str(handle), new_media)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_media)
|
||||||
LOG.debug(" update ref map media %s" % [handle,
|
LOG.debug(" update ref map media %s" % [handle,
|
||||||
self.get_object_from_handle(handle) ])
|
self.get_object_from_handle(handle) ])
|
||||||
self.update()
|
self.update()
|
||||||
@@ -195,7 +354,7 @@ def gramps_upgrade_16(self):
|
|||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
for place_handle in self.place_map.keys():
|
for place_handle in self.place_map.keys():
|
||||||
place = self.place_map[place_handle]
|
place = self.place_map[place_handle]
|
||||||
(handle, gramps_id, title, int, lat,
|
(handle, gramps_id, title, longi, lat,
|
||||||
main_loc, alt_loc, urls, media_list, source_list, note_list,
|
main_loc, alt_loc, urls, media_list, source_list, note_list,
|
||||||
change, private) = place
|
change, private) = place
|
||||||
if source_list:
|
if source_list:
|
||||||
@@ -208,11 +367,13 @@ def gramps_upgrade_16(self):
|
|||||||
self, media_list)
|
self, media_list)
|
||||||
if source_list or media_list:
|
if source_list or media_list:
|
||||||
new_place = (handle, gramps_id, title,
|
new_place = (handle, gramps_id, title,
|
||||||
int, lat, main_loc, alt_loc, urls,
|
longi, lat, main_loc, alt_loc, urls,
|
||||||
media_list, new_citation_list, note_list,
|
media_list, new_citation_list, note_list,
|
||||||
change, private)
|
change, private)
|
||||||
with BSDDBTxn(self.env, self.place_map) as txn:
|
with BSDDBTxn(self.env, self.place_map) as txn:
|
||||||
txn.put(str(handle), new_place)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_place)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
LOG.debug("%d places upgraded with %d citations in %d seconds. " %
|
LOG.debug("%d places upgraded with %d citations in %d seconds. " %
|
||||||
@@ -260,7 +421,9 @@ def gramps_upgrade_16(self):
|
|||||||
attribute_list, lds_seal_list, new_citation_list,
|
attribute_list, lds_seal_list, new_citation_list,
|
||||||
note_list, change, tag_list, private)
|
note_list, change, tag_list, private)
|
||||||
with BSDDBTxn(self.env, self.family_map) as txn:
|
with BSDDBTxn(self.env, self.family_map) as txn:
|
||||||
txn.put(str(handle), new_family)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_family)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
LOG.debug("%d familys upgraded with %d citations in %d seconds. " %
|
LOG.debug("%d familys upgraded with %d citations in %d seconds. " %
|
||||||
@@ -300,7 +463,9 @@ def gramps_upgrade_16(self):
|
|||||||
attribute_list,
|
attribute_list,
|
||||||
change, private)
|
change, private)
|
||||||
with BSDDBTxn(self.env, self.event_map) as txn:
|
with BSDDBTxn(self.env, self.event_map) as txn:
|
||||||
txn.put(str(handle), new_event)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_event)
|
||||||
t2 = time.time()
|
t2 = time.time()
|
||||||
upgrade_time += t2 - t1
|
upgrade_time += t2 - t1
|
||||||
t3 = time.time()
|
t3 = time.time()
|
||||||
@@ -332,7 +497,9 @@ def gramps_upgrade_16(self):
|
|||||||
new_repository = (handle, gramps_id, the_type, name, note_list,
|
new_repository = (handle, gramps_id, the_type, name, note_list,
|
||||||
address_list, urls, change, private)
|
address_list, urls, change, private)
|
||||||
with BSDDBTxn(self.env, self.repository_map) as txn:
|
with BSDDBTxn(self.env, self.repository_map) as txn:
|
||||||
txn.put(str(handle), new_repository)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_repository)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
LOG.debug("%d repositorys upgraded with %d citations in %d seconds. " %
|
LOG.debug("%d repositorys upgraded with %d citations in %d seconds. " %
|
||||||
@@ -535,7 +702,9 @@ def convert_source_list_to_citation_list_16(self, source_list):
|
|||||||
date, page, confidence, ref, note_list, new_media_list,
|
date, page, confidence, ref, note_list, new_media_list,
|
||||||
new_data_map, new_change, private)
|
new_data_map, new_change, private)
|
||||||
with BSDDBTxn(self.env, self.citation_map) as txn:
|
with BSDDBTxn(self.env, self.citation_map) as txn:
|
||||||
txn.put(str(new_handle), new_citation)
|
if isinstance(new_handle, UNITYPE):
|
||||||
|
new_handle = new_handle.encode('utf-8')
|
||||||
|
txn.put(new_handle, new_citation)
|
||||||
self.cmap_index += 1
|
self.cmap_index += 1
|
||||||
# # add backlinks for references from Citation to Source
|
# # add backlinks for references from Citation to Source
|
||||||
# with BSDDBTxn(self.env) as txn:
|
# with BSDDBTxn(self.env) as txn:
|
||||||
@@ -621,7 +790,9 @@ def gramps_upgrade_15(self):
|
|||||||
)
|
)
|
||||||
|
|
||||||
with BSDDBTxn(self.env, self.person_map) as txn:
|
with BSDDBTxn(self.env, self.person_map) as txn:
|
||||||
txn.put(str(handle), new_person)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_person)
|
||||||
self.update()
|
self.update()
|
||||||
#surname is now different, remove secondary index with names
|
#surname is now different, remove secondary index with names
|
||||||
_db = db.DB(self.env)
|
_db = db.DB(self.env)
|
||||||
@@ -644,7 +815,9 @@ def gramps_upgrade_15(self):
|
|||||||
new_family[13] = []
|
new_family[13] = []
|
||||||
new_family = tuple(new_family)
|
new_family = tuple(new_family)
|
||||||
with BSDDBTxn(self.env, self.family_map) as txn:
|
with BSDDBTxn(self.env, self.family_map) as txn:
|
||||||
txn.put(str(handle), new_family)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_family)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -661,7 +834,9 @@ def gramps_upgrade_15(self):
|
|||||||
new_note[6] = []
|
new_note[6] = []
|
||||||
new_note = tuple(new_note)
|
new_note = tuple(new_note)
|
||||||
with BSDDBTxn(self.env, self.note_map) as txn:
|
with BSDDBTxn(self.env, self.note_map) as txn:
|
||||||
txn.put(str(handle), new_note)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_note)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -674,7 +849,9 @@ def gramps_upgrade_15(self):
|
|||||||
new_media[10] = []
|
new_media[10] = []
|
||||||
new_media = tuple(new_media)
|
new_media = tuple(new_media)
|
||||||
with BSDDBTxn(self.env, self.media_map) as txn:
|
with BSDDBTxn(self.env, self.media_map) as txn:
|
||||||
txn.put(str(handle), new_media)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_media)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -688,7 +865,9 @@ def gramps_upgrade_15(self):
|
|||||||
#new_event[11] = []
|
#new_event[11] = []
|
||||||
new_event = tuple(new_event)
|
new_event = tuple(new_event)
|
||||||
with BSDDBTxn(self.env, self.event_map) as txn:
|
with BSDDBTxn(self.env, self.event_map) as txn:
|
||||||
txn.put(str(handle), new_event)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_event)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -704,7 +883,9 @@ def gramps_upgrade_15(self):
|
|||||||
new_place = new_place[:12] + new_place[13:]
|
new_place = new_place[:12] + new_place[13:]
|
||||||
new_place = tuple(new_place)
|
new_place = tuple(new_place)
|
||||||
with BSDDBTxn(self.env, self.place_map) as txn:
|
with BSDDBTxn(self.env, self.place_map) as txn:
|
||||||
txn.put(str(handle), new_place)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_place)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -717,7 +898,9 @@ def gramps_upgrade_15(self):
|
|||||||
new_source = new_source[:11] + new_source[12:]
|
new_source = new_source[:11] + new_source[12:]
|
||||||
new_source = tuple(new_source)
|
new_source = tuple(new_source)
|
||||||
with BSDDBTxn(self.env, self.source_map) as txn:
|
with BSDDBTxn(self.env, self.source_map) as txn:
|
||||||
txn.put(str(handle), new_source)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_source)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -731,7 +914,9 @@ def gramps_upgrade_15(self):
|
|||||||
new_repository[5] = list(map(convert_address, new_repository[5]))
|
new_repository[5] = list(map(convert_address, new_repository[5]))
|
||||||
new_repository = tuple(new_repository)
|
new_repository = tuple(new_repository)
|
||||||
with BSDDBTxn(self.env, self.repository_map) as txn:
|
with BSDDBTxn(self.env, self.repository_map) as txn:
|
||||||
txn.put(str(handle), new_repository)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_repository)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# Bump up database version. Separate transaction to save metadata.
|
# Bump up database version. Separate transaction to save metadata.
|
||||||
@@ -753,6 +938,8 @@ def convert_marker(self, marker_field):
|
|||||||
tag.set_name(tag_name)
|
tag.set_name(tag_name)
|
||||||
tag.set_priority(len(self.tags))
|
tag.set_priority(len(self.tags))
|
||||||
with BSDDBTxn(self.env, self.tag_map) as txn:
|
with BSDDBTxn(self.env, self.tag_map) as txn:
|
||||||
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
txn.put(handle, tag.serialize())
|
txn.put(handle, tag.serialize())
|
||||||
self.tags[tag_name] = handle
|
self.tags[tag_name] = handle
|
||||||
return self.tags[tag_name]
|
return self.tags[tag_name]
|
||||||
@@ -819,7 +1006,9 @@ def gramps_upgrade_14(self):
|
|||||||
new_note = (handle, gramps_id, styled_text, format, note_type,
|
new_note = (handle, gramps_id, styled_text, format, note_type,
|
||||||
change, marker, private)
|
change, marker, private)
|
||||||
with BSDDBTxn(self.env, self.note_map) as txn:
|
with BSDDBTxn(self.env, self.note_map) as txn:
|
||||||
txn.put(str(handle), new_note)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_note)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -839,7 +1028,9 @@ def gramps_upgrade_14(self):
|
|||||||
description, place, new_source_list, note_list,
|
description, place, new_source_list, note_list,
|
||||||
new_media_list, new_attribute_list, change,marker,private)
|
new_media_list, new_attribute_list, change,marker,private)
|
||||||
with BSDDBTxn(self.env, self.event_map) as txn:
|
with BSDDBTxn(self.env, self.event_map) as txn:
|
||||||
txn.put(str(handle), new_event)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_event)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -921,7 +1112,9 @@ def gramps_upgrade_14(self):
|
|||||||
)
|
)
|
||||||
|
|
||||||
with BSDDBTxn(self.env, self.person_map) as txn:
|
with BSDDBTxn(self.env, self.person_map) as txn:
|
||||||
txn.put(str(handle), new_person)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_person)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -953,7 +1146,9 @@ def gramps_upgrade_14(self):
|
|||||||
change, marker, private)
|
change, marker, private)
|
||||||
|
|
||||||
with BSDDBTxn(self.env, self.family_map) as txn:
|
with BSDDBTxn(self.env, self.family_map) as txn:
|
||||||
txn.put(str(handle), new_family)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_family)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -978,7 +1173,9 @@ def gramps_upgrade_14(self):
|
|||||||
new_address_list, urls, change, marker, private)
|
new_address_list, urls, change, marker, private)
|
||||||
|
|
||||||
with BSDDBTxn(self.env, self.repository_map) as txn:
|
with BSDDBTxn(self.env, self.repository_map) as txn:
|
||||||
txn.put(str(handle), new_repository)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_repository)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -996,7 +1193,9 @@ def gramps_upgrade_14(self):
|
|||||||
new_date, marker, private)
|
new_date, marker, private)
|
||||||
|
|
||||||
with BSDDBTxn(self.env, self.media_map) as txn:
|
with BSDDBTxn(self.env, self.media_map) as txn:
|
||||||
txn.put(str(handle), new_media)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_media)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -1004,17 +1203,19 @@ def gramps_upgrade_14(self):
|
|||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
for place_handle in self.place_map.keys():
|
for place_handle in self.place_map.keys():
|
||||||
place = self.place_map[place_handle]
|
place = self.place_map[place_handle]
|
||||||
(handle, gramps_id, title, int, lat,
|
(handle, gramps_id, title, longi, lat,
|
||||||
main_loc, alt_loc, urls, media_list, source_list, note_list,
|
main_loc, alt_loc, urls, media_list, source_list, note_list,
|
||||||
change, marker, private) = place
|
change, marker, private) = place
|
||||||
new_media_list = new_media_list_14(media_list)
|
new_media_list = new_media_list_14(media_list)
|
||||||
new_source_list = new_source_list_14(source_list)
|
new_source_list = new_source_list_14(source_list)
|
||||||
new_place = (handle, gramps_id, title, int, lat,
|
new_place = (handle, gramps_id, title, longi, lat,
|
||||||
main_loc, alt_loc, urls, new_media_list,
|
main_loc, alt_loc, urls, new_media_list,
|
||||||
new_source_list, note_list, change, marker, private)
|
new_source_list, note_list, change, marker, private)
|
||||||
|
|
||||||
with BSDDBTxn(self.env, self.place_map) as txn:
|
with BSDDBTxn(self.env, self.place_map) as txn:
|
||||||
txn.put(str(handle), new_place)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_place)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -1033,7 +1234,9 @@ def gramps_upgrade_14(self):
|
|||||||
marker, private)
|
marker, private)
|
||||||
|
|
||||||
with BSDDBTxn(self.env, self.source_map) as txn:
|
with BSDDBTxn(self.env, self.source_map) as txn:
|
||||||
txn.put(str(handle), new_source)
|
if isinstance(handle, UNITYPE):
|
||||||
|
handle = handle.encode('utf-8')
|
||||||
|
txn.put(handle, new_source)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
# Bump up database version. Separate transaction to save metadata.
|
# Bump up database version. Separate transaction to save metadata.
|
||||||
|
@@ -40,13 +40,11 @@ else:
|
|||||||
import pickle
|
import pickle
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import locale
|
|
||||||
import bisect
|
import bisect
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
import logging
|
import logging
|
||||||
from sys import maxsize
|
from sys import maxsize
|
||||||
|
|
||||||
from ..ggettext import gettext as _
|
|
||||||
from ..config import config
|
from ..config import config
|
||||||
if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
|
if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
|
||||||
from bsddb3 import dbshelve, db
|
from bsddb3 import dbshelve, db
|
||||||
@@ -64,6 +62,7 @@ from ..lib.src import Source
|
|||||||
from ..lib.citation import Citation
|
from ..lib.citation import Citation
|
||||||
from ..lib.event import Event
|
from ..lib.event import Event
|
||||||
from ..lib.place import Place
|
from ..lib.place import Place
|
||||||
|
from ..lib.location import Location
|
||||||
from ..lib.repo import Repository
|
from ..lib.repo import Repository
|
||||||
from ..lib.mediaobj import MediaObject
|
from ..lib.mediaobj import MediaObject
|
||||||
from ..lib.note import Note
|
from ..lib.note import Note
|
||||||
@@ -74,18 +73,20 @@ from ..lib.researcher import Researcher
|
|||||||
from . import (DbBsddbRead, DbWriteBase, BSDDBTxn,
|
from . import (DbBsddbRead, DbWriteBase, BSDDBTxn,
|
||||||
DbTxn, BsddbBaseCursor, BsddbDowngradeError, DbVersionError,
|
DbTxn, BsddbBaseCursor, BsddbDowngradeError, DbVersionError,
|
||||||
DbEnvironmentError, DbUpgradeRequiredError, find_surname,
|
DbEnvironmentError, DbUpgradeRequiredError, find_surname,
|
||||||
find_surname_name, DbUndoBSDDB as DbUndo)
|
find_byte_surname, find_surname_name, DbUndoBSDDB as DbUndo)
|
||||||
from .dbconst import *
|
from .dbconst import *
|
||||||
from ..utils.callback import Callback
|
from ..utils.callback import Callback
|
||||||
from ..utils.cast import (conv_unicode_tosrtkey, conv_dbstr_to_unicode)
|
from ..utils.cast import conv_dbstr_to_unicode
|
||||||
from ..updatecallback import UpdateCallback
|
from ..updatecallback import UpdateCallback
|
||||||
from ..errors import DbError
|
from ..errors import DbError
|
||||||
from ..constfunc import win, conv_to_unicode, cuni, UNITYPE
|
from ..constfunc import win, conv_to_unicode, cuni, UNITYPE, handle2internal
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
|
|
||||||
_LOG = logging.getLogger(DBLOGNAME)
|
_LOG = logging.getLogger(DBLOGNAME)
|
||||||
LOG = logging.getLogger(".citation")
|
LOG = logging.getLogger(".citation")
|
||||||
_MINVERSION = 9
|
_MINVERSION = 9
|
||||||
_DBVERSION = 16
|
_DBVERSION = 18
|
||||||
|
|
||||||
IDTRANS = "person_id"
|
IDTRANS = "person_id"
|
||||||
FIDTRANS = "family_id"
|
FIDTRANS = "family_id"
|
||||||
@@ -97,6 +98,8 @@ NIDTRANS = "note_id"
|
|||||||
SIDTRANS = "source_id"
|
SIDTRANS = "source_id"
|
||||||
CIDTRANS = "citation_id"
|
CIDTRANS = "citation_id"
|
||||||
TAGTRANS = "tag_name"
|
TAGTRANS = "tag_name"
|
||||||
|
LPARENTS = "location_parent"
|
||||||
|
LNAMES = "location_name"
|
||||||
SURNAMES = "surnames"
|
SURNAMES = "surnames"
|
||||||
NAME_GROUP = "name_group"
|
NAME_GROUP = "name_group"
|
||||||
META = "meta_data"
|
META = "meta_data"
|
||||||
@@ -111,6 +114,7 @@ PERSON_TBL = "person"
|
|||||||
REPO_TBL = "repo"
|
REPO_TBL = "repo"
|
||||||
NOTE_TBL = "note"
|
NOTE_TBL = "note"
|
||||||
TAG_TBL = "tag"
|
TAG_TBL = "tag"
|
||||||
|
LOCATION_TBL = "location"
|
||||||
|
|
||||||
REF_MAP = "reference_map"
|
REF_MAP = "reference_map"
|
||||||
REF_PRI = "primary_map"
|
REF_PRI = "primary_map"
|
||||||
@@ -134,7 +138,8 @@ CLASS_TO_KEY_MAP = {Person.__name__: PERSON_KEY,
|
|||||||
Place.__name__: PLACE_KEY,
|
Place.__name__: PLACE_KEY,
|
||||||
Repository.__name__:REPOSITORY_KEY,
|
Repository.__name__:REPOSITORY_KEY,
|
||||||
Note.__name__: NOTE_KEY,
|
Note.__name__: NOTE_KEY,
|
||||||
Tag.__name__: TAG_KEY}
|
Tag.__name__: TAG_KEY,
|
||||||
|
Location.__name__: LOCATION_KEY}
|
||||||
|
|
||||||
KEY_TO_CLASS_MAP = {PERSON_KEY: Person.__name__,
|
KEY_TO_CLASS_MAP = {PERSON_KEY: Person.__name__,
|
||||||
FAMILY_KEY: Family.__name__,
|
FAMILY_KEY: Family.__name__,
|
||||||
@@ -145,7 +150,8 @@ KEY_TO_CLASS_MAP = {PERSON_KEY: Person.__name__,
|
|||||||
PLACE_KEY: Place.__name__,
|
PLACE_KEY: Place.__name__,
|
||||||
REPOSITORY_KEY: Repository.__name__,
|
REPOSITORY_KEY: Repository.__name__,
|
||||||
NOTE_KEY: Note.__name__,
|
NOTE_KEY: Note.__name__,
|
||||||
TAG_KEY: Tag.__name__}
|
TAG_KEY: Tag.__name__,
|
||||||
|
LOCATION_KEY: Location.__name__}
|
||||||
|
|
||||||
KEY_TO_NAME_MAP = {PERSON_KEY: 'person',
|
KEY_TO_NAME_MAP = {PERSON_KEY: 'person',
|
||||||
FAMILY_KEY: 'family',
|
FAMILY_KEY: 'family',
|
||||||
@@ -157,13 +163,14 @@ KEY_TO_NAME_MAP = {PERSON_KEY: 'person',
|
|||||||
REPOSITORY_KEY: 'repository',
|
REPOSITORY_KEY: 'repository',
|
||||||
#REFERENCE_KEY: 'reference',
|
#REFERENCE_KEY: 'reference',
|
||||||
NOTE_KEY: 'note',
|
NOTE_KEY: 'note',
|
||||||
TAG_KEY: 'tag'}
|
TAG_KEY: 'tag',
|
||||||
|
LOCATION_KEY: 'location'}
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Helper functions
|
# Helper functions
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
def find_idmap(key, data):
|
def find_idmap(key, data):
|
||||||
""" return id for association of secondary index.
|
""" return id for association of secondary index.
|
||||||
returns a byte string
|
returns a byte string
|
||||||
@@ -173,6 +180,20 @@ def find_idmap(key, data):
|
|||||||
val = val.encode('utf-8')
|
val = val.encode('utf-8')
|
||||||
return val
|
return val
|
||||||
|
|
||||||
|
def find_parent(key, data):
|
||||||
|
return str(data[1])
|
||||||
|
val = data[1]
|
||||||
|
if isinstance(val, UNITYPE):
|
||||||
|
val = val.encode('utf-8')
|
||||||
|
return val
|
||||||
|
|
||||||
|
def find_name(key, data):
|
||||||
|
return str(data[2]).upper()
|
||||||
|
val = data[2].upper()
|
||||||
|
if isinstance(val, UNITYPE):
|
||||||
|
val = val.encode('utf-8')
|
||||||
|
return val
|
||||||
|
|
||||||
# Secondary database key lookups for reference_map table
|
# Secondary database key lookups for reference_map table
|
||||||
# reference_map data values are of the form:
|
# reference_map data values are of the form:
|
||||||
# ((primary_object_class_name, primary_object_handle),
|
# ((primary_object_class_name, primary_object_handle),
|
||||||
@@ -235,7 +256,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
# 1. Signals for primary objects
|
# 1. Signals for primary objects
|
||||||
__signals__ = dict((obj+'-'+op, signal)
|
__signals__ = dict((obj+'-'+op, signal)
|
||||||
for obj in
|
for obj in
|
||||||
['person', 'family', 'event', 'place',
|
['person', 'family', 'event', 'place', 'location',
|
||||||
'source', 'citation', 'media', 'note', 'repository', 'tag']
|
'source', 'citation', 'media', 'note', 'repository', 'tag']
|
||||||
for op, signal in zip(
|
for op, signal in zip(
|
||||||
['add', 'update', 'delete', 'rebuild'],
|
['add', 'update', 'delete', 'rebuild'],
|
||||||
@@ -363,6 +384,20 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
return DbBsddbAssocCursor(self.reference_map_referenced_map,
|
return DbBsddbAssocCursor(self.reference_map_referenced_map,
|
||||||
self.txn)
|
self.txn)
|
||||||
|
|
||||||
|
@catch_db_error
|
||||||
|
def get_location_parent_cursor(self):
|
||||||
|
"""
|
||||||
|
Returns a reference to a cursor over the location parents
|
||||||
|
"""
|
||||||
|
return DbBsddbAssocCursor(self.parents, self.txn)
|
||||||
|
|
||||||
|
@catch_db_error
|
||||||
|
def get_location_name_cursor(self):
|
||||||
|
"""
|
||||||
|
Returns a reference to a cursor over the location names
|
||||||
|
"""
|
||||||
|
return DbBsddbAssocCursor(self.names, self.txn)
|
||||||
|
|
||||||
# These are overriding the DbBsddbRead's methods of saving metadata
|
# These are overriding the DbBsddbRead's methods of saving metadata
|
||||||
# because we now have txn-capable metadata table
|
# because we now have txn-capable metadata table
|
||||||
|
|
||||||
@@ -444,7 +479,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
# See if we lack write access to any files in the directory
|
# See if we lack write access to any files in the directory
|
||||||
for base in [FAMILY_TBL, PLACES_TBL, SOURCES_TBL, CITATIONS_TBL,
|
for base in [FAMILY_TBL, PLACES_TBL, SOURCES_TBL, CITATIONS_TBL,
|
||||||
MEDIA_TBL, EVENTS_TBL, PERSON_TBL, REPO_TBL,
|
MEDIA_TBL, EVENTS_TBL, PERSON_TBL, REPO_TBL,
|
||||||
NOTE_TBL, REF_MAP, META]:
|
NOTE_TBL, TAG_TBL, LOCATION_TBL, REF_MAP, META]:
|
||||||
path = os.path.join(name, base + DBEXT)
|
path = os.path.join(name, base + DBEXT)
|
||||||
if os.path.isfile(path) and not os.access(path, os.W_OK):
|
if os.path.isfile(path) and not os.access(path, os.W_OK):
|
||||||
return True
|
return True
|
||||||
@@ -558,6 +593,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
("repository_map", REPO_TBL, db.DB_HASH),
|
("repository_map", REPO_TBL, db.DB_HASH),
|
||||||
("note_map", NOTE_TBL, db.DB_HASH),
|
("note_map", NOTE_TBL, db.DB_HASH),
|
||||||
("tag_map", TAG_TBL, db.DB_HASH),
|
("tag_map", TAG_TBL, db.DB_HASH),
|
||||||
|
("location_map", LOCATION_TBL, db.DB_HASH),
|
||||||
("reference_map", REF_MAP, db.DB_BTREE),
|
("reference_map", REF_MAP, db.DB_BTREE),
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -706,6 +742,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
("rid_trans", RIDTRANS, db.DB_HASH, 0),
|
("rid_trans", RIDTRANS, db.DB_HASH, 0),
|
||||||
("nid_trans", NIDTRANS, db.DB_HASH, 0),
|
("nid_trans", NIDTRANS, db.DB_HASH, 0),
|
||||||
("tag_trans", TAGTRANS, db.DB_HASH, 0),
|
("tag_trans", TAGTRANS, db.DB_HASH, 0),
|
||||||
|
("parents", LPARENTS, db.DB_HASH, 0),
|
||||||
|
("names", LNAMES, db.DB_BTREE, db.DB_DUPSORT),
|
||||||
("reference_map_primary_map", REF_PRI, db.DB_BTREE, 0),
|
("reference_map_primary_map", REF_PRI, db.DB_BTREE, 0),
|
||||||
("reference_map_referenced_map", REF_REF, db.DB_BTREE, db.DB_DUPSORT),
|
("reference_map_referenced_map", REF_REF, db.DB_BTREE, db.DB_DUPSORT),
|
||||||
]
|
]
|
||||||
@@ -718,7 +756,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
if not self.readonly:
|
if not self.readonly:
|
||||||
|
|
||||||
assoc = [
|
assoc = [
|
||||||
(self.person_map, self.surnames, find_surname),
|
(self.person_map, self.surnames, find_byte_surname),
|
||||||
(self.person_map, self.id_trans, find_idmap),
|
(self.person_map, self.id_trans, find_idmap),
|
||||||
(self.family_map, self.fid_trans, find_idmap),
|
(self.family_map, self.fid_trans, find_idmap),
|
||||||
(self.event_map, self.eid_trans, find_idmap),
|
(self.event_map, self.eid_trans, find_idmap),
|
||||||
@@ -729,6 +767,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
(self.repository_map, self.rid_trans, find_idmap),
|
(self.repository_map, self.rid_trans, find_idmap),
|
||||||
(self.note_map, self.nid_trans, find_idmap),
|
(self.note_map, self.nid_trans, find_idmap),
|
||||||
(self.tag_map, self.tag_trans, find_idmap),
|
(self.tag_map, self.tag_trans, find_idmap),
|
||||||
|
(self.location_map, self.parents, find_parent),
|
||||||
|
(self.location_map, self.names, find_name),
|
||||||
(self.reference_map, self.reference_map_primary_map,
|
(self.reference_map, self.reference_map_primary_map,
|
||||||
find_primary_handle),
|
find_primary_handle),
|
||||||
(self.reference_map, self.reference_map_referenced_map,
|
(self.reference_map, self.reference_map_referenced_map,
|
||||||
@@ -770,6 +810,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
( self.nid_trans, NIDTRANS ),
|
( self.nid_trans, NIDTRANS ),
|
||||||
( self.cid_trans, CIDTRANS ),
|
( self.cid_trans, CIDTRANS ),
|
||||||
( self.tag_trans, TAGTRANS ),
|
( self.tag_trans, TAGTRANS ),
|
||||||
|
( self.parents, LPARENTS ),
|
||||||
|
( self.names, LNAMES ),
|
||||||
( self.reference_map_primary_map, REF_PRI),
|
( self.reference_map_primary_map, REF_PRI),
|
||||||
( self.reference_map_referenced_map, REF_REF),
|
( self.reference_map_referenced_map, REF_REF),
|
||||||
]
|
]
|
||||||
@@ -796,6 +838,60 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
if callback:
|
if callback:
|
||||||
callback(12)
|
callback(12)
|
||||||
|
|
||||||
|
@catch_db_error
|
||||||
|
def find_location_child_handles(self, handle):
|
||||||
|
"""
|
||||||
|
"""
|
||||||
|
handle = str(handle)
|
||||||
|
parent_cur = self.get_location_parent_cursor()
|
||||||
|
|
||||||
|
try:
|
||||||
|
ret = parent_cur.set(handle)
|
||||||
|
except:
|
||||||
|
ret = None
|
||||||
|
|
||||||
|
while (ret is not None):
|
||||||
|
(key, data) = ret
|
||||||
|
|
||||||
|
### FIXME: this is a dirty hack that works without no
|
||||||
|
### sensible explanation. For some reason, for a readonly
|
||||||
|
### database, secondary index returns a primary table key
|
||||||
|
### corresponding to the data, not the data.
|
||||||
|
if self.readonly:
|
||||||
|
data = self.location_map.get(data)
|
||||||
|
else:
|
||||||
|
data = pickle.loads(data)
|
||||||
|
|
||||||
|
yield data[0]
|
||||||
|
ret = parent_cur.next_dup()
|
||||||
|
|
||||||
|
parent_cur.close()
|
||||||
|
|
||||||
|
@catch_db_error
|
||||||
|
def find_location_from_name(self, name):
|
||||||
|
"""
|
||||||
|
"""
|
||||||
|
name = str(name).upper()
|
||||||
|
size = len(name)
|
||||||
|
name_cur = self.get_location_name_cursor()
|
||||||
|
|
||||||
|
try:
|
||||||
|
ret = name_cur.set_range(name)
|
||||||
|
ret = name_cur.current()
|
||||||
|
except:
|
||||||
|
ret = None
|
||||||
|
|
||||||
|
while (ret is not None):
|
||||||
|
(key, data) = ret
|
||||||
|
|
||||||
|
if key[:size] != name:
|
||||||
|
break
|
||||||
|
|
||||||
|
yield data[0]
|
||||||
|
ret = name_cur.next()
|
||||||
|
|
||||||
|
name_cur.close()
|
||||||
|
|
||||||
@catch_db_error
|
@catch_db_error
|
||||||
def find_backlink_handles(self, handle, include_classes=None):
|
def find_backlink_handles(self, handle, include_classes=None):
|
||||||
"""
|
"""
|
||||||
@@ -857,6 +953,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
def delete_primary_from_reference_map(self, handle, transaction, txn=None):
|
def delete_primary_from_reference_map(self, handle, transaction, txn=None):
|
||||||
"""
|
"""
|
||||||
Remove all references to the primary object from the reference_map.
|
Remove all references to the primary object from the reference_map.
|
||||||
|
handle should be utf-8
|
||||||
"""
|
"""
|
||||||
primary_cur = self.get_reference_map_primary_cursor()
|
primary_cur = self.get_reference_map_primary_cursor()
|
||||||
|
|
||||||
@@ -875,8 +972,12 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
|
|
||||||
# so we need the second tuple give us a reference that we can
|
# so we need the second tuple give us a reference that we can
|
||||||
# combine with the primary_handle to get the main key.
|
# combine with the primary_handle to get the main key.
|
||||||
|
if sys.version_info[0] < 3:
|
||||||
main_key = (handle, pickle.loads(data)[1][1])
|
#handle should be in python 2 str
|
||||||
|
main_key = (handle, pickle.loads(data)[1][1])
|
||||||
|
else:
|
||||||
|
#python 3 work internally with unicode
|
||||||
|
main_key = (handle.decode('utf-8'), pickle.loads(data)[1][1])
|
||||||
|
|
||||||
# The trick is not to remove while inside the cursor,
|
# The trick is not to remove while inside the cursor,
|
||||||
# but collect them all and remove after the cursor is closed
|
# but collect them all and remove after the cursor is closed
|
||||||
@@ -950,7 +1051,12 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
the passed transaction.
|
the passed transaction.
|
||||||
"""
|
"""
|
||||||
if isinstance(key, tuple):
|
if isinstance(key, tuple):
|
||||||
#create a string key
|
#create a byte string key, first validity check in python 3!
|
||||||
|
for val in key:
|
||||||
|
if sys.version_info[0] >= 3 and isinstance(val, bytes):
|
||||||
|
raise DbError(_('An attempt is made to safe a reference key '
|
||||||
|
'which is partly bytecode, this is not allowed.\n'
|
||||||
|
'Key is %s') % str(key))
|
||||||
key = str(key)
|
key = str(key)
|
||||||
if isinstance(key, UNITYPE):
|
if isinstance(key, UNITYPE):
|
||||||
key = key.encode('utf-8')
|
key = key.encode('utf-8')
|
||||||
@@ -1143,6 +1249,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
self.cid_trans.close()
|
self.cid_trans.close()
|
||||||
self.pid_trans.close()
|
self.pid_trans.close()
|
||||||
self.tag_trans.close()
|
self.tag_trans.close()
|
||||||
|
self.parents.close()
|
||||||
|
self.names.close()
|
||||||
self.reference_map_primary_map.close()
|
self.reference_map_primary_map.close()
|
||||||
self.reference_map_referenced_map.close()
|
self.reference_map_referenced_map.close()
|
||||||
self.reference_map.close()
|
self.reference_map.close()
|
||||||
@@ -1160,6 +1268,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
self.media_map.close()
|
self.media_map.close()
|
||||||
self.event_map.close()
|
self.event_map.close()
|
||||||
self.tag_map.close()
|
self.tag_map.close()
|
||||||
|
self.location_map.close()
|
||||||
self.env.close()
|
self.env.close()
|
||||||
self.__close_undodb()
|
self.__close_undodb()
|
||||||
|
|
||||||
@@ -1173,6 +1282,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
self.media_map = None
|
self.media_map = None
|
||||||
self.event_map = None
|
self.event_map = None
|
||||||
self.tag_map = None
|
self.tag_map = None
|
||||||
|
self.location_map = None
|
||||||
self.surnames = None
|
self.surnames = None
|
||||||
self.env = None
|
self.env = None
|
||||||
self.metadata = None
|
self.metadata = None
|
||||||
@@ -1191,6 +1301,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
self.media_map = None
|
self.media_map = None
|
||||||
self.event_map = None
|
self.event_map = None
|
||||||
self.tag_map = None
|
self.tag_map = None
|
||||||
|
self.location_map = None
|
||||||
self.reference_map_primary_map = None
|
self.reference_map_primary_map = None
|
||||||
self.reference_map_referenced_map = None
|
self.reference_map_referenced_map = None
|
||||||
self.reference_map = None
|
self.reference_map = None
|
||||||
@@ -1356,6 +1467,13 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
"""
|
"""
|
||||||
return self.__add_object(obj, transaction, None, self.commit_tag)
|
return self.__add_object(obj, transaction, None, self.commit_tag)
|
||||||
|
|
||||||
|
def add_location(self, obj, transaction):
|
||||||
|
"""
|
||||||
|
Add a Location to the database, assigning a handle if it has not already
|
||||||
|
been defined.
|
||||||
|
"""
|
||||||
|
return self.__add_object(obj, transaction, None, self.commit_location)
|
||||||
|
|
||||||
def __do_remove(self, handle, transaction, data_map, key):
|
def __do_remove(self, handle, transaction, data_map, key):
|
||||||
if self.readonly or not handle:
|
if self.readonly or not handle:
|
||||||
return
|
return
|
||||||
@@ -1470,6 +1588,14 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
self.__do_remove(handle, transaction, self.tag_map,
|
self.__do_remove(handle, transaction, self.tag_map,
|
||||||
TAG_KEY)
|
TAG_KEY)
|
||||||
|
|
||||||
|
def remove_location(self, handle, transaction):
|
||||||
|
"""
|
||||||
|
Remove the Location specified by the database handle from the
|
||||||
|
database, preserving the change in the passed transaction.
|
||||||
|
"""
|
||||||
|
self.__do_remove(handle, transaction, self.location_map,
|
||||||
|
LOCATION_KEY)
|
||||||
|
|
||||||
@catch_db_error
|
@catch_db_error
|
||||||
def set_name_group_mapping(self, name, group):
|
def set_name_group_mapping(self, name, group):
|
||||||
if not self.readonly:
|
if not self.readonly:
|
||||||
@@ -1488,7 +1614,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
self.emit('person-groupname-rebuild', (name, grouppar))
|
self.emit('person-groupname-rebuild', (name, grouppar))
|
||||||
|
|
||||||
def sort_surname_list(self):
|
def sort_surname_list(self):
|
||||||
self.surname_list.sort(key=conv_unicode_tosrtkey)
|
self.surname_list.sort(key=glocale.sort_key)
|
||||||
|
|
||||||
@catch_db_error
|
@catch_db_error
|
||||||
def build_surname_list(self):
|
def build_surname_list(self):
|
||||||
@@ -1500,7 +1626,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
#TODO GTK3: Why double conversion? Convert to a list of str objects!
|
#TODO GTK3: Why double conversion? Convert to a list of str objects!
|
||||||
self.surname_list = sorted(
|
self.surname_list = sorted(
|
||||||
map(conv_dbstr_to_unicode, set(self.surnames.keys())),
|
map(conv_dbstr_to_unicode, set(self.surnames.keys())),
|
||||||
key=conv_unicode_tosrtkey)
|
key=glocale.sort_key)
|
||||||
|
|
||||||
def add_to_surname_list(self, person, batch_transaction):
|
def add_to_surname_list(self, person, batch_transaction):
|
||||||
"""
|
"""
|
||||||
@@ -1790,6 +1916,14 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
self.commit_base(tag, self.tag_map, TAG_KEY,
|
self.commit_base(tag, self.tag_map, TAG_KEY,
|
||||||
transaction, change_time)
|
transaction, change_time)
|
||||||
|
|
||||||
|
def commit_location(self, location, transaction, change_time=None):
|
||||||
|
"""
|
||||||
|
Commit the specified Location to the database, storing the changes as
|
||||||
|
part of the transaction.
|
||||||
|
"""
|
||||||
|
self.commit_base(location, self.location_map, LOCATION_KEY,
|
||||||
|
transaction, change_time)
|
||||||
|
|
||||||
def get_from_handle(self, handle, class_type, data_map):
|
def get_from_handle(self, handle, class_type, data_map):
|
||||||
if isinstance(handle, UNITYPE):
|
if isinstance(handle, UNITYPE):
|
||||||
handle = handle.encode('utf-8')
|
handle = handle.encode('utf-8')
|
||||||
@@ -1895,10 +2029,10 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
"""
|
"""
|
||||||
if (obj_type, trans_type) in transaction:
|
if (obj_type, trans_type) in transaction:
|
||||||
if trans_type == TXNDEL:
|
if trans_type == TXNDEL:
|
||||||
handles = [handle for handle, data in
|
handles = [handle2internal(handle) for handle, data in
|
||||||
transaction[(obj_type, trans_type)]]
|
transaction[(obj_type, trans_type)]]
|
||||||
else:
|
else:
|
||||||
handles = [handle for handle, data in
|
handles = [handle2internal(handle) for handle, data in
|
||||||
transaction[(obj_type, trans_type)]
|
transaction[(obj_type, trans_type)]
|
||||||
if (handle, None) not in transaction[(obj_type,
|
if (handle, None) not in transaction[(obj_type,
|
||||||
TXNDEL)]]
|
TXNDEL)]]
|
||||||
@@ -1994,6 +2128,10 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
upgrade.gramps_upgrade_15(self)
|
upgrade.gramps_upgrade_15(self)
|
||||||
if version < 16:
|
if version < 16:
|
||||||
upgrade.gramps_upgrade_16(self)
|
upgrade.gramps_upgrade_16(self)
|
||||||
|
if version < 17:
|
||||||
|
upgrade.gramps_upgrade_17(self)
|
||||||
|
if version < 18:
|
||||||
|
upgrade.gramps_upgrade_18(self)
|
||||||
|
|
||||||
self.reset()
|
self.reset()
|
||||||
self.set_total(6)
|
self.set_total(6)
|
||||||
|
@@ -53,8 +53,11 @@ Specific symbols for parts of a name are defined:
|
|||||||
# Python modules
|
# Python modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from ..ggettext import sgettext as _
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().sgettext
|
||||||
import re
|
import re
|
||||||
|
import logging
|
||||||
|
LOG = logging.getLogger(".gramps.gen")
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@@ -1047,8 +1050,17 @@ def fn(%s):
|
|||||||
else:
|
else:
|
||||||
return p + str + s
|
return p + str + s
|
||||||
return cleanup_name("%s" %% (%s))""" % (args, new_fmt, ",".join(param))
|
return cleanup_name("%s" %% (%s))""" % (args, new_fmt, ",".join(param))
|
||||||
exec(s)
|
try:
|
||||||
|
exec(s) in globals(), locals()
|
||||||
return locals()['fn']
|
return locals()['fn']
|
||||||
|
except:
|
||||||
|
LOG.error("\n" + 'Wrong name format string %s' % new_fmt
|
||||||
|
+"\n" + ("ERROR, Edit Name format in Preferences->Display to correct")
|
||||||
|
+"\n" + _('Wrong name format string %s') % new_fmt
|
||||||
|
+"\n" + ("ERROR, Edit Name format in Preferences->Display to correct")
|
||||||
|
)
|
||||||
|
def errfn(*arg):
|
||||||
|
return _("ERROR, Edit Name format in Preferences")
|
||||||
|
return errfn
|
||||||
|
|
||||||
displayer = NameDisplay()
|
displayer = NameDisplay()
|
||||||
|
@@ -40,6 +40,7 @@ import collections
|
|||||||
from ._filterparser import FilterParser
|
from ._filterparser import FilterParser
|
||||||
from ..plug import BasePluginManager
|
from ..plug import BasePluginManager
|
||||||
from ..constfunc import STRTYPE
|
from ..constfunc import STRTYPE
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
|
||||||
PLUGMAN = BasePluginManager.get_instance()
|
PLUGMAN = BasePluginManager.get_instance()
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@@ -111,6 +112,7 @@ class FilterList(object):
|
|||||||
parser.parse(the_file)
|
parser.parse(the_file)
|
||||||
the_file.close()
|
the_file.close()
|
||||||
except (IOError, OSError):
|
except (IOError, OSError):
|
||||||
|
print("IO/OSError in _filterlist.py")
|
||||||
pass
|
pass
|
||||||
except SAXParseException:
|
except SAXParseException:
|
||||||
print("Parser error")
|
print("Parser error")
|
||||||
@@ -123,7 +125,7 @@ class FilterList(object):
|
|||||||
return l.replace('"', '"')
|
return l.replace('"', '"')
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
f = open(self.file.encode(sys.getfilesystemencoding()), 'w')
|
f = open(self.file.encode(glocale.getfilesystemencoding()), 'w')
|
||||||
f.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
|
f.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
|
||||||
f.write('<filters>\n')
|
f.write('<filters>\n')
|
||||||
for namespace in self.filter_namespaces:
|
for namespace in self.filter_namespaces:
|
||||||
|
@@ -28,7 +28,8 @@
|
|||||||
from __future__ import print_function, unicode_literals
|
from __future__ import print_function, unicode_literals
|
||||||
|
|
||||||
from xml.sax import handler
|
from xml.sax import handler
|
||||||
from ..ggettext import gettext as _
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@@ -26,7 +26,8 @@
|
|||||||
# Standard Python modules
|
# Standard Python modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from ...ggettext import gettext as _
|
from ...const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
@@ -25,7 +25,8 @@
|
|||||||
# Standard Python modules
|
# Standard Python modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from ...ggettext import gettext as _
|
from ...const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.get_translation().gettext
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user