Compare commits

..

45 Commits

Author SHA1 Message Date
romjerome fe0f125ad6 test if 'lmodern' exists 2019-12-14 19:10:51 +01:00
romjerome e8b63987ac pylint ... 2019-12-14 19:04:48 +01:00
romjerome 461ee4fe5c pylint 2019-12-14 18:55:39 +01:00
romjerome d571516212 better variable name for lang 2019-12-09 20:53:24 +01:00
romjerome 9208b8a3a8 polish, use LATIN group 2019-12-07 09:06:06 +01:00
romjerome 9e013f6781 do not need to load 'lmodern' every time 2019-12-07 09:00:54 +01:00
romjerome c460506e4f Need 'lmodern' for some non-ASCII char 2019-12-07 08:56:12 +01:00
romjerome 3fcb9411dc typo 2019-12-07 08:41:54 +01:00
romjerome f7a50a0e74 limit locale set to supported lang (genealogytree) 2019-12-07 08:39:42 +01:00
romjerome 6709d37526 fix issues around localization
* specific non-ASCII characters related to our locale are not displayed on PDF
* date cannot be parsed (one calendar format and in english)
genealogytree macro needs a lang set in english
2019-12-06 22:49:37 +01:00
Paulo Henrique Moraes fc9e5c2a4a Updated translation. (#952) 2019-11-27 11:51:50 -06:00
prculley e3eedb2219 Merge branch 'gramps51' 2019-11-08 11:46:40 -06:00
Nick Hall f5861169fe Merge pull request #908 from SNoiraud:FR11336
New narrative web and web calendar features:

* Allow urls in the user's css files
* Allow alternate stylesheets in pages for narrative web and webcal
* Webcal: incorrect results when divorce event.
* Some pylint improvements

Resolves #11336.
2019-10-05 18:10:45 +01:00
SNoiraud 4e2f98da02 Better score for pylint 2019-10-05 18:05:21 +01:00
SNoiraud 95a0216287 Duplicate marriage 2019-10-05 18:05:21 +01:00
SNoiraud 03fb2ff1c2 Incorrect results when divorce event 2019-10-05 18:05:15 +01:00
SNoiraud 17141a0536 Add alternate stylesheets 2019-10-05 18:03:03 +01:00
SNoiraud 528852b9b3 Allow alternate stylesheets in pages
Useful when you create a site web, you don't need to create a new
web when you are testing the stylesheets. The final user can change
the stylesheet for the current page.

i.e. on Firefox: View -> Page style -> The stylesheet
2019-10-05 18:02:51 +01:00
SNoiraud 0de286e7a8 Allow urls for images in user css files 2019-10-05 17:59:17 +01:00
SNoiraud 7979bf79fd Better code quality for within area rule 2019-10-05 17:28:21 +01:00
Nick Hall 7100c51a31 Merge pull request #903 from prculley:deprecations 2019-10-05 17:22:19 +01:00
prculley 57f7502105 Fix deprecation of Gtk positional arguments 2019-10-05 17:17:54 +01:00
prculley 0f925a86f5 Fix Gtk deprecation Menu.set_title 2019-10-05 17:17:54 +01:00
prculley 17f4d93363 Fix Gtk deprecatioon ScrolledWindow.add_with_viewport 2019-10-05 17:17:54 +01:00
prculley cea48b618f Fix GObject.PARAM_READWRITE deprecation 2019-10-05 17:17:54 +01:00
prculley 290d6f7287 Fix deprecation GObject.GError -> GLib.GError 2019-10-05 17:17:54 +01:00
prculley 4d0e86a2e8 Fix Gtk deprecation Widget.reparent 2019-10-05 17:17:54 +01:00
prculley 831c7f9c66 Fix Gtk deprecation Widget.set_padding 2019-10-05 17:17:54 +01:00
prculley 702e51dd47 Fix deprecation on Gtk.Widget.override_font and modify_font 2019-10-05 17:17:54 +01:00
Jonas Hahnfeld f3555d0168 Add new graph output format to the tree document generator
The "graph" is the data part for genealogytree without the boilerplate
code around it that makes up a full LaTeX file. This format is useful
for people who have their own (more sophisticated) LaTeX file with
custom styles and so on.
The implementation is pretty straight-forward: Just don't output the
LaTeX code.
2019-10-05 17:05:38 +01:00
Matthias Kemmer bedc4b8e74 Add a new person filter rule 'HasAddressText' 2019-10-04 21:07:52 +01:00
Matthias Kemmer 8a8a21f85d Add date format option for 'numeric date with leading zeros' 2019-10-04 19:59:54 +01:00
Nick Hall c7350c53e2 Remove irrelevant comment 2019-10-04 19:54:00 +01:00
Fredrik Lindseth 52e76b506a Add descriptions to decendant tree report styles 2019-10-04 19:18:16 +01:00
Matthias Kemmer ab52d0988e Remove tag from selected rows 2019-10-03 21:28:33 +01:00
Matthias Kemmer 5935a315b2 Add 'HasAttribute' filter rule to repositories, sources and citations
Fixes #9845
2019-10-03 21:05:14 +01:00
prculley 1eaa609058 Get BetaWarning correct for master 2019-09-16 11:13:08 -05:00
prculley 5f0c2c1c54 Set Beta warning to True 2019-09-16 11:02:03 -05:00
prculley 6d39920e6f Merge branch 'gramps51' 2019-09-16 10:54:55 -05:00
prculley 4859c14aaa Fix typo in merge 2019-08-12 16:58:55 -05:00
prculley f4a8f21032 Merge from gramps51 2019-08-09 09:06:42 -05:00
prculley e894c4478f Some pylint cleanups 2019-08-09 08:55:05 -05:00
romjerome 56afb5bca9 Add missing 'get_number_of_citations' method (#859)
* Add missing 'get_number_of_citations' method

* update db test for bsddb

* fix trailing whitespace

* typo
2019-08-07 13:47:09 -05:00
SNoiraud 9da8f705f6 Narrative web: Add popup to manage markers
If you click on a marker in the family map page, you get a popup.
In this popup associated with a place, if you have several events,
for each event you see the person and the event type.
If you click on the person, you go to the related page for this person.
If you click on the event type, you go to the related page for this event.

Fixes #11150
2019-07-07 19:25:42 +02:00
SNoiraud ce4cd33139 Narrative web: Add Stamen map
Fixes #05984
2019-07-07 19:24:44 +02:00
266 changed files with 88774 additions and 91828 deletions
-77
View File
@@ -1,77 +0,0 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2022 Nick Hall
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
name: Gramps CI
on:
push:
branches: [ maintenance/gramps51 ]
pull_request:
branches: [ maintenance/gramps51 ]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install gir1.2-pango-1.0
sudo apt-get install gir1.2-gtk-3.0
sudo apt-get install xdg-utils
sudo apt-get install librsvg2-common
sudo apt-get install libglib2.0-dev
sudo apt-get install intltool
sudo apt-get install python3-gi
sudo apt-get install python3-cairo
sudo apt-get install python3-gi-cairo
sudo apt-get install python3-bsddb3
sudo apt-get install python3-dev
sudo apt-get install python3-nose
sudo apt-get install python3-mock
sudo apt-get install python3-icu
sudo apt-get install python3-coverage
sudo apt-get install python3-jsonschema
sudo apt-get install libxml2-utils
sudo apt-get install python3-lxml
sudo apt-get install python-libxml2
sudo apt-get install zlib1g-dev
sudo apt-get install python3-setuptools
- name: Install addons
run: |
mkdir -p ~/.gramps/gramps51/plugins/
wget https://github.com/gramps-project/addons/raw/master/gramps51/download/CliMerge.addon.tgz
tar -C ~/.gramps/gramps51/plugins -xzf CliMerge.addon.tgz
wget https://github.com/gramps-project/addons/raw/master/gramps51/download/ExportRaw.addon.tgz
tar -C ~/.gramps/gramps51/plugins -xzf ExportRaw.addon.tgz
- name: Build
run: |
python3 setup.py build
- name: Run unit test suite
run: |
python3 setup.py test
- name: Trailing whitespace check
run: |
if git --no-pager grep --color -n --full-name '[ ]$' -- \*.py; then
echo "ERROR - Trailing whitespace found in source file(s)";
exit 1;
fi
+129
View File
@@ -0,0 +1,129 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2015-2015 Doug Blank
# Copyright (C) 2016 DaAwesomeP
# Copyright (C) 2016 QuLogic
# Copyright (C) 2016 Tim G L Lyons
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# After changing this file, check it on:
# http://lint.travis-ci.org/
sudo: required
dist: trusty
language: python
python:
- 3.3 # This is irrelevant, because the virtualenv is not used at all
# FIXME: The minimum requirement for Gramps is Python 3.2, so a test environment
# for Python 3.2 should be added to this environment which is Python 3.3. It
# will not be possible to run coverage under Python 3.2, because coverage is
# Python 3.3 (or above) only.
addons:
apt:
packages:
- gir1.2-pango-1.0
- gir1.2-gtk-3.0
- xdg-utils
- librsvg2-common
- libglib2.0-dev
- intltool
# - python3-gobject Provided by python3-gi
- python3-gi
- python3-cairo
- python3-gi-cairo
- python3-bsddb3
- python3-dev
- python3-nose
- python3-mock
- python3-pyicu
- python3-coverage
- python3-jsonschema
# lxml dependencies. for merge_ref_test to work
# - libxml2-dev
# - libxslt1-dev
- libxml2-utils
- python3-lxml
- python-libxml2
# ubuntu 14.04 requires this in addition to libxml2-dev and
# libxslt1-dev for compiling lxml.
# https://github.com/deanmalmgren/textract/issues/19
- zlib1g-dev
before_install:
install:
# The working directory is set to /home/travis/build/gramps-project/gramps
# by the automatic git checkout.
# Download Sean Ross-Ross's Pure Python module containing a framework to
# manipulate and analyze python asts and bytecode. This is loaded to
# /home/travis/build/gramps-project/gramps/meta
# FIXME: This should be loaded from the release directory at
# https://pypi.python.org/pypi/meta
- git clone -b master https://github.com/srossross/meta
# Build Gramps package. This seems to copy everything to
# /home/travis/build/scripts-3.3
- python setup.py build
before_script:
# Create the Gramps database directory.
- mkdir -p ~/.gramps/grampsdb/
# set PYTHONPATH so the directly installed module (meta) is picked up from
# /home/travis/build/gramps-project/gramps/meta
- export PYTHONPATH=meta
# set module exclusions. --exclude=TestUser because of older version of mock
# without configure_mock
- export EXCLUDE="--exclude=TestcaseGenerator"
# --exclude=merge_ref_test"
# set GRAMPS_RESOURCES for locale, data,image and documentation
- export GRAMPS_RESOURCES=.
# Install addons
- mkdir -p ~/.gramps/gramps51/plugins/
- wget https://github.com/gramps-project/addons/raw/master/gramps51/download/CliMerge.addon.tgz
- tar -C ~/.gramps/gramps51/plugins -xzf CliMerge.addon.tgz
- wget https://github.com/gramps-project/addons/raw/master/gramps51/download/ExportRaw.addon.tgz
- tar -C ~/.gramps/gramps51/plugins -xzf ExportRaw.addon.tgz
script:
# Ignore the virtualenv entirely. Use nosetests3, python3 (3.4.0) and coverage
# from /usr/bin. Use libraries from /usr/lib/python3.4,
# /usr/local/lib/python3.4/dist-packages and /usr/lib/python3/dist-packages
- nosetests3 --nologcapture --with-coverage --cover-package=gramps $EXCLUDE
gramps
# FIXME: This should have run from the current directory, rather than from
# gramps, because there is some test code in that directory.
# give an error for any trailing whitespace
- if git --no-pager grep --color -n --full-name '[ ]$' -- \*.py; then
echo "ERROR - Trailing whitespace found in source file(s)";
exit 1;
fi
after_success:
# apt-get installs python3-coverage, but codecov only invokes coverage, so make
# a link
- sudo ln /usr/bin/python3-coverage /usr/bin/coverage
# We have to use the bash script because the apt-get coverage does not install
# codecov. If we used pip to install codecov, it would run inside the
# virtualenv, and that doesn't work. Change the path to ensure that codecov
# picks up coverage from /usr/bin, rather than from
# /home/travis/virtualenv/python3.3.6/bin/
- PATH=/usr/bin:$PATH bash <(curl -s https://codecov.io/bash)
+217 -114
View File
@@ -1,174 +1,277 @@
2023-06-29 Nick Hall <nick-h@gramps-project.org>
2019-09-14 SNoiraud <Serge.Noiraud@free.fr>
* docs/conf.py, gramps/gen/const.py: Update copyright date
* gramps/gen/filters/rules/place/_withinarea.py: Fix deprecation
warning in withinarea rule
2023-05-13 SNoiraud <Serge.Noiraud@free.fr>
2019-09-14 Nick Hall <nick-h@gramps-project.org>
* gramps/plugins/webreport/media.py: Narrative web: problem with
small pictures. Fixes #012884
* gramps/gui/grampsgui.py: Disable development warning message
2023-05-09 SNoiraud <Serge.Noiraud@free.fr>
2019-09-13 Jonas Hahnfeld <hahnjo@hahnjo.de>
* gramps/plugins/view/familyview.py: Implement the "<CTRL>J" for the
family view Fixes #012882
* gramps/gen/plug/docgen/treedoc.py: Add options to sandclock in
tree document generator This works and is actually needed to style the root node.
2022-07-11 Jon Schewe <jpschewe@mtu.net>
2019-09-11 SNoiraud <Serge.Noiraud@free.fr>
* gramps/plugins/webreport/basepage.py: Avoid application crash on
invalid user input If the user inputs an invalid date this change keeps the application
from crashing when such a date is found. The invalid date
information is reported to the user in the log. Fixes #12658.
* gramps/gui/filters/sidebar/_personsidebarfilter.py: Using regex in
the sidebar gives different result from previous gramps release. Fixes #11321
2023-05-13 Nick Hall <nick-h@gramps-project.org>
2019-09-12 Jérôme Rapinat <romjerome@yahoo.fr>
* gramps/plugins/export/exportgedcom.py: Fix export where private
citations are excluded
* po/fr.po: Add missing French translation strings
2022-06-01 prculley <paulr2787@gmail.com>
2019-09-10 Gil da Costa <gdacosta@sommier-colas.fr>
* gramps/plugins/tool/eventcmp.py: Fix Event compare tool to display
enclosed places properly
* po/fr.po: Update French translation
2022-06-08 SNoiraud <Serge.Noiraud@free.fr>
2019-09-09 prculley <paulr2787@gmail.com>
* gramps/gui/viewmanager.py: Check that view exists before calling
post_create method Avoids 'NoneType' object has no attribute 'post_create' error. Fixes #12638
* gramps/plugins/docgen/odfdoc.py: Fix odt output when db owner has
XML unfriendly chars ('&') Fixes #11327
2022-06-15 Jingxuan He <LostBenjamin@users.noreply.github.com>
2019-09-11 John Bickmore <johnbickmore@users.noreply.github.com>
* gramps/plugins/webreport/webcal.py: Fix a wrong operator bug in
the web calendar report
* README.md: Bump required Python version to 3.3 on Readme As mentioned on the release announcement
2022-10-08 Himanshu Gohel <1551217+hgohel@users.noreply.github.com>
https://gramps-project.org/introduction-WP/2019/08/gramps-5-1-0-released/
* gramps/gen/plug/docgen/treedoc.py: Revert "Enclose tree report
image path and file name in braces" Fixes #12437 by reverting commit
75921ceaf40f3ced597d99c43794b98f81e49957 due to reports of
regression where processing of the generated TeX file fails due to
bad path specificiation for image files. Change was introduced in bug fix for #10495. Bugs #12437 and #12697 reported the regression and confirmed that
reverting the change fixes the regression.
2019-09-08 SNoiraud <Serge.Noiraud@free.fr>
2022-10-22 SNoiraud <Serge.Noiraud@free.fr>
* gramps/plugins/webreport/narrativeweb.py: Remove
reload_custom_filters to conform to PR894
* gramps/plugins/lib/maps/geography.py: Geography View: Fix number
of arguments in add_bookmark method add_bookmark() takes 2 positional arguments but 3 were given Fixes #12718
2019-09-07 prculley <paulr2787@gmail.com>
2022-12-08 GaryGriffin <genealogy@garygriffin.net>
* gramps/cli/grampscli.py: Fix CLI crash when generating reports Fixes #11318, #11213
* gramps/plugins/lib/libsubstkeyword.py: Use date-specific place in
report substitution variables Fix place title in graphical reports which have user-defined display
formats to use date-specific alternate name. This impacts Ancestor Tree, Descendant Tree, and Family Descendant
Tree. Fixes #12763.
2019-09-06 prculley <paulr2787@gmail.com>
2022-12-27 John Ralls <jralls@ceridwen.us>
* gramps/gui/views/listview.py: Fix Statusbar HandleError on merge
families Fixes #11320, #11294, #11279
* gramps/grampsapp.py, gramps/gui/aboutdialog.py,
gramps/gui/logger/_errorreportassistant.py,
gramps/plugins/db/bsddb/bsddbtxn.py,
gramps/plugins/db/bsddb/cursor.py, gramps/plugins/db/bsddb/read.py,
gramps/plugins/db/bsddb/summary.py,
gramps/plugins/db/bsddb/test/cursor_test.py,
gramps/plugins/db/bsddb/undoredo.py,
gramps/plugins/db/bsddb/upgrade.py,
gramps/plugins/db/bsddb/write.py, gramps/plugins/gramplet/leak.py,
mac/patches/gramps-berkeleydb.patch: Try to import berkeleydb if
bsddb3 isn't found. berkelydb is usable for python >= 3.6 and required for python >=
3.10. See https://www.jcea.es/programacion/pybsddb.htm.
2019-09-12 Avi Markovitz <avi.markovitz@gmail.com>
2023-02-12 Vincent Smeets <Vincent.VSmeets@GMail.com>
* po/he.po: Update Hebrew translation
* gramps/plugins/docgen/htmldoc.py: HtmlDoc: Create a unique
filename for cropped images
2019-09-12 Matti Niemelä <matti.u.niemela@gmail.com>
2022-10-24 D.A.Lordemann <LordemannD@gmail.com>
* po/fi.po: Fix translation in Finnish
* gramps/plugins/export/exportgedcom.py: Fix corrupted NOTE tag in
Gedcom export Remove Python2 code obsoleted by Python3, which was corrupting
GEDCOM export of Gramps Notes text that includes multi-byte utf-8
characters. Fixes #12709.
2019-09-12 Matti Niemelä <matti.u.niemela@gmail.com>
2022-09-27 SNoiraud <Serge.Noiraud@free.fr>
* po/fi.po: Update finnish translation
* gramps/gui/viewmanager.py: Fix IndexError that sometimes occurs
when changing view This occurs when restarting Gramps. Fixes #12636, #12304, #12429, #12623, #12695.
2019-09-11 vantu5z <vantu5z@mail.ru>
2023-03-18 SNoiraud <Serge.Noiraud@free.fr>
* po/ru.po: update Russian translation
* gramps/gen/proxy/referencedbyselection.py,
gramps/gui/widgets/styledtexteditor.py,
gramps/plugins/lib/libhtmlbackend.py: Fix crash when invalid note
link Fixes #012854
2019-09-10 pehlm <par.ekholm@pekholm.org>
2023-04-17 SNoiraud <Serge.Noiraud@free.fr>
* po/sv.po: Update Swedish translation
* gramps/gui/utils.py: Tags with color names don't work in pedigree
views Color tags work correctly in all views except in pedigree views.
These views modify colors: ... context.set_source_rgba(*(self.bordercolor[:3] + (0.4,))) ... and context.set_source_rgb(*self.bgcolor[:3]) As it works everywhere except in these views, I think it is a bug
even if we cannot enter color names in tags Fixes #012866
2019-09-10 Mirko Leonhaeuser <mirko@leonhaeuser.de>
2023-04-05 SNoiraud <Serge.Noiraud@free.fr>
* po/de.po: Update German translation
* gramps/gui/views/treemodels/eventmodel.py: Crash when invalid
event date
2019-09-10 Nick Hall <nick-h@gramps-project.org>
2023-04-04 SNoiraud <Serge.Noiraud@free.fr>
* po/ar.po, po/bg.po, po/br.po, po/ca.po, po/cs.po, po/da.po,
po/de.po, po/el.po, po/en_GB.po, po/eo.po, po/es.po, po/fi.po,
po/fr.po, po/ga.po, po/he.po, po/hr.po, po/hu.po, po/is.po,
po/it.po, po/ja.po, po/lt.po, po/mk.po, po/nb.po, po/nl.po,
po/nn.po, po/pl.po, po/pt_BR.po, po/pt_PT.po, po/ro.po, po/ru.po,
po/sk.po, po/sl.po, po/sq.po, po/sr.po, po/sr_Latn.po, po/sv.po,
po/ta.po, po/tr.po, po/uk.po, po/vi.po, po/zh_CN.po, po/zh_HK.po,
po/zh_TW.po: Merge po files and new template
* gramps/gui/listmodel.py: ListModel: Only the first level is
managed When we use checkboxes in columns. The path was converted to int.
Why ? But when we have multiple level, the path format is "x:y" for
two levels, "x:y:z" for three levels, etc
2019-09-10 Nick Hall <nick-h@gramps-project.org>
2023-03-07 Nick Hall <nick-h@gramps-project.org>
* po/gramps.pot: Update translation template for new release
* .github/workflows/gramps-ci.yml: Update Gramps CI workflow to run
on Ubuntu 20.04 Ubuntu 18.04 became fully unsupported on 1 Dec 2022.
2019-08-27 Avi Markovitz <avi.markovitz@gmail.com>
2022-12-27 John Ralls <jralls@ceridwen.us>
* po/he.po: Update Hebrew translation
* mac/gramps.modules: mac: Patch bsddb to use berkeleydb instead of
bsddb3 module.
2019-07-11 Pedro Albuquerque <palbuquerque73@gmail.com>
2022-12-27 John Ralls <jralls@ceridwen.us>
* po/pt_PT.po: Update Portuguese (Europe) translation
* mac/gramps.modules, mac/patches/berkeleydb-4.8-mutex.patch: Mac
build: Patch berkeleydb configure to work on Apple Silicon.
2019-06-24 Milo Ivir <mail@milotype.de>
2022-12-26 John Ralls <jralls@ceridwen.us>
* po/hr.po: Update croatian translation - update with newest/current .pot file - translation is complete - corrections in wording and some missing accelerators
* mac/gramps.modules: [mac] Update Exiv2 download URL, moved to
github.
2019-09-02 prculley <paulr2787@gmail.com>
2022-12-24 John Ralls <jralls@ceridwen.us>
* gramps/gui/widgets/styledtexteditor.py: Fix missing tooltip
translations in the Note editor toolbar Fixes #11289
* mac/Info.plist, mac/gramps.bundle, mac/gramps.modules: Repackage
Gramps 5.1.5 with Gtk updates fixing use on macOS 13 Ventura.
2019-09-01 SNoiraud <Serge.Noiraud@free.fr>
2022-03-08 Nick Hall <nick-h@gramps-project.org>
* gramps/gen/filters/rules/place/_withinarea.py: Avoid bad
coordinates in the ref place
* gramps/plugins/lib/librecords.py: Fix spouse's name and underlined
call names in records Fixes #12391
2019-08-28 SNoiraud <Serge.Noiraud@free.fr>
2022-03-16 Nick Hall <nick-h@gramps-project.org>
* gramps/gen/filters/rules/place/_withinarea.py: Avoid alphabetic
characters in filter rules
* .github/workflows/gramps-ci.yml: Fix package installation failures
in CI
2019-08-23 SNoiraud <Serge.Noiraud@free.fr>
2019-12-09 Sam Manzi <manzi.sam@gmail.com>
* gramps/gen/filters/rules/place/_withinarea.py: Could not convert
string to float by using withinarea filter rule + difference between sidebar filter
and filter rule + some pylint improvements
* gramps/gen/utils/grampslocale.py: Update INCOMPLETE_TRANSLATIONS * Remove: he * Add: zh_HK, zh_TW
2019-08-31 prculley <paulr2787@gmail.com>
2022-02-12 Ross Gammon <rossgammon@debian.org>
* gramps/gen/plug/docgen/graphdoc.py: Fix Graph outputs for multiple
page PDF Postscript Fixes #11305
* debian/changelog, debian/copyright,
debian/patches/fix-probably_alive_test.patch, debian/patches/series:
Update Debian folder after 5.1.5 release
2019-08-31 prculley <paulr2787@gmail.com>
2022-02-05 John Ralls <jralls@ceridwen.us>
* gramps/gen/plug/_pluginreg.py, gramps/gui/managedwindow.py,
gramps/gui/plug/quick/_quickreports.py, gramps/gui/uimanager.py,
gramps/gui/viewmanager.py, gramps/gui/views/tags.py,
gramps/gui/widgets/grampletpane.py: Fix to make Gtk 'action names'
always valid Fixes #11291
* mac/Info.plist, mac/gramps.modules: Package Gramps 5.1.5 for
macOS.
2019-08-31 prculley <paulr2787@gmail.com>
2022-02-05 Nick Hall <nick-h@gramps-project.org>
* gramps/gui/uimanager.py, gramps/gui/views/tags.py: Fix missing
menus/buttons when operating in non-English languages Fixes #11292
* Bump to 5.1.6
2019-08-31 SNoiraud <Serge.Noiraud@free.fr>
* gramps/gui/widgets/validatedmaskedentry.py: Cursor position error
in lat and long fields Fixes #11310
2019-08-30 SNoiraud <Serge.Noiraud@free.fr>
* gramps/plugins/tool/removespaces.py: Avoid all characters looking
like a dash hyphen non breaking hyphen figure dash em dash horizontal bar Fixes #11308
2019-08-30 SNoiraud <Serge.Noiraud@free.fr>
* data/css/Web_Mainz.css: Narrative web: Mainz Style sheet weird
looking Fixes #11282
2019-09-02 SNoiraud <Serge.Noiraud@free.fr>
* gramps/plugins/view/relview.py: Set symbols for the active person
2019-08-28 SNoiraud <Serge.Noiraud@free.fr>
* gramps/plugins/view/relview.py: Set good symbols for marriage,
baptism, cremation and burial
2019-08-28 SNoiraud <Serge.Noiraud@free.fr>
* gramps/plugins/view/relview.py: Reduce the size of the sexuality
symbol in relview Fixes #11295
2019-08-28 prculley <paulr2787@gmail.com>
* gramps/gui/widgets/styledtexteditor.py: Fix exception when editing
Note with italics/bold etc. in non English Fixes #11284
2019-08-27 Nick Hall <nick-h@gramps-project.org>
* gramps/gui/views/pageview.py: Restore keybindings for gramplet
bars Resolves #11297.
2019-08-27 Nick Hall <nick-h@gramps-project.org>
* gramps/gui/plug/quick/_quickreports.py: Fix bug in web connection
menu launching incorrect web site Resolves #11280.
2019-08-26 SNoiraud <Serge.Noiraud@free.fr>
* gramps/gui/autocomp.py: Translation problem when creating event
filter If you create a filter with the rule name: "Events with a particular type" or "Events with <data>" The menu "Travel", "Academic"... are not
translated Fixes #11293
2019-08-26 SNoiraud <Serge.Noiraud@free.fr>
* gramps/gui/configure.py, gramps/gui/widgets/grampletbar.py: Error
when checking option to add Quit to Taskbar Fixes #11290
2019-08-25 SNoiraud <Serge.Noiraud@free.fr>
* gramps/plugins/webreport/narrativeweb.py,
gramps/plugins/webreport/person.py: Make the narratives notes
placement an option From 5.1 the narrative notes are placed just after the name, gender
and age at death. This follow the feature request #6772. Some
people want to have this placement an option to have the same
functionality as before Fixes #11283
2019-08-24 Ross Gammon <rossgammon@mail.dk>
* debian/changelog: Finalise Debian changelog for 5.1.0 release
2019-08-24 Ross Gammon <rossgammon@mail.dk>
* debian/control: Bump gtk+ version to 3.12 & add
gir1.2-geocodeglib-1.0 dependency
2019-08-24 Ross Gammon <rossgammon@mail.dk>
* debian/copyright: Update copyrights
2019-08-24 Ross Gammon <rossgammon@mail.dk>
* debian/changelog, debian/control: Merge last 5.0.2 debian release
information into 51 maintenance branch
2019-08-23 Sebastian Schubert <schubert.seb@gmail.com>
* README.md: Add optional fontconfig package to README.md
2019-08-23 Sebastian Schubert <schubert.seb@gmail.com>
* NEWS: Fix typo in NEWS
2019-08-30 Zdeněk Hataš <zdenek.hatas@gmail.com>
* po/cs.po: Update Czech translation
2019-08-29 Zdeněk Hataš <zdenek.hatas@gmail.com>
* po/cs.po: Update Czech translation
2019-08-25 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* po/de.po: German translation updated
2019-08-24 John Ralls <jralls@ceridwen.us>
* mac/Info.plist, mac/gramps.modules: Release Gramps-5.1.0 on Mac.
2019-08-16 John Ralls <jralls@ceridwen.us>
* mac/release.entitlements.plist: An entitlements plist for
codesigning Gramps. Python is an interpreter and therefore needs to create executable
memory. Since it doesn't know how to sign that memory it requires
the allow-unsigned-executable-memory entitlement to run in a
hardened runtime. One must apply this entitlement to both Gramps.app
and Gramps.app/Contents/MacOS/dot when codesigning them.
2019-06-11 John Ralls <jralls@ceridwen.us>
* mac/gramps.modules: Fix graphviz and exiv2 download URLs.
2019-06-11 John Ralls <jralls@ceridwen.us>
* mac/gramps.modules: Update dependency versions and download paths.
2019-08-22 vantu5z <vantu5z@mail.ru>
* po/ru.po: update Russian translation
2019-08-22 pehlm <par.ekholm@pekholm.org>
* po/sv.po: Update Swedish translation with the new gramps.pot
2019-08-21 prculley <paulr2787@gmail.com>
* Bump to 5.1.1
-274
View File
@@ -1,277 +1,3 @@
2023-06-29
Version 5.1.6
* Update copyright date.
* Narrative web: problem with small pictures. Fixes #12884.
* Implement the "<CTRL>J" for the family view. Fixes #12882.
* Avoid application crash on invalid user input. If the user inputs an invalid
date this change keeps the application from crashing. The invalid date
information is reported to the user in the log. Fixes #12658.
* Fix export where private citations are excluded.
* Fix Event Compare tool to display enclosed places properly.
* Check that view exists before calling post_create method. Avoids 'NoneType'
object has no attribute 'post_create' error. Fixes #12638.
* Fix a wrong operator bug in the web calendar report.
* Revert "Enclose tree report image path and file name in braces" due to reports
of regression where processing of the generated TeX file fails due to bad path
specificiation for image files. Fixes #12437 and #12697.
* Geography View: Fix number of arguments in add_bookmark method. Fixes #12718.
* Use date-specific place in report substitution variables. Fix place title in
graphical reports which have user-defined display formats to use date-specific
alternate name. This impacts the Ancestor Tree, Descendant Tree, and Family
Descendant Tree reports. Fixes #12763.
* Try to import berkeleydb if bsddb3 isn't found. berkelydb is usable for
python >= 3.6 and required for python >= 3.10.
See https://www.jcea.es/programacion/pybsddb.htm.
* HtmlDoc: Create a unique filename for cropped images.
* Fix corrupted NOTE tag in Gedcom export. Remove Python2 code obsoleted by
Python3, which was corrupting Gedcom export of Gramps Notes text that includes
multi-byte utf-8 characters. Fixes #12709.
* Fix IndexError that sometimes occurs when changing view This occurs when
restarting Gramps. Fixes #12636, #12304, #12429, #12623, #12695.
* Fix crash when invalid note link. Fixes #12854.
* Fix tags with color names in pedigree views. Fixes #12866.
* Crash when invalid event date.
* ListModel: Fix multiple level paths when we use checkboxes in columns.
The path was previously converted to int.
* Update Gramps CI workflow to run on Ubuntu 20.04. Ubuntu 18.04 became fully
unsupported on 1 Dec 2022.
* Fix package installation failures in CI.
* Fix spouse's name and underlined call names in records. Fixes #12391.
* Update INCOMPLETE_TRANSLATIONS list. Remove: he, Add: zh_HK, zh_TW.
* Update Debian folder after 5.1.5 release.
* Mac:
* Patch bsddb to use berkeleydb instead of bsddb3 module.
* Patch berkeleydb configure to work on Apple Silicon.
* Update Exiv2 download URL, moved to github.
* Repackage Gramps 5.1.5 with Gtk updates fixing use on macOS 13 Ventura.
2022-02-05
Version 5.1.5
* Update translations: de, pl, sv, zh_CN.
* Remove Travis CI configuration.
* Fix badges in README file.
* Update copyright date.
* Strange behavior for the scrollbar in the bottombar. Fixes #12438.
* Fix place object element order in DTD and RNG schemas. Element placeobj
content does not follow the DTD and RNG, expecting (ptitle? , pname+).
Fixes #12500.
* Solve InterpolationSyntaxError if "%" in a string. The grampletpane module
saves data in a config file for all the gramplets added in the dashboard. The
python configparser module doesn't like if we have a "%" character in a string.
Fixes #12423.
* '<' not supported between 2 instances of IndexMark. Fixes #12467.
* Remove debug statements in unit tests.
* Fix negative Span when dates are not Gregorian. Fixes #12525.
* Incorrect grouping if no ma/patronymic surname.
* Group As override is ignored for ma/patronymic surnames. Fixes #12395.
See: https://gramps.discourse.group/t/patronymic-and-matronymic-name/1684/5
* Add comments for the lat-lon field of editplace.
* Place editor, lat and long text are swapped. Fixes #12374.
* Fix Statusbar progress being shown before use. Fixes #12373.
* Fix exception when removing a group name in Sqlite db when group name is
already missing. Fixes #12367.
* Fix error when trying to close name editor during long name group mapping
view rebuild. Fixes #12328.
* OsmGpsMap-CRITICAL: Map source setup called twice Fixes #12352.
* Fix probably alive function unit test.
* Use GitHub Actions to run continuous integration checks.
* Mac:
* Update Exiv2, PYExiv2, and json-glib.
* Repackage Gramps.app to work with macOS 12.
* Add entitlements path to bundle-file so Gramps.app is signed with it.
* Add python-fontconfig to the macOS build. Needed to enable using
genealogical symbols.
* Inlude fontconfig's etc/fonts in macOS app bundle. Graphviz now uses
fontconfig to find its fonts. Fixes #12370.
2021-07-26
Version 5.1.4
* Update translations: cs, de, es, fi, fr, hu, nl, pt_BR, ru, sv, zh_CN.
* Update copyright date.
* Fix probably alive if death without date.
* Place editor, copy and paste of lat and long text no longer
auto-populating latitude and longitude fields.
* Fix for crash when changing views if part of toolbar is not shown because
of a small screen when changing views.
* Fix bottombar always showing after restart, even when not wanted.
* Always use filtered collation names. Store the Sqlite3 collations in the
__collations array to short-circuit re-creation.
* Fix issue with German relation calculator fixed issue when more than 24
generations between the two people.
* Add file logging for macOS. When Gramps is launched from macOS's
LaunchServices it doesn't have a sys.stderr attached so the default stream
logger goes to /dev/null. Use a FileHandler in tht case, writing the log
to $TMPDIR/gramps-pid.log. This will help particularly in analyzing
crashes where python shuts down as there's no crash report in that case.
* Fix libplaceview to avoid exception when mapservice is no longer present.
* Fix References Gramplet for inadequate updates when other objects change.
* Fix geofamily crash if a family has no father.
* Home Person setting does not convey in a merge.
* Fix CSV export of view to only put single CR character.
* Add Media filter rule 'HasMedia' to list of media rules for editor.
* Need to set locale.textdomain under linux. _build_popup_ui() ignores
translated strings without locale.textdomain set.
* Change category of 'MatchesEventFilter'.
* Fix issue where separator between top and bottom bar of View creeps up.
* Fix Locations Gramplet (Enclosed by) to properly display certain nested
places when the smallest place has undated enclosure and larger places are
dated.
* Fix Family Tree Manager drop error on Windows.
* Fix exportvcalendar error is "is not" with a literal (Python 3.8 issue)
* Handle not found when copying source from the citation tree.
* Fix call to 'file' function, which doesn't exist in Python3.
* Fix write_lock_file exception when USERNAME is missing.
* Fix EditPlace so Tab key doesn't get stuck on Private icon.
* Fix Tag report for places that have a hierarchy.
* Fix exception when cancelling out of a db upgrade in GUI.
* Icon file changes:
* Install 128x128 and 256x256 application icons.
* Install MIME type icons into the hicolor theme.
* Remove gnome-mime- prefix from icon filenames.
* Install application icons into correct directories.
* Fix error in Birthday and Anniversary report. Fixes an error triggered
when the first person_handle in the list has a death event, but no birth
event and does not have family relationships. These conditions lead to
the local variable short_name not being declared before it comes time to
process death events.
* Fix graphdoc to properly escape characters in ids for Graphviz.
* Replace inspect.stack() with inspect.currentframe().
Works around https://bugs.python.org/issue12920 which causes every
call to inspect.trace() to fail because __main__ is always the
starting point.
* Fix crash sorting on columns in Selectors with TreeModels.
* Fix progress bar freeze due to changes in Gtk.
* Fix svgdrawdoc for text containing XML invalid characters.
* Mac:
* Update PyICU to 2.7.2 in macOS build.
* Update dependencies. Includes moving berkeleydb and pybsddb over from
gtk-osx.
* Further changes for bundling with Python 3.8.
* Set __file__ if gramps_launcher.py is run as __main__.
* Add geocode-glib to build.
2020-08-11
Version 5.1.3
* Update ca, de, fi, fr, ja, pl, ru, sl, sv, uk, zh_CN translation
* Events View: "Main Participants" column does not show the full list
of participants when expanded.
* mac/gramps.modules: Use current Gtk release instead of Gtk-3.14.
* mac/gramps.modules: Upgrade pymodules for Python 3.8 compatibility.
* Fix XML export when 'Group-as" name contains XML invalid chars
* Fix NarWeb: Province place-type is not displayed
* Fix ManagedWindow so that new windows don't appear offscreen when
system 'screen' sizes change in part time multi-monitor setups.
* Fix menus when db fails to open due to upgrade/downgrade etc.
* Fix issue with attach source tool, results panel
* Fix GEDCOM export; don't include ADDR when address is missing
* EditPlace: Allow Coordinates containing a comma instead of a period
* NarrativeWeb:
* Should show patronymic in individuals.
In the individuals and in surnames pages, we should show the
complete name like defined in the display tab from the narrative web
configuration.
* Fix Narrated Website Google Maps Output JS Warning SensorNotRequired
* Fix incorrect link type for osm css files
* Fix image size limit doesn't match tooltip
* Update all translations for changes from 'Default' to 'Home' Person
* Change GUI references to 'Home Person' instead of 'Default Person'
* Use event attribute types in the event reference editor.
In the event reference editor, custom event attribute types should
be used rather than the default person attribute types.
* Fix Verify tool bug caused by bad change in GObject introspection
* Fix RemoveUnused tool for crash caused by Gtk introspection bug
* Fix import test for change cause by previous change which was:
Fix GEDCOM import for bad source title when sources precede references.
* Fix GEDCOM import for bad source title when sources precede references.
* Fix some reports for CLI where warning message about Value not found
* Fix Genealogy Tree reports for crash in CLI
* Add uistate to tree views filter initialization
* Fix some Python syntax errors that appear in v3.8.x
* Suppress age = 0 days in events list. If the reference event date is equal
to the event date, don't show the age except if the date is estimated,
calculated, etc.
* Fix Dashboard Gramplets to update during db close when not shown
* Fix Windows GUI mode startup for crash with some languages
* Fix dbapi to support "Abandon Changes & Quit" feature
* Fix GrampsType for comparison bug with empty string as one value
* Fix Date Display so that it uses LC_TIME if defined
* Fix StyledText so serialize will match for style list order changes
* Try to fix exceptions on ManagedWindow close
* Fix Mac SQLite3 locale bug when locale contains non-ascii characters
* Fix issue when Person has Same date of birth and death; gives an error.
* Geography: add a popup for a bad tiles path
* Fix GEDCOM export of estimated/calculated dates with modifers
* Bump to v5.1.3
2020-01-14
Version 5.1.2
* Narweb: Private notes for home, intro and contact. If the notes are private,
we can't use them in these pages.
* Referenced regions problems. When image width > 800, the referenced
regions are incorrectly placed
* Ancestor's tree display looks weird Solves the following:
- Person boxes overlap
- Some person boxes partially visible or hidden
* some cleanup in ancestortree.css
* ancestor tree and long names.
* Adapt ancestor tree css file for all themes
* dates not localised in place pages
* Mainz problem with short text in one note, Issue occurs on the homepage
and introduction page.
* bad event links on media pages
* Navweb: Don't use media regions in some case:
- If we don't show families
- If we don't show events
- Don't show the media regions for a thumbnail
* WEBCAL: home link translated to lowercase
* Wrong web calendar title on home page. This solves the possibility to
have ">", "<" in the title
* Update LDS Temple list
* Make GuiDestinationOption Folder Icon start in users directory
* Allow import file filter to accept case insensitive extensions
* Fix db to warn/prevent opening newer schema versions
* Fix Progen import dialog and progress meter for correct parent window
* Fix Progen import to correctly handle AKA surnames
* Fix ExportPkg so errors are not lost, and has progress bar for media
* Fix Export Assistant so error messages get correct parent window
* Fix GEDCOM import when family is missing; import created a missing note
* Fix Dashboard for adding Gramplet crash in Slovenian
* Update cs, ca, fr, uk, he, fi, hr, de, sv translation
* Update date parsing for czech locale
* Fix Spanish translation for dates
* fix private proxy tagref support. Add missing code for event, repository,
source, citation and place
* [Tree doc Tex] fix "-" char on place name "-" can lead to confusion,
generating text out of the box with PDF file format
* [Tree doc Tex] fix typo on custom size
* Fix duplicated "døde døde" Norwegion Translation for libnarrate
* Fix up Event Editors Place display for bidi text with Gramps ID
* Fix issues with RTL languages and LAT/LONG
* Fix display of GPS coordinates in Places view for RTL languages
* Fix place editor lat/long entry for RTL languages
* Fix GEDCOM export to avoid translated GrampsType strings
* Allow Tools with Notbook tabs to expand to fill the window
* Limit Age Stats gramplet settings to appropriate values.
* Max ages should be divisible by 5 to avoid out of range errors.
* The chart width should be greater than 45 to look right and
avoid division by zero errors.
* Fix the Preferences 'Age display precision' value getting lost
* Fix Window family tree title for non-ASCII chars on Windows
* Fix Preferences/Genealogical Symbols when only one font is present
* Fix various Entry fields so Undo/Redo works
* Fix tag colors on PedigreeView
* Fix Gramps -v error when Gtk is not present
* Fix for PedigreeView not reflecting changes to birthday or death
* ODF DOC - Fix improper escaping in odt output for TOC/Bookmark etc.
* Fix CLI parser to accept negative integers as valid
* Fix Descendant Tree report for HandleError when no parents on family
* Fix Reorder ID tool so subsequent db additions used next possible ID
* Upgrade export VCalendar to v2.0, so can export all utf8 characters
* Fix Preferences so <ctrl>PageUp/PageDn doesn't stick on Dates tab
* Graphs: Escape for name, dates and places in graph reports with XML
illegal characters
* Fix 'Go' menu direct object selection, goes to wrong place
2019-09-14
Version 5.1.1
* Update translations: cs, de, fi, fr, he, hr, pt_PT, ru, sv
+3 -6
View File
@@ -1,8 +1,5 @@
The Gramps Project ( https://gramps-project.org )
The Gramps Project ( https://gramps-project.org ) [![Build Status](https://travis-ci.org/gramps-project/gramps.svg?branch=master)](https://travis-ci.org/gramps-project/gramps)[![codecov.io](https://codecov.io/github/gramps-project/gramps/coverage.svg?branch=master)](https://codecov.io/github/gramps-project/gramps?branch=master)
===================
[![GitHub CI](https://github.com/gramps-project/gramps/actions/workflows/gramps-ci.yml/badge.svg?event=push&branch=maintenance/gramps51)](https://github.com/gramps-project/gramps/actions/workflows/gramps-ci.yml?query=branch%3Amaintenance%2Fgramps51)
[![codecov.io](https://codecov.io/github/gramps-project/gramps/coverage.svg?branch=maintenance/gramps51)](https://app.codecov.io/gh/gramps-project/gramps/branch/maintenance%2Fgramps51)
We strive to produce a genealogy program that is both intuitive for hobbyists and feature-complete for professional genealogists.
Please read the **COPYING** file first.
@@ -66,7 +63,7 @@ The following packages are **STRONGLY RECOMMENDED** to be installed:
sorting is done through built-in libraries. PyICU is
fairly widely available through the package managers of
distributions. See http://pyicu.osafoundation.org/
(These are Python bindings for the ICU package.
(These are Python bindings for the ICU package.
https://pypi.python.org/pypi/PyICU/)
* **Ghostscript**
@@ -75,7 +72,7 @@ The following packages are **STRONGLY RECOMMENDED** to be installed:
The following packages are optional:
------------------------------------
* **gtkspell**
* **gtkspell**
Enable spell checking in the notes. Gtkspell depends on
enchant. A version of gtkspell with gobject introspection
+45
View File
@@ -66,3 +66,48 @@ div#FamilyMapDetail div#references table.infolist {
div#FamilyMapDetail div#references table.infolist tbody tr td.ColumnPlace {
width: 40%;
}
/* Subsection: popup
------------------------------------------------------ */
.ol-popup {
position: absolute;
background-color: white;
-webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
padding: 15px;
border-radius: 10px;
border: 2px solid #111111;
bottom: 12px;
left: -50px;
min-width: 450px;
}
.ol-popup:after, .ol-popup:before {
top: 100%;
border: solid transparent;
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.ol-popup:after {
border-top-color: white;
border-width: 10px;
left: 48px;
margin-left: -10px;
}
.ol-popup:before {
border-top-color: #cccccc;
border-width: 11px;
left: 48px;
margin-left: -11px;
}
.ol-popup-closer {
text-decoration: none;
position: absolute;
top: 2px;
right: 8px;
}
.ol-popup-closer:after {
content: "✖";
}

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

+1 -1
View File
@@ -251,7 +251,7 @@ PLACES
<!ELEMENT places (placeobj)*>
<!ELEMENT placeobj (ptitle?, code?, pname+, coord?, placeref*, location*,
<!ELEMENT placeobj (ptitle?, pname+, code?, coord?, placeref*, location*,
objref*, url*, noteref*, citationref*, tagref*)>
<!ATTLIST placeobj
id CDATA #IMPLIED
+1 -1
View File
@@ -453,10 +453,10 @@
<ref name="primary-object"/>
<attribute name="type"><text/></attribute>
<optional><element name="ptitle"><text/></element></optional>
<optional><element name="code"><text/></element></optional>
<oneOrMore><element name="pname">
<ref name="placename-content"/>
</element></oneOrMore>
<optional><element name="code"><text/></element></optional>
<optional><element name="coord">
<attribute name="long"><text/></attribute>
<attribute name="lat"><text/></attribute>
+14 -82
View File
@@ -20,9 +20,6 @@
<code>SAMOA</code>
<code>AP</code>
</temple>
<temple name="Arequipa Peru Temple">
<code>AREQU</code>
</temple>
<temple name="Asuncion, Paraguay">
<code>ASUNC</code>
</temple>
@@ -30,9 +27,6 @@
<code>ATLAN</code>
<code>AT</code>
</temple>
<temple name="Barranquilla Colombia Temple">
<code>BARRA</code>
</temple>
<temple name="Baton Rouge, Louisiana">
<code>BROUG</code>
</temple>
@@ -63,9 +57,6 @@
<temple name="Bountiful, Utah">
<code>BOUNT</code>
</temple>
<temple name="Brigham City Utah Temple">
<code>BRIGH</code>
</temple>
<temple name="Brisbane, Australia">
<code>BRISB</code>
</temple>
@@ -88,12 +79,8 @@
<code>ALBR</code>
</temple>
<temple name="Cebu, Philippines">
<code>CEBUP</code>
<code>CEBU</code>
</temple>
<temple name="Cedar City Utah">
<code>CEDAR</code>
</temple>
<temple name="Chicago, Illinois">
<code>CHICA</code>
<code>CH</code>
@@ -107,18 +94,15 @@
<temple name="Colonia Juarez, Chihuahua, Mexico">
<code>COLJU</code>
</temple>
<temple name="Columbia River, Washington">
<code>CRIVE</code>
</temple>
<temple name="Columbia, South Carolina">
<code>COLSC</code>
</temple>
<temple name="Columbia River, Washington">
<code>CRIVE</code>
</temple>
<temple name="Columbus, Ohio">
<code>COLUM</code>
</temple>
<temple name="Concepción Chile">
<code>CONCE</code>
</temple>
<temple name="Copenhagen, Denmark">
<code>COPEN</code>
</temple>
@@ -145,19 +129,6 @@
<temple name="Edmonton, Alberta">
<code>EDMON</code>
</temple>
<temple name="Endowment House">
<code>EHOUS</code>
<code>EH</code>
</temple>
<temple name="Fort Collins Colorado">
<code>FORTC</code>
</temple>
<temple name="Fort Lauderdale Florida">
<code>FORTL</code>
</temple>
<temple name="Fortaleza Brazil">
<code>FORTA</code>
</temple>
<temple name="Frankfurt, Germany">
<code>FRANK</code>
<code>FR</code>
@@ -220,9 +191,6 @@
<code>IFALL</code>
<code>IF</code>
</temple>
<temple name="Indianapolis Indiana">
<code>INDIA</code>
</temple>
<temple name="Johannesburg, South Africa">
<code>JOHAN</code>
<code>JO</code>
@@ -234,14 +202,10 @@
<temple name="Kansas City, Missouri">
<code>KANSA</code>
</temple>
<temple name="Kinshasa Democratic Republic of the Congo">
<code>KINSH</code>
</temple>
<temple name="Kona, Hawaii">
<code>KONA</code>
</temple>
<temple name="Kiev, Ukraine">
<code>KYIV</code>
<code>KIEV</code>
</temple>
<temple name="Kirtland, Ohio">
@@ -259,9 +223,6 @@
<code>LIMA</code>
<code>LI</code>
</temple>
<temple name="Lisbon Portugal">
<code>LISBO</code>
</temple>
<temple name="Logan, Utah">
<code>LOGAN</code>
<code>LG</code>
@@ -309,9 +270,6 @@
<temple name="Merida, Mexico">
<code>MERID</code>
</temple>
<temple name="Meridian Idaho">
<code>MIDAH</code>
</temple>
<temple name="Mesa, Arizona">
<code>ARIZO</code>
<code>AZ</code>
@@ -367,7 +325,6 @@
<code>OKLAH</code>
</temple>
<temple name="Oquirrh Mountain, Utah">
<code>OQUIR</code>
<code>OMOUN</code>
</temple>
<temple name="Orlando, Florida">
@@ -383,12 +340,6 @@
<code>PAPEE</code>
<code>TA</code>
</temple>
<temple name="Paris France">
<code>PARIS</code>
</temple>
<temple name="Payson Utah">
<code>PAYSO</code>
</temple>
<temple name="Perth, Australia">
<code>PERTH</code>
</temple>
@@ -398,9 +349,6 @@
<temple name="Phoenix, Arizona">
<code>PHOEN</code>
</temple>
<temple name="Port-au-Prince Haiti">
<code>PORTA</code>
</temple>
<temple name="Portland, Oregon">
<code>PORTL</code>
<code>PT</code>
@@ -411,9 +359,6 @@
<temple name="Preston, England">
<code>PREST</code>
</temple>
<temple name="Provo City Center, Utah">
<code>PROCC</code>
</temple>
<temple name="Provo, Utah">
<code>PROVO</code>
<code>PV</code>
@@ -440,7 +385,6 @@
<code>REXBU</code>
</temple>
<temple name="Rome, Italy">
<code>ROMEI</code>
<code>ROME</code>
</temple>
<temple name="Sacramento, California">
@@ -450,6 +394,12 @@
<code>SGEOR</code>
<code>SG</code>
</temple>
<temple name="St. Louis, Missouri">
<code>SLOUI</code>
</temple>
<temple name="St. Paul, Minnesota">
<code>SPMIN</code>
</temple>
<temple name="Salt Lake City, Utah">
<code>SLAKE</code>
<code>SL</code>
@@ -465,7 +415,6 @@
<code>SJOSE</code>
</temple>
<temple name="San Salvador, El Salvador">
<code>SANSA</code>
<code>SSALV</code>
</temple>
<temple name="Santiago, Chile">
@@ -479,9 +428,6 @@
<code>SPAUL</code>
<code>SP</code>
</temple>
<temple name="Sapporo Japan">
<code>SAPPO</code>
</temple>
<temple name="Seattle, Washington">
<code>SEATT</code>
<code>SE</code>
@@ -496,15 +442,6 @@
<temple name="Spokane, Washington">
<code>SPOKA</code>
</temple>
<temple name="St. Louis, Missouri">
<code>SLOUI</code>
</temple>
<temple name="St. Paul, Minnesota">
<code>SPMIN</code>
</temple>
<temple name="Star Valley Wyoming">
<code>STARV</code>
</temple>
<temple name="Stockholm, Sweden">
<code>STOCK</code>
<code>ST</code>
@@ -526,15 +463,9 @@
<temple name="Tegucigalpa, Honduras">
<code>TEGUC</code>
</temple>
<temple name="The Gila Valley Arizona">
<code>GILAV</code>
</temple>
<temple name="The Hague, Netherlands">
<code>HAGUE</code>
</temple>
<temple name="Tijuana Mexico">
<code>TIJUA</code>
</temple>
<temple name="Tokyo, Japan">
<code>TOKYO</code>
<code>TK</code>
@@ -543,19 +474,16 @@
<code>TORON</code>
<code>TORNO</code>
<code>TR</code>
</temple>
<temple name="Trujillo, Peru">
<code>TRUJI</code>
</temple>
<temple name="Tucson Arizona">
<code>TUCSO</code>
</temple>
<temple name="Tuxtla Gutierrez, Mexico">
<code>TGUTI</code>
</temple>
<temple name="Twin Falls, Idaho">
<code>TWINF</code>
<code>TFALL</code>
<code>TWINF</code>
</temple>
<temple name="Vancouver, British Columbia">
<code>VANCO</code>
@@ -577,6 +505,10 @@
<code>WINTE</code>
<code>WQUAR</code>
</temple>
<temple name="Endowment House">
<code>EHOUS</code>
<code>EH</code>
</temple>
<temple name="President's Office">
<code>POFFI</code>
<code>PO</code>
+6 -6
View File
@@ -1,12 +1,12 @@
0 HEAD
1 SOUR Gramps
2 VERS 5.1.2
2 VERS 5.0.2
2 NAME Gramps
1 DATE 7 JAN 2020
2 TIME 13:39:43
1 DATE 4 AUG 2019
2 TIME 15:26:44
1 SUBM @SUBM@
1 FILE C:\Users\prc\AppData\Roaming\gramps\temp\exp_sample_ged.ged
1 COPR Copyright (c) 2020 Alex Roitman,,,.
1 COPR Copyright (c) 2019 Alex Roitman,,,.
1 GEDC
2 VERS 5.5.1
2 FORM LINEAGE-LINKED
@@ -911,7 +911,7 @@
2 DATE I think 1970 to 1971
2 PLAC San Francisco, San Francisco Co., CA
1 SLGC
2 DATE ABT 1999
2 DATE EST ABT 1999
2 FAMC @F0016@
2 TEMP DENVE
2 PLAC Denver, Denver Co., CO, Denver Co., Colorado, USA
@@ -1424,7 +1424,7 @@
0 @N0018@ NOTE Another Citation Note
0 @N0019@ NOTE A bad photo for sure
0 @O0000@ OBJE
1 FILE d:\users\prc\documents\gramps\data\tests\O0.jpg
1 FILE c:\users\prc\workspace\grampsm\main\data\tests\O0.jpg
2 FORM jpg
2 TITL Michael O'Toole 2015-11
1 NOTE @N0019@
+3 -3
View File
@@ -3,7 +3,7 @@
"http://gramps-project.org/xml/1.7.1/grampsxml.dtd">
<database xmlns="http://gramps-project.org/xml/1.7.1/">
<header>
<created date="1999-12-25" version="5.1.3"/>
<created date="2019-08-04" version="5.0.2"/>
<researcher>
<resname>Alex Roitman,,,</resname>
<resaddr>Not Provided</resaddr>
@@ -1302,7 +1302,7 @@
</reporef>
</source>
<source handle="_0000008500000085" change="1" id="S0000">
<stitle>Marriage Certificae</stitle>
<stitle>@S0@</stitle>
<noteref hlink="_000000e7000000e7"/>
<reporef hlink="_000000e6000000e6" callno="what-321-ever" medium="Photo"/>
</source>
@@ -1705,7 +1705,7 @@ Unknown tag Line 1111:
<range start="0" end="163"/>
</style>
</note>
<note handle="_000000f9000000f9" change="1591544255" id="N0036" type="General">
<note handle="_000000f9000000f9" change="1564950708" id="N0036" type="General">
<text>Objects referenced by this note were missing in a file imported on 12/25/1999 12:00:00 AM.</text>
</note>
</notes>
-30
View File
@@ -1,33 +1,3 @@
gramps (5.1.5-1) unstable; urgency=medium
* New release
* Update copyright file
* Drop patch, incorporated upstream
-- Ross Gammon <rossgammon@debian.org> Sat, 12 Feb 2022 17:01:21 +0100
gramps (5.1.4-1) unstable; urgency=medium
* New release
* Add new copyrights
* Update watch file
* Patch probably alive test to fix FTBFS
-- Ross Gammon <rossgammon@debian.org> Sun, 15 Aug 2021 18:31:56 +0200
gramps (5.1.3-1) focal; urgency=medium
* New release
* Update debian/copyright for Alex Roitman
-- Ross Gammon <rosco2@ubuntu.com> Sun, 16 Aug 2020 20:23:34 +0200
gramps (5.1.2-1) unstable; urgency=medium
* New release
-- Ross Gammon <rossgammon@debian.org> Sat, 11 Jan 2020 19:07:08 +0100
gramps (5.1.1-1) unstable; urgency=medium
* New release
+1 -3
View File
@@ -46,7 +46,7 @@ Copyright: 2000-2007, Alex Roitman
2009, Florian Heinle
2009, Gerald W. Britton
2009, Igal Shapira
2009-2022, Nick Hall
2009-2018, Nick Hall
2009, Pander Musubi
2009, Robert Ham
2009, Swoon on bug tracker
@@ -92,8 +92,6 @@ Copyright: 2000-2007, Alex Roitman
2018, Robin van der Vliet
2018, Theo van Rijn
2019, Matthias Kemmer
2020, Jan Sparreboom
2021, Mirko Leonhaeuser
License: GPL-2+
Files: debian/*
+5 -3
View File
@@ -1,6 +1,8 @@
version=4
version=3
opts=\
filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/gramps-project-$1\.tar\.gz/,\
dversionmangle=s/(\~|\+)(debian|dfsg|ds|deb)(\.\d+)?$//,\
filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/$1\.tar\.gz/,\
repacksuffix=~dfsg \
https://github.com/gramps-project/gramps/tags \
.*/v?(\d\S+)\.tar\.gz
.*/archive/v?([\d\.]+).tar.gz
+1 -1
View File
@@ -57,7 +57,7 @@ master_doc = 'index'
# General information about the project.
project = 'Gramps'
copyright = '2001-2023, The Gramps Project'
copyright = '2001-2019, The Gramps Project'
author = 'Donald N. Allingham'
# The version info for the project you're documenting, acts as replacement for
+2 -2
View File
@@ -519,8 +519,8 @@ class CommandLineReport:
self.format = tree_format["class"]
if self.format is None:
# Pick the first one as the default.
self.format = treedoc.FORMATS[0]["class"]
_chosen_format = treedoc.FORMATS[0]["type"]
self.format = tree_format.FORMATS[0]["class"]
_chosen_format = tree_format.FORMATS[0]["type"]
else:
self.format = None
if _chosen_format and _format_str:
+2 -2
View File
@@ -145,7 +145,7 @@ sys.path.insert(0, ROOT_DIR)
git_revision = get_git_revision(ROOT_DIR).replace('\n', '')
if sys.platform == 'win32' and git_revision == "":
git_revision = get_git_revision(os.path.split(ROOT_DIR)[1])
#VERSION += git_revision
VERSION += git_revision
#VERSION += "-1"
#
@@ -225,7 +225,7 @@ GTK_GETTEXT_DOMAIN = 'gtk30'
#
#-------------------------------------------------------------------------
COPYRIGHT_MSG = "© 2001-2006 Donald N. Allingham\n" \
"© 2007-2023 The Gramps Developers"
"© 2007-2019 The Gramps Developers"
COMMENTS = _("Gramps\n (Genealogical Research and Analysis "
"Management Programming System)\n"
"is a personal genealogy program.")
+6 -11
View File
@@ -35,7 +35,6 @@ import logging
# Gramps modules
#
#-------------------------------------------------------------------------
from ..utils.grampslocale import GrampsLocale
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.sgettext
# import prerequisites for localized handlers
@@ -73,20 +72,16 @@ from . import _date_uk
from . import _date_zh_CN
from . import _date_zh_TW
# the following makes sure we use the LC_TIME value for date display & parsing
dlocale = GrampsLocale(lang=glocale.calendar)
# Initialize global parser
try:
if LANG in LANG_TO_PARSER:
parser = LANG_TO_PARSER[LANG](plocale=dlocale)
parser = LANG_TO_PARSER[LANG](plocale=glocale)
else:
parser = LANG_TO_PARSER[LANG_SHORT](plocale=dlocale)
parser = LANG_TO_PARSER[LANG_SHORT](plocale=glocale)
except:
logging.warning(
_("Date parser for '%s' not available, using default") % LANG)
parser = LANG_TO_PARSER["C"](plocale=dlocale)
parser = LANG_TO_PARSER["C"](plocale=glocale)
# Initialize global displayer
try:
@@ -97,13 +92,13 @@ except:
try:
if LANG in LANG_TO_DISPLAY:
displayer = LANG_TO_DISPLAY[LANG](val, blocale=dlocale)
displayer = LANG_TO_DISPLAY[LANG](val, blocale=glocale)
else:
displayer = LANG_TO_DISPLAY[LANG_SHORT](val, blocale=dlocale)
displayer = LANG_TO_DISPLAY[LANG_SHORT](val, blocale=glocale)
except:
logging.warning(
_("Date displayer for '%s' not available, using default") % LANG)
displayer = LANG_TO_DISPLAY["C"](val, blocale=dlocale)
displayer = LANG_TO_DISPLAY["C"](val, blocale=glocale)
# Import utility functions
-20
View File
@@ -50,15 +50,6 @@ class DateParserCZ(DateParser):
Converts a text string into a Date object
"""
quality_to_int = {
'přibližně' : Date.QUAL_ESTIMATED,
'odhadem' : Date.QUAL_ESTIMATED,
'odh.' : Date.QUAL_ESTIMATED,
'vypočteno' : Date.QUAL_CALCULATED,
'vypočtené' : Date.QUAL_CALCULATED,
'vyp.' : Date.QUAL_CALCULATED,
}
bce = ["před naším letopočtem", "před Kristem",
"př. n. l.", "př. Kr."] + DateParser.bce
@@ -67,17 +58,6 @@ class DateParserCZ(DateParser):
# bug 9739 grampslocale.py gets '%-d.%-m.%Y' -- makes it be '%/d.%/m.%Y'
self.dhformat = self.dhformat.replace('/', '') # so counteract that
def init_strings(self):
DateParser.init_strings(self)
self._text2 = re.compile(r'(\d+)?\.?\s+?%s\.?\s*((\d+)(/\d+)?)?\s*$'
% self._mon_str, re.IGNORECASE)
self._span = re.compile(
r"(od)\s+(?P<start>.+)\s+(do)\s+(?P<stop>.+)",
re.IGNORECASE)
self._range = re.compile(
r"(mezi)\s+(?P<start>.+)\s+(a)\s+(?P<stop>.+)",
re.IGNORECASE)
#-------------------------------------------------------------------------
#
# Czech display
+14 -1
View File
@@ -290,7 +290,8 @@ class DateDisplayDE(DateDisplay):
formats = (
"JJJJ-MM-DD (ISO)", "Numerisch", "Monat Tag Jahr",
"MONAT Tag Jahr", "Tag. Monat Jahr", "Tag. MONAT Jahr"
"MONAT Tag Jahr", "Tag. Monat Jahr", "Tag. MONAT Jahr",
"Numerisch mit führenden Nullen"
)
# this definition must agree with its "_display_gregorian" method
@@ -343,6 +344,18 @@ class DateDisplayDE(DateDisplay):
else:
value = "%d. %s %s" % (date_val[0],
self.long_months[date_val[1]], year)
elif self.format == 6:
# day.month_number.year with leading zeros
if date_val[3]:
return self.display_iso(date_val)
else:
if date_val[0] == date_val[1] == 0:
value = str(date_val[2])
else:
value = self.dhformat.replace('%m', str(date_val[1])
.zfill(2))
value = value.replace('%d', str(date_val[0]).zfill(2))
value = value.replace('%Y', str(date_val[2]))
else:
# day. month_abbreviation year
if date_val[0] == 0:
+25 -27
View File
@@ -83,37 +83,35 @@ class DateParserNL(DateParser):
month_to_int["xbris"] = 12
modifier_to_int = {
'voor' : Date.MOD_BEFORE,
'na' : Date.MOD_AFTER,
'ca.' : Date.MOD_ABOUT,
'circa' : Date.MOD_ABOUT,
'om' : Date.MOD_ABOUT,
'omstreeks' : Date.MOD_ABOUT,
'ongeveer' : Date.MOD_ABOUT,
'rond' : Date.MOD_ABOUT,
'tegen' : Date.MOD_ABOUT,
'voor' : Date.MOD_BEFORE,
'na' : Date.MOD_AFTER,
'tegen' : Date.MOD_ABOUT,
'om' : Date.MOD_ABOUT,
'rond' : Date.MOD_ABOUT,
'circa' : Date.MOD_ABOUT,
'ca.' : Date.MOD_ABOUT,
}
calendar_to_int = {
'gregoriaans' : Date.CAL_GREGORIAN,
'greg.' : Date.CAL_GREGORIAN,
'juliaans' : Date.CAL_JULIAN,
'jul.' : Date.CAL_JULIAN,
'hebreeuws' : Date.CAL_HEBREW,
'hebr.' : Date.CAL_HEBREW,
'islamitisch' : Date.CAL_ISLAMIC,
'isl.' : Date.CAL_ISLAMIC,
'frans republiekeins' : Date.CAL_FRENCH,
'fran.' : Date.CAL_FRENCH,
'persisch' : Date.CAL_PERSIAN,
'zweeds' : Date.CAL_SWEDISH,
'z' : Date.CAL_SWEDISH,
'gregoriaans' : Date.CAL_GREGORIAN,
'greg.' : Date.CAL_GREGORIAN,
'juliaans' : Date.CAL_JULIAN,
'jul.' : Date.CAL_JULIAN,
'hebreeuws' : Date.CAL_HEBREW,
'hebr.' : Date.CAL_HEBREW,
'islamitisch' : Date.CAL_ISLAMIC,
'isl.' : Date.CAL_ISLAMIC,
'franse republiek': Date.CAL_FRENCH,
'fran.' : Date.CAL_FRENCH,
'persisch' : Date.CAL_PERSIAN,
'zweeds' : Date.CAL_SWEDISH,
'z' : Date.CAL_SWEDISH,
}
quality_to_int = {
'geschat' : Date.QUAL_ESTIMATED,
'geschat' : Date.QUAL_ESTIMATED,
'gesch.' : Date.QUAL_ESTIMATED,
'berekend' : Date.QUAL_CALCULATED,
'berekend' : Date.QUAL_CALCULATED,
'ber.' : Date.QUAL_CALCULATED,
}
@@ -149,17 +147,17 @@ class DateDisplayNL(DateDisplay):
calendar = (
"", "juliaans", "hebreeuws",
"frans republikeins", "persisch", "islamitisch",
"franse republiek", "persisch", "islamitisch",
"zweeds" )
_mod_str = ("", "voor ", "na ", "omstreeks ", "", "", "")
_mod_str = ("", "voor ", "na ", "rond ", "", "", "")
_qual_str = ("", "geschat ", "berekend ")
_bce_str = "%s v. Chr."
formats = (
"JJJJ-MM-DD (ISO)", "Numeriek DD/MM/JJJJ", "Maand Dag, Jaar",
"JJJJ-MM-DD (ISO)", "Numerisch DD/MM/JJ", "Maand Dag, Jaar",
"Mnd. Dag Jaar", "Dag Maand Jaar", "Dag Mnd. Jaar"
)
# this definition must agree with its "_display_gregorian" method
+13 -6
View File
@@ -32,7 +32,7 @@ database to fetch data from). Thus, dbstate.db cannot be left as 'None' because
None has no 'is_open' attribute. Therefore this database class is provided so
that it can be instantiated for dbstate.db.
FIXME: Ideally, only is_open() needs to be implemented here, bacause that is the
FIXME: Ideally, only is_open() needs to be implemented here, because that is the
only method that should really be called, but the Gramps code is not perfect,
and many other methods are called. Calls of other methods could be considered
bugs, so when these are fixed, this class could be reduced.
@@ -52,6 +52,7 @@ methods should be changed to generate exceptions. Possibly by globally changing
#
#-------------------------------------------------------------------------
import logging
import os
import inspect
from abc import ABCMeta
from types import FunctionType
@@ -159,12 +160,10 @@ def wrapper(method):
"""
class_name = args[0].__class__.__name__
func_name = method.__name__
frame = inspect.currentframe()
c_frame = frame.f_back
c_code = c_frame.f_code
caller_frame = inspect.stack()[1]
LOG.debug('calling %s.%s()... from file %s, line %s in %s',
class_name, func_name, c_code.co_filename, c_frame.f_lineno,
c_code.co_name)
class_name, func_name, os.path.split(caller_frame[1])[1],
caller_frame[2], caller_frame[3])
return method(*args, **keywargs)
return wrapped
@@ -758,6 +757,14 @@ class DummyDb(M_A_M_B("NewBaseClass", (DbReadBase, Callback, object,), {})):
LOG.warning("database is closed")
return 0
def get_number_of_citations(self):
"""
Return the number of citations currently in the database.
"""
if not self.db_is_open:
LOG.warning("database is closed")
return 0
def get_number_of_tags(self):
"""
Return the number of tags currently in the database.
+1 -8
View File
@@ -47,7 +47,6 @@ from . import (DbReadBase, DbWriteBase, DbUndo, DBLOGNAME, DBUNDOFN,
REPOSITORY_KEY, NOTE_KEY, TAG_KEY, TXNADD, TXNUPD, TXNDEL,
KEY_TO_NAME_MAP, DBMODE_R, DBMODE_W)
from .utils import write_lock_file, clear_lock_file
from .exceptions import DbVersionError
from ..errors import HandleError
from ..utils.callback import Callback
from ..updatecallback import UpdateCallback
@@ -535,7 +534,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
self.undo_history_callback = None
self.modified = 0
self.transaction = None
self.abort_possible = True
self.abort_possible = False
self._bm_changes = 0
self.has_changed = False
self.surname_list = []
@@ -660,12 +659,6 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
self.db_is_open = True
# Check on db version to see if too new
dbversion = int(self._get_metadata('version', default='0'))
if dbversion > self.VERSION[0]:
self.close()
raise DbVersionError(dbversion, 18, self.VERSION[0])
def _close(self):
"""
Close database backend.
+8 -6
View File
@@ -78,13 +78,15 @@ class DbTxn(defaultdict):
elapsed_time = time.time() - self.start_time
if __debug__:
frame = inspect.currentframe()
c_frame = frame.f_back
c_code = c_frame.f_code
caller_frame = inspect.stack()[1]
_LOG.debug(" **** DbTxn %s exited. Called from file %s, "
"line %s, in %s **** %.2f seconds",
hex(id(self)), c_code.co_filename, c_frame.f_lineno,
c_code.co_name, elapsed_time)
"line %s, in %s **** %.2f seconds" %
((hex(id(self)),)+
(os.path.split(caller_frame[1])[1],)+
tuple(caller_frame[i] for i in range(2, 4))+
(elapsed_time,)
)
)
return False
+7 -11
View File
@@ -42,8 +42,6 @@ from ..const import PLUGINS_DIR, USER_PLUGINS
from ..constfunc import win, get_env_var
from ..config import config
from .dbconst import DBLOGNAME, DBLOCKFN, DBBACKEND
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
@@ -72,14 +70,12 @@ def make_database(plugin_id):
database = getattr(mod, pdata.databaseclass)
db = database()
import inspect
frame = inspect.currentframe()
c_frame = frame.f_back
c_code = c_frame.f_code
caller_frame = inspect.stack()[1]
_LOG.debug("Database class instance created Class:%s instance:%s. "
"Called from File %s, line %s, in %s",
db.__class__.__name__, hex(id(db)), c_code.co_filename,
c_frame.f_lineno, c_code.co_name)
"Called from File %s, line %s, in %s"
% ((db.__class__.__name__, hex(id(db)))
+ (os.path.split(caller_frame[1])[1],)
+ tuple(caller_frame[i] for i in range(2, 4))))
return db
else:
raise Exception("can't load database backend: '%s'" % plugin_id)
@@ -213,8 +209,8 @@ def write_lock_file(name):
if win():
user = get_env_var('USERNAME')
host = get_env_var('USERDOMAIN')
if not user:
user = _("Unknown")
if host is None:
host = ""
else:
host = os.uname()[1]
# An ugly workaround for os.getlogin() issue with Konsole
+4 -5
View File
@@ -29,6 +29,7 @@ Provide the database state class
#
#------------------------------------------------------------------------
import sys
import os
import logging
import inspect
@@ -87,12 +88,10 @@ class DbState(Callback):
"""
class_name = self.__class__.__name__
func_name = "is_open"
frame = inspect.currentframe()
c_frame = frame.f_back
c_code = c_frame.f_code
caller_frame = inspect.stack()[1]
_LOG.debug('calling %s.%s()... from file %s, line %s in %s',
class_name, func_name, c_code.co_filename, c_frame.f_lineno,
c_code.co_name)
class_name, func_name, os.path.split(caller_frame[1])[1],
caller_frame[2], caller_frame[3])
return (self.db is not None) and self.db.is_open()
def change_database(self, database):
+2 -21
View File
@@ -999,8 +999,6 @@ class NameDisplay:
1. if group name is defined, use that
2. if group name is defined for the primary surname, use that
3. use primary surname itself otherwise
4. if no primary surname, do we have a ma/patronymic surname ?
in this case, group name will be the ma/patronymic name.
:param pn: raw unserialized data of name
:type pn: tuple
@@ -1009,25 +1007,8 @@ class NameDisplay:
"""
if pn[_GROUP]:
return pn[_GROUP]
name = pn[_GROUP]
if not name:
# if we have no primary surname, perhaps we have a
# patronymic/matronynic name ?
srnme = pn[_ORIGINPATRO]
surname = []
for _surname in srnme:
if (_surname[_TYPE_IN_LIST][0] == _ORIGINPATRO
or _surname[_TYPE_IN_LIST][0] == _ORIGINMATRO):
# Yes, we have one.
surname = [_surname]
# name1 is the ma/patronymic name.
name1 = _raw_patro_surname_only(surname)
if name1 and len(srnme) == 1:
name = db.get_name_group_mapping(name1)
if not name:
name = db.get_name_group_mapping(_raw_primary_surname_only(
pn[_SURNAME_LIST]))
return name
return db.get_name_group_mapping(_raw_primary_surname_only(
pn[_SURNAME_LIST]))
def _make_fn(self, format_str, d, args):
"""
@@ -28,6 +28,7 @@ from ._hascitation import HasCitation
from ._allcitations import AllCitations
from ._changedsince import ChangedSince
from ._citationprivate import CitationPrivate
from ._hasattribute import HasAttribute
from ._hasgallery import HasGallery
from ._hasidof import HasIdOf
from ._hasnote import HasNote
@@ -50,6 +51,7 @@ editor_rule_list = [
AllCitations,
ChangedSince,
CitationPrivate,
HasAttribute,
HasGallery,
HasIdOf,
HasNote,
@@ -0,0 +1,49 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Gary Burton
# Copyright (C) 2019 Matthias Kemmer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# -------------------------------------------------------------------------
#
# Standard Python modules
#
# -------------------------------------------------------------------------
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
# -------------------------------------------------------------------------
#
# Gramps modules
#
# -------------------------------------------------------------------------
from .._hasattributebase import HasAttributeBase
# -------------------------------------------------------------------------
#
# HasAttribute
#
# -------------------------------------------------------------------------
class HasAttribute(HasAttributeBase):
"""Rule that checks for a citation with a particular attribute"""
labels = [_('Citation attribute:'), _('Value:')]
name = _('Citations with the attribute <attribute>')
description = _("Matches citations with the attribute "
"of a particular value")
@@ -51,7 +51,6 @@ editor_rule_list = [
MediaPrivate,
MatchesFilter,
MatchesSourceConfidence,
HasMedia,
HasAttribute,
ChangedSince,
HasTag,
@@ -29,6 +29,7 @@ from ._disconnected import Disconnected
from ._everyone import Everyone
from ._familywithincompleteevent import FamilyWithIncompleteEvent
from ._hasaddress import HasAddress
from ._hasaddresstext import HasAddressText
from ._hasalternatename import HasAlternateName
from ._hasassociation import HasAssociation
from ._hasattribute import HasAttribute
@@ -125,6 +126,7 @@ editor_rule_list = [
IsBookmarked,
HasAlternateName,
HasAddress,
HasAddressText,
HasAssociation,
HasIdOf,
HasLDS,
@@ -0,0 +1,54 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Brian G. Matherly
# Copyright (C) 2008 Jerome Rapinat
# Copyright (C) 2008 Benny Malengier
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# -------------------------------------------------------------------------
#
# Gramps modules
#
# -------------------------------------------------------------------------
from .. import Rule
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
# -------------------------------------------------------------------------
#
# HasAddressText
#
# -------------------------------------------------------------------------
class HasAddressText(Rule):
"""Rule that checks for text in personal addresses"""
labels = [_('Text:')]
name = _('People with an address containing <text>')
description = _("Matches people with a personal address containing "
"the given text")
category = _('General filters')
allow_regex = True
def apply(self, db, person):
for address in person.get_address_list():
for string in address.get_text_data_list():
if self.match_substring(0, string):
return True
return False
@@ -41,9 +41,9 @@ from .. import Rule
class IsDefaultPerson(Rule):
"""Rule that checks for a default person in the database"""
name = _('Home Person')
name = _('Default person')
category = _('General filters')
description = _("Matches the Home Person")
description = _("Matches the default person")
def prepare(self, db, user):
p = db.get_default_person()
@@ -44,10 +44,10 @@ class IsLessThanNthGenerationAncestorOfDefaultPerson(Rule):
not more than N generations away"""
labels = [ _('Number of generations:') ]
name = _('Ancestors of the Home Person '
name = _('Ancestors of the default person '
'not more than <N> generations away')
category = _('Ancestral filters')
description = _("Matches ancestors of the Home Person "
description = _("Matches ancestors of the default person "
"not more than N generations away")
def prepare(self, db, user):
@@ -52,7 +52,7 @@ class MatchesEventFilter(MatchesEventFilterBase):
name = _('Persons with events matching the <event filter>')
description = _("Matches persons who have events that match a certain"
" event filter")
category = _('Event filters')
category = _('General filters')
# we want to have this filter show event filters
namespace = 'Event'
@@ -37,10 +37,10 @@ import re
# Gramps modules
#
#-------------------------------------------------------------------------
from gramps.gen.errors import FilterError
from ....const import GRAMPS_LOCALE as glocale
from .. import Rule
from ....utils.place import conv_lat_lon
from gramps.gen.errors import FilterError
_ = glocale.translation.sgettext
@@ -81,13 +81,13 @@ class WithinArea(Rule):
"D.D8")
if self.latitude is None or self.longitude is None:
raise FilterError(_("Cannot use the filter 'within area'"),
_("The place you selected contains bad coordinates. "
"Please, run the tool 'clean input data'"))
return
_("The place you selected contains bad"
" coordinates. Please, run the tool "
"'clean input data'"))
val = self.list[1]
if isinstance(val, str):
val = re.sub(r"\D", "", val) # suppress all alpha characters
val = re.sub(r"\D", "", val) # suppress all alpha characters
value = int(val)
unit = int(self.list[2])
# earth perimeter in kilometers for latitude
@@ -25,6 +25,7 @@ Package providing filter rules for Gramps.
from ._allrepos import AllRepos
from ._hasidof import HasIdOf
from ._regexpidof import RegExpIdOf
from ._hasattribute import HasAttribute
from ._hasnoteregexp import HasNoteRegexp
from ._hasnotematchingsubstringof import HasNoteMatchingSubstringOf
from ._hasreferencecountof import HasReferenceCountOf
@@ -37,6 +38,7 @@ from ._hastag import HasTag
editor_rule_list = [
AllRepos,
HasAttribute,
HasIdOf,
RegExpIdOf,
HasNoteRegexp,
@@ -0,0 +1,49 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Gary Burton
# Copyright (C) 2019 Matthias Kemmer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# -------------------------------------------------------------------------
#
# Standard Python modules
#
# -------------------------------------------------------------------------
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
# -------------------------------------------------------------------------
#
# Gramps modules
#
# -------------------------------------------------------------------------
from .._hasattributebase import HasAttributeBase
# -------------------------------------------------------------------------
#
# HasAttribute
#
# -------------------------------------------------------------------------
class HasAttribute(HasAttributeBase):
"""Rule that checks for a repository with a particular attribute"""
labels = [_('Repository attribute:'), _('Value:')]
name = _('Repositories with the attribute <attribute>')
description = _("Matches repositories with the attribute "
"of a particular value")
@@ -27,6 +27,7 @@ Package providing filter rules for Gramps.
from .._hassourcebase import HasSourceBase as HasSource
from ._allsources import AllSources
from ._hasattribute import HasAttribute
from ._hasgallery import HasGallery
from ._hasidof import HasIdOf
from ._regexpidof import RegExpIdOf
@@ -45,6 +46,7 @@ from ._hastag import HasTag
editor_rule_list = [
AllSources,
HasAttribute,
HasGallery,
HasIdOf,
RegExpIdOf,
@@ -0,0 +1,49 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Gary Burton
# Copyright (C) 2019 Matthias Kemmer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# -------------------------------------------------------------------------
#
# Standard Python modules
#
# -------------------------------------------------------------------------
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
# -------------------------------------------------------------------------
#
# Gramps modules
#
# -------------------------------------------------------------------------
from .._hasattributebase import HasAttributeBase
# -------------------------------------------------------------------------
#
# HasAttribute
#
# -------------------------------------------------------------------------
class HasAttribute(HasAttributeBase):
"""Rule that checks for a source with a particular attribute"""
labels = [_('Source attribute:'), _('Value:')]
name = _('Sources with the attribute <attribute>')
description = _("Matches sources with the attribute "
"of a particular value")
@@ -98,10 +98,9 @@ class BaseTest(unittest.TestCase):
filter_.set_invert(invert)
stime = perf_counter()
results = filter_.apply(self.db)
# if __debug__:
# frame = inspect.currentframe()
# rulename = frame.f_back.f_code.co_name
# print("%s: %.2f\n" % (rulename, perf_counter() - stime))
if __debug__:
rulename = inspect.stack()[1][3]
print("%s: %.2f\n" % (rulename, perf_counter() - stime))
return set(results)
def test_Complex_1(self):
@@ -347,7 +346,7 @@ class BaseTest(unittest.TestCase):
"""
rule = ProbablyAlive(['1900'])
res = self.filter_with_rule(rule)
self.assertEqual(len(res), 733)
self.assertEqual(len(res), 766)
def test_RegExpName(self):
"""
+4 -4
View File
@@ -77,14 +77,14 @@ class Span:
self.precision = 2
self.negative = False
if self.valid:
if self.date1.sortval < self.date2.sortval:
self.date1 = date2
self.date2 = date1
self.negative = True
if self.date1.calendar != Date.CAL_GREGORIAN:
self.date1 = self.date1.to_calendar("gregorian")
if self.date2.calendar != Date.CAL_GREGORIAN:
self.date2 = self.date2.to_calendar("gregorian")
if self.date1.sortval < self.date2.sortval:
self.date1 = date2
self.date2 = date1
self.negative = True
if self.date1.get_modifier() == Date.MOD_NONE:
if self.date2.get_modifier() == Date.MOD_NONE:
val = self.date1.sortval - self.date2.sortval
+2 -4
View File
@@ -288,12 +288,10 @@ class GrampsType(object, metaclass=GrampsTypeMeta):
else:
return self.__value == value[0]
else:
if value.value == self._CUSTOM and self.__value == self._CUSTOM:
if value.value == self._CUSTOM:
return self.__string == value.string
elif value.value != self._CUSTOM and self.__value != self._CUSTOM:
return self.__value == value.value
else:
return False
return self.__value == value.value
def __ne__(self, value):
return not self.__eq__(value)
-1
View File
@@ -299,7 +299,6 @@ class StyledText:
"""
if self._tags:
the_tags = [tag.serialize() for tag in self._tags]
the_tags.sort()
else:
the_tags = []
+1 -31
View File
@@ -38,7 +38,7 @@ from ...datehandler import get_date_formats, set_format
from ...datehandler import parser as _dp
from ...datehandler import displayer as _dd
from ...datehandler._datedisplay import DateDisplayEn
from ...lib.date import Date, DateError, Today, calendar_has_fixed_newyear, Span
from ...lib.date import Date, DateError, Today, calendar_has_fixed_newyear
date_tests = {}
@@ -432,36 +432,6 @@ class ArithmeticDateTest(BaseDateTest):
self.assertEqual(val1, val2,
"'%s' should be '%s' but was '%s'" % (exp1, val2, val1))
#-------------------------------------------------------------------------
#
# SpanTest
#
#-------------------------------------------------------------------------
class SpanTest(BaseDateTest):
"""
Test spans.
"""
tests = [((2000, 1, 31), (2000, 1, 1), 30),
((1799, 11, 19), (8, 2, 18, Date.CAL_FRENCH), 10),
((8, 2, 18, Date.CAL_FRENCH), (1799, 11, 4), 5),
((8, 2, 18, Date.CAL_FRENCH), (3, 2, 9, Date.CAL_FRENCH), 1836)]
def test_evaluate(self):
for value1, value2, duration in self.tests:
date1 = self._get_date(value1)
date2 = self._get_date(value2)
span1 = Span(date1, date2)
self.assertEqual(int(span1), duration)
span2 = Span(date2, date1)
self.assertEqual(int(span2), -duration)
def _get_date(self, value):
date = Date()
if len(value) == 4:
date.set_calendar(value[3])
date.set_yr_mon_day(value[0], value[1], value[2])
return date
#-------------------------------------------------------------------------
#
# SwedishDateTest
+3 -3
View File
@@ -64,11 +64,11 @@ class Test1(unittest.TestCase):
C = self.C.join([self.A, self.S, deepcopy(self.B)])
C = C.replace('X', StyledText('_', [self.T3]))
_C = ('123_456\ncleartext\nabc_def',
[((0, ''), 'v3', [(3, 4)]),
((0, ''), 'v3', [(21, 22)]),
((1, ''), 'v1', [(0, 2), (2, 3)]),
[((1, ''), 'v1', [(0, 2), (2, 3)]),
((0, ''), 'v3', [(3, 4)]),
((1, ''), 'v1', [(4, 6)]),
((2, ''), 'v2', [(19, 21), (18, 21)]),
((0, ''), 'v3', [(21, 22)]),
((2, ''), 'v2', [(22, 23), (22, 25)])])
self.assertEqual(C.serialize(), _C)
+9 -14
View File
@@ -31,8 +31,8 @@ Provide merge capabilities for persons.
#-------------------------------------------------------------------------
from ..db import DbTxn
from ..const import GRAMPS_LOCALE as glocale
from ..errors import MergeError
_ = glocale.translation.sgettext
from ..errors import MergeError
#-------------------------------------------------------------------------
#
@@ -49,12 +49,11 @@ class MergePersonQuery:
self.titanic = titanic
if self.check_for_spouse(self.phoenix, self.titanic):
raise MergeError(_("Spouses cannot be merged. To merge these "
"people, you must first break the relationship"
" between them."))
"people, you must first break the relationship between them."))
if self.check_for_child(self.phoenix, self.titanic):
raise MergeError(_("A parent and child cannot be merged. To merge "
"these people, you must first break the relatio"
"nship between them."))
"these people, you must first break the relationship between "
"them."))
def check_for_spouse(self, person1, person2):
"""Return if person1 and person2 are spouses of eachother."""
@@ -81,12 +80,12 @@ class MergePersonQuery:
main_family.merge(family)
for childref in family.get_child_ref_list():
child = self.database.get_person_from_handle(
childref.get_reference_handle())
childref.get_reference_handle())
if main_family_handle in child.parent_family_list:
child.remove_handle_references('Family', [family_handle])
else:
child.replace_handle_reference('Family', family_handle,
main_family_handle)
main_family_handle)
self.database.commit_person(child, trans)
if self.phoenix:
self.phoenix.remove_family_handle(family_handle)
@@ -144,8 +143,7 @@ class MergePersonQuery:
for family_handle in self.phoenix.get_parent_family_handle_list():
family = self.database.get_family_from_handle(family_handle)
if family.has_handle_reference('Person', old_handle):
family.replace_handle_reference('Person', old_handle,
new_handle)
family.replace_handle_reference('Person', old_handle,new_handle)
self.database.commit_family(family, trans)
family_merge_guard = False
@@ -184,10 +182,7 @@ class MergePersonQuery:
self.database.commit_family(family, trans)
parent_list.append(parents)
hp_hdl = self.database.get_default_handle()
if (hp_hdl in (self.phoenix.get_handle(), self.titanic.get_handle())
and hp_hdl != self.phoenix.get_handle()):
self.database.set_default_person_handle(self.phoenix.get_handle())
if self.database.get_default_handle() == old_handle:
self.database.set_default_person_handle(None)
self.database.remove_person(old_handle, trans)
return family_merge_ok
+1 -1
View File
@@ -83,7 +83,7 @@ class BasePluginManager:
def __init__(self):
""" This function should only be run once by get_instance() """
if BasePluginManager.__instance != 1:
if BasePluginManager.__instance is not 1:
raise Exception("This class is a singleton. "
"Use the get_instance() method")
+1 -1
View File
@@ -1135,7 +1135,7 @@ class PluginRegister:
def __init__(self):
""" This function should only be run once by get_instance() """
if PluginRegister.__instance != 1:
if PluginRegister.__instance is not 1:
raise Exception("This class is a singleton. "
"Use the get_instance() method")
self.stable_only = True
+4 -8
View File
@@ -113,10 +113,6 @@ else:
_GS_CMD = where_is("gs")
def esc(id_txt):
return id_txt.replace('"', '\\"')
#------------------------------------------------------------------------------
#
# GVOptions
@@ -579,7 +575,7 @@ class GVDocBase(BaseDoc, GVDoc):
text += ' URL="%s"' % url
text += " ]"
self.write(' "%s" %s;\n' % (esc(node_id), text))
self.write(' "%s" %s;\n' % (node_id, text))
def add_link(self, id1, id2, style="", head="", tail="", comment=""):
"""
@@ -587,7 +583,7 @@ class GVDocBase(BaseDoc, GVDoc):
Implements GVDocBase.add_link().
"""
self.write(' "%s" -> "%s"' % (esc(id1), esc(id2)))
self.write(' "%s" -> "%s"' % (id1, id2))
if style or head or tail:
self.write(' [')
@@ -639,7 +635,7 @@ class GVDocBase(BaseDoc, GVDoc):
Implements GVDocBase.add_samerank().
"""
self.write(' {rank=same "%s" "%s"}\n' % (esc(id1), esc(id2)))
self.write(' {rank=same "%s" "%s"}\n' % (id1, id2))
def rewrite_label(self, id, label):
"""
@@ -647,7 +643,7 @@ class GVDocBase(BaseDoc, GVDoc):
Implements GVDocBase.rewrite_label().
"""
self.write(' "%s" [label = "%s"]\n' % (esc(id), label))
self.write(' "%s" [label = "%s"]\n' % (id, label))
def start_subgraph(self, graph_id):
""" Implement GVDocBase.start_subgraph() """
+63 -3
View File
@@ -46,8 +46,14 @@ from ..menu import NumberOption, TextOption, EnumeratedListOption
from ...constfunc import win
from ...config import config
from ...const import GRAMPS_LOCALE as glocale
from ...utils.grampslocale import GrampsLocale
_ = glocale.translation.gettext
LOCALE = GrampsLocale(lang='en')
LATIN = ['french', 'italian', 'spanish']
LANG_SUPPORT = ['danish', 'dutch', 'german', 'swedish'] + LATIN
#-------------------------------------------------------------------------
#
# set up logging
@@ -302,7 +308,7 @@ class TreeDocBase(BaseDoc, TreeDoc):
name = paper_size.get_name().lower()
if name == 'custom size':
width = str(paper_size.get_width())
height = str(paper_size.get_height())
height = str(paper_size.get_width())
paper = 'papersize={%scm,%scm}' % (width, height)
elif name in ('a', 'b', 'c', 'd', 'e'):
paper = 'ansi' + name + 'paper'
@@ -339,6 +345,14 @@ class TreeDocBase(BaseDoc, TreeDoc):
self.write(0, '\\usepackage[%s,%s]{geometry}\n' % (paper, margin))
self.write(0, '\\usepackage[all]{genealogytree}\n')
self.write(0, '\\usepackage{color}\n')
trans = glocale.language[0][:2]
lang = LOCALE._get_language_string(trans).lower()
if lang in LANG_SUPPORT:
self.write(0, '\\gtrset{language=%s}\n' % lang)
if lang in LATIN:
self.write(0, '\\IfFileExists{lmodern.sty}{\n')
self.write(0, ' \\usepackage{lmodern}\n')
self.write(0, '}{}\n')
self.write(0, '\\begin{document}\n')
if self.nodecolor == 'preferences':
@@ -460,7 +474,8 @@ class TreeDocBase(BaseDoc, TreeDoc):
if os.path.isfile(path):
if win():
path = path.replace('\\', '/')
self.write(level+1, 'image = {%s},\n' % path)
self.write(level+1, 'image = {{%s}%s},\n' %
os.path.splitext(path))
break # first image only
self.write(level, '}\n')
@@ -518,7 +533,6 @@ class TreeDocBase(BaseDoc, TreeDoc):
date_str = date_str + '/' + stop_date
place = escape(_pd.display_event(db, event))
place = place.replace("-", "\--")
if modifier:
event_type += '+'
@@ -586,6 +600,47 @@ class TreeDocBase(BaseDoc, TreeDoc):
self.write_end()
#------------------------------------------------------------------------------
#
# TreeGraphDoc
#
#------------------------------------------------------------------------------
class TreeGraphDoc(TreeDocBase):
"""
TreeGraphDoc implementation that generates a .graph file.
"""
def write_start(self):
"""
Write the start of the document - nothing for a graph file.
"""
pass
def start_tree(self, option_list):
"""
Write the start of a tree - nothing for a graph file.
"""
pass
def end_tree(self):
"""
Write the end of a tree - nothing for a graph file.
"""
pass
def write_end(self):
"""
Write the end of the document - nothing for a graph file.
"""
pass
def close(self):
""" Implements TreeDocBase.close() """
TreeDocBase.close(self)
with open(self._filename, 'w', encoding='utf-8') as texfile:
texfile.write(self._tex.getvalue())
#------------------------------------------------------------------------------
#
# TreeTexDoc
@@ -653,6 +708,11 @@ if _LATEX_FOUND:
'mime' : "application/pdf",
'class': TreePdfDoc}]
FORMATS += [{'type' : "graph",
'ext' : "graph",
'descr': _("Graph File for genealogytree"),
'class': TreeGraphDoc}]
FORMATS += [{'type' : "tex",
'ext' : "tex",
'descr': _("LaTeX File"),
-3
View File
@@ -62,7 +62,6 @@ class EnumeratedListOption(Option):
:type value: int
:return: nothing
"""
self.ini_value = value
Option.__init__(self, label, value)
self.__items = []
self.__xml_items = []
@@ -139,8 +138,6 @@ class EnumeratedListOption(Option):
"""
if value in (v for v, d in self.__items):
Option.set_value(self, value)
elif value == self.ini_value:
return
else:
logging.warning(_("Value '%(val)s' not found for option '%(opt)s'") %
{'val' : str(value), 'opt' : self.get_label()})
-5
View File
@@ -769,7 +769,6 @@ def sanitize_citation(db, citation):
new_citation.set_gramps_id(citation.get_gramps_id())
new_citation.set_handle(citation.get_handle())
new_citation.set_change_time(citation.get_change_time())
new_citation.set_tag_list(citation.get_tag_list())
copy_srcattributes(db, citation, new_citation)
copy_notes(db, citation, new_citation)
copy_media_ref_list(db, citation, new_citation)
@@ -915,7 +914,6 @@ def sanitize_source(db, source):
new_source.set_gramps_id(source.get_gramps_id())
new_source.set_handle(source.get_handle())
new_source.set_change_time(source.get_change_time())
new_source.set_tag_list(source.get_tag_list())
for repo_ref in source.get_reporef_list():
if repo_ref and not repo_ref.get_privacy():
@@ -989,7 +987,6 @@ def sanitize_place(db, place):
new_place.set_type(place.get_type())
new_place.set_code(place.get_code())
new_place.set_placeref_list(place.get_placeref_list())
new_place.set_tag_list(place.get_tag_list())
copy_citation_ref_list(db, place, new_place)
copy_notes(db, place, new_place)
@@ -1020,7 +1017,6 @@ def sanitize_event(db, event):
new_event.set_handle(event.get_handle())
new_event.set_date_object(event.get_date_object())
new_event.set_change_time(event.get_change_time())
new_event.set_tag_list(event.get_tag_list())
copy_citation_ref_list(db, event, new_event)
copy_notes(db, event, new_event)
@@ -1124,7 +1120,6 @@ def sanitize_repository(db, repository):
new_repository.set_gramps_id(repository.get_gramps_id())
new_repository.set_handle(repository.get_handle())
new_repository.set_change_time(repository.get_change_time())
new_repository.set_tag_list(repository.get_tag_list())
copy_notes(db, repository, new_repository)
copy_addresses(db, repository, new_repository)
+1 -1
View File
@@ -346,7 +346,7 @@ class ReferencedBySelectionProxyDb(ProxyDbBase):
for tag in note.text.get_tags():
if tag.name == 'Link':
if tag.value.startswith("gramps://"):
obj_class, prop, value = tag.value[9:].split("/", 2)
obj_class, prop, value = tag.value[9:].split("/")
if obj_class == "Media": # bug6493
obj_class = "Media"
if prop == "handle":
-2
View File
@@ -142,8 +142,6 @@ class ProbablyAlive:
# person died more than MAX after current year
if death_date.is_valid():
birth_date = death_date.copy_offset_ymd(year=-self.MAX_AGE_PROB_ALIVE)
else:
birth_date = death_date
explain = _("death date")
if not death_date and birth_date:
+6 -10
View File
@@ -324,16 +324,12 @@ class Callback:
return
# Check signal exists
frame = inspect.currentframe()
c_frame = frame.f_back
c_code = c_frame.f_code
frame_info = (c_code.co_filename, c_frame.f_lineno, c_code.co_name)
if signal_name not in self.__signal_map:
self._warn("Attempt to emit to unknown signal: %s\n"
" from: file: %s\n"
" line: %d\n"
" func: %s\n"
% ((str(signal_name), ) + frame_info))
% ((str(signal_name), ) + inspect.stack()[1][1:4]))
return
# check that the signal is not already being emitted. This prevents
@@ -344,7 +340,7 @@ class Callback:
" from: file: %s\n"
" line: %d\n"
" func: %s\n"
% ((str(signal_name), ) + frame_info))
% ((str(signal_name), ) + inspect.stack()[1][1:4]))
return
try:
@@ -362,7 +358,7 @@ class Callback:
" from: file: %s\n"
" line: %d\n"
" func: %s\n"
% ((str(signal_name), ) + frame_info))
% ((str(signal_name), ) + inspect.stack()[1][1:4]))
return
# type check arguments
@@ -373,7 +369,7 @@ class Callback:
" from: file: %s\n"
" line: %d\n"
" func: %s\n"
% ((str(signal_name), ) + frame_info))
% ((str(signal_name), ) + inspect.stack()[1][1:4]))
return
if len(args) > 0:
@@ -383,7 +379,7 @@ class Callback:
" from: file: %s\n"
" line: %d\n"
" func: %s\n"
% ((str(signal_name), ) + frame_info))
% ((str(signal_name), ) + inspect.stack()[1][1:4]))
return
if arg_types is not None:
@@ -395,7 +391,7 @@ class Callback:
" line: %d\n"
" func: %s\n"
" arg passed was: %s, type of arg passed %s, type should be: %s\n"
% ((str(signal_name), ) + frame_info +\
% ((str(signal_name), ) + inspect.stack()[1][1:4] +\
(args[i], repr(type(args[i])), repr(arg_types[i]))))
return
if signal_name in self.__callback_map:
+1 -1
View File
@@ -49,7 +49,7 @@ class CSVTab(TabbedDoc):
else:
self.filename = filename
self.f = open(self.filename, "w", newline='',
self.f = open(self.filename, "w",
encoding='utf_8_sig' if win() else 'utf_8')
self.writer = csv.writer(self.f)
+1 -3
View File
@@ -117,7 +117,7 @@ _LOCALE_NAMES = {
_RTL_LOCALES = ('ar', 'he')
# locales with less than 70% currently translated
INCOMPLETE_TRANSLATIONS = ('ar', 'bg', 'sq', 'ta', 'tr', 'zh_HK', 'zh_TW')
INCOMPLETE_TRANSLATIONS = ('ar', 'bg', 'he', 'ja', 'sq', 'ta', 'tr')
def _check_mswin_locale(locale):
msloc = None
@@ -525,8 +525,6 @@ class GrampsLocale:
# with locale instead of gettext. Win32 doesn't support bindtextdomain.
if self.localedir:
if not sys.platform == 'win32':
# bug12278, _build_popup_ui() under linux and macOS
locale.textdomain(self.localedomain)
locale.bindtextdomain(self.localedomain, self.localedir)
else:
self._win_bindtextdomain(self.localedomain.encode('utf-8'),
+2 -2
View File
@@ -161,12 +161,12 @@ def image_size(source):
:returns: a tuple consisting of the width and height
"""
from gi.repository import GdkPixbuf
from gi.repository import GObject
from gi.repository import GLib
try:
img = GdkPixbuf.Pixbuf.new_from_file(source)
width = img.get_width()
height = img.get_height()
except GObject.GError:
except GLib.GError:
width = 0
height = 0
return (width, height)
+4 -4
View File
@@ -36,7 +36,7 @@ from hashlib import md5
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
from gi.repository import GObject
from gi.repository import GLib
from gi.repository import GdkPixbuf
try:
@@ -98,7 +98,7 @@ def __get_gconf_string(key):
"""
try:
val = CLIENT.get_string(key)
except GObject.GError:
except GLib.GError:
val = None
return str(val)
@@ -119,7 +119,7 @@ def __get_gconf_bool(key):
"""
try:
val = CLIENT.get_bool(key)
except GObject.GError:
except GLib.GError:
val = None
return val
@@ -318,7 +318,7 @@ def get_thumbnail_image(src_file, mtype=None, rectangle=None, size=SIZE_NORMAL):
try:
filename = get_thumbnail_path(src_file, mtype, rectangle, size)
return GdkPixbuf.Pixbuf.new_from_file(filename)
except (GObject.GError, OSError):
except (GLib.GError, OSError):
if mtype:
return find_mime_type_pixbuf(mtype)
else:
+12 -36
View File
@@ -126,33 +126,16 @@ if win():
pass # ok
elif not os.path.isdir(HOME_DIR):
os.makedirs(HOME_DIR)
sys.stdout = sys.stderr = open(logfile, "w", encoding='utf-8')
# macOS sets stderr to /dev/null when running without a terminal,
# e.g. if Gramps.app is lauched by double-clicking on it in
# finder. Write to a file instead.
if mac() and not sys.stdin.isatty():
from tempfile import gettempdir
sys.stdout = sys.stderr = open(logfile, "w")
stderrh = logging.StreamHandler(sys.stderr)
stderrh.setFormatter(form)
stderrh.setLevel(logging.DEBUG)
log_file_name = 'gramps-' + str(os.getpid()) + '.log'
log_file_path = os.path.join(gettempdir(), log_file_name)
log_file_handler = logging.FileHandler(log_file_path, mode='a',
encoding='utf-8')
log_file_handler.setFormatter(form)
log_file_handler.setLevel(logging.DEBUG)
logger = logging.getLogger()
logger.setLevel(logging.WARNING)
logger.addHandler(log_file_handler)
else:
stderrh = logging.StreamHandler(sys.stderr)
stderrh.setFormatter(form)
stderrh.setLevel(logging.DEBUG)
# Setup the base level logger, this one gets
# everything.
l = logging.getLogger()
l.setLevel(logging.WARNING)
l.addHandler(stderrh)
# Setup the base level logger, this one gets
# everything.
l = logging.getLogger()
l.setLevel(logging.WARNING)
l.addHandler(stderrh)
def exc_hook(err_type, value, t_b):
@@ -325,16 +308,9 @@ def show_settings():
.replace('(', '').replace(')', '')
bsddb_location_str = bsddb.__file__
except:
try:
import berkeleydb as bsddb
bsddb_str = bsddb.__version__
bsddb_db_str = str(bsddb.db.version()).replace(', ', '.')\
.replace('(', '').replace(')', '')
bsddb_location_str = bsddb.__file__
except:
bsddb_str = 'not found'
bsddb_db_str = 'not found'
bsddb_location_str = 'not found'
bsddb_str = 'not found'
bsddb_db_str = 'not found'
bsddb_location_str = 'not found'
try:
import sqlite3
+1 -5
View File
@@ -68,11 +68,7 @@ try:
import bsddb3 as bsddb ## ok, in try/except
BSDDB_STR = ellipses(str(bsddb.__version__) + " " + str(bsddb.db.version()))
except:
try:
import berkeleydb as bsddb
BSDDB_STR = ellipses(str(bsddb.__version__) + " " + str(bsddb.db.version()))
except:
BSDDB_STR = 'not found'
BSDDB_STR = 'not found'
try:
import sqlite3
+21 -38
View File
@@ -471,36 +471,27 @@ class ClipCitation(ClipHandleWrapper):
def refresh(self):
if self._handle:
try:
citation = clipdb.get_citation_from_handle(self._handle)
if citation:
self._title = citation.get_gramps_id()
notelist = list(map(clipdb.get_note_from_handle,
citation.get_note_list()))
srctxtlist = [note for note in notelist
if note.get_type() == NoteType.SOURCE_TEXT]
page = citation.get_page()
if not page:
page = _('not available|NA')
text = ""
if srctxtlist:
text = " ".join(srctxtlist[0].get().split())
#String must be unicode for truncation to work for non
#ascii characters
text = str(text)
if len(text) > 60:
text = text[:60] + "..."
self._value = _("Volume/Page: %(pag)s -- %(sourcetext)s"
) % { 'pag' : page,
'sourcetext' : text}
except:
# We are in the Source tree view. The shortcuts only
# work for citations.
print("We cannot copy the source from this view."
" Use drag and drop.")
self._title = self._value = ''
self._pickle = self._type = self._objclass = None
self._handle = self._dbid = self._dbname = None
citation = clipdb.get_citation_from_handle(self._handle)
if citation:
self._title = citation.get_gramps_id()
notelist = list(map(clipdb.get_note_from_handle,
citation.get_note_list()))
srctxtlist = [note for note in notelist
if note.get_type() == NoteType.SOURCE_TEXT]
page = citation.get_page()
if not page:
page = _('not available|NA')
text = ""
if srctxtlist:
text = " ".join(srctxtlist[0].get().split())
#String must be unicode for truncation to work for non
#ascii characters
text = str(text)
if len(text) > 60:
text = text[:60] + "..."
self._value = _("Volume/Page: %(pag)s -- %(sourcetext)s") % {
'pag' : page,
'sourcetext' : text}
class ClipRepoRef(ClipObjWrapper):
@@ -1290,14 +1281,6 @@ class ClipboardListView:
model.insert_before(node, data)
else:
model.insert_after(node, data)
elif isinstance(data[1], ClipCitation):
if data[3]:
# we have a real citation
model.append(data)
#else:
# We are in a Source treeview and trying
# to copy a source with a shortcut.
# Use drag and drop to do that.
else:
model.append(data)
+14 -23
View File
@@ -690,7 +690,7 @@ class GrampsPreferences(ConfigureDialog):
hbox.pack_start(lwidget, False, False, 0)
hbox.pack_start(self.color_scheme_box, False, False, 0)
restore_btn = Gtk.Button(_('Restore to defaults'))
restore_btn = Gtk.Button(label=_('Restore to defaults'))
restore_btn.set_tooltip_text(
_('Restore colors for current theme to default.'))
restore_btn.connect('clicked', self.restore_colors)
@@ -1241,7 +1241,7 @@ class GrampsPreferences(ConfigureDialog):
row, 'preferences.place-auto', start=0, stop=1,
extra_callback=self.auto_title_changed,
tooltip=_("Enables automatic place title generation "
"using specified format."))
"using specifed format."))
self.auto_title_changed(cb_widget)
hbox.pack_start(self.pformat, True, True, 0)
hbox.pack_start(self.fmt_btn, False, False, 0)
@@ -1573,7 +1573,7 @@ class GrampsPreferences(ConfigureDialog):
self.add_checkbox(grid, _('Add tag on import'), current_line,
cb_const, stop=2,
extra_callback=self.toggle_tag_on_import,
tooltip=_("Specified tag will be added on import.\n"
tooltip=_("Specifed tag will be added on import.\n"
"Clear to set default value."))
grid.attach(self.tag_format_entry, 2, current_line, 1, 1)
@@ -1828,12 +1828,10 @@ class GrampsPreferences(ConfigureDialog):
Show dialog to choose media directory.
"""
f = Gtk.FileChooserDialog(title=_("Select media directory"),
parent=self.window,
action=Gtk.FileChooserAction.SELECT_FOLDER,
buttons=(_('_Cancel'),
Gtk.ResponseType.CANCEL,
_('_Apply'),
Gtk.ResponseType.OK))
transient_for=self.window,
action=Gtk.FileChooserAction.SELECT_FOLDER)
f.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
_('_Apply'), Gtk.ResponseType.OK)
mpath = media_path(self.dbstate.db)
f.set_current_folder(os.path.dirname(mpath))
@@ -1878,12 +1876,10 @@ class GrampsPreferences(ConfigureDialog):
Show dialog to choose backup directory.
"""
f = Gtk.FileChooserDialog(title=_("Select backup directory"),
parent=self.window,
action=Gtk.FileChooserAction.SELECT_FOLDER,
buttons=(_('_Cancel'),
Gtk.ResponseType.CANCEL,
_('_Apply'),
Gtk.ResponseType.OK))
transient_for=self.window,
action=Gtk.FileChooserAction.SELECT_FOLDER)
f.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
_('_Apply'), Gtk.ResponseType.OK)
backup_path = config.get('database.backup-path')
if not backup_path:
backup_path = config.get('database.path')
@@ -2163,11 +2159,9 @@ class GrampsPreferences(ConfigureDialog):
scrollw.set_size_request(600, 100)
text = Gtk.Label()
text.set_line_wrap(True)
font_description = Pango.font_description_from_string(font)
text.modify_font(font_description)
self.activate_change_font()
text.set_halign(Gtk.Align.START)
text.set_text(my_characters)
text.set_markup("<span font='%s'>%s</span>" % (font, my_characters))
scrollw.add(text)
scrollw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
self.grid.attach(scrollw, 1, 7, 8, 1)
@@ -2180,12 +2174,9 @@ class GrampsPreferences(ConfigureDialog):
my_characters += symbols.get_death_symbol_for_char(death_symbl)
text = Gtk.Label()
text.set_line_wrap(True)
font_description = Pango.font_description_from_string(font)
text.modify_font(font_description)
text.set_halign(Gtk.Align.START)
text.set_markup("<big><big><big><big>" +
my_characters +
"</big></big></big></big>")
text.set_markup("<big><big><big><big><span font='%s'>%s</span>"
"</big></big></big></big>" % (font, my_characters))
self.grid.attach(text, 1, 8, 8, 1)
scrollw.show_all()
text.show_all()
+6 -10
View File
@@ -317,13 +317,6 @@ def add_all_files_filter(chooser):
mime_filter.add_pattern('*')
chooser.add_filter(mime_filter)
def icase(ext):
"""
Return a glob reresenting a case insensitive file extension.
"""
return ''.join(['[{}{}]'.format(s.lower(), s.upper()) for s in ext])
#-------------------------------------------------------------------------
#
# Format selectors: explictly set the format of the file
@@ -387,7 +380,7 @@ class GrampsLoginDialog(ManagedWindow):
self.title = _("Login")
ManagedWindow.__init__(self, uistate, [], self.__class__, modal=True)
dialog = Gtk.Dialog(parent=uistate.window)
dialog = Gtk.Dialog(transient_for=uistate.window)
grid = Gtk.Grid()
grid.set_border_width(6)
grid.set_row_spacing(6)
@@ -453,7 +446,8 @@ class GrampsImportFileDialog(ManagedWindow):
file_filter = Gtk.FileFilter()
name = "%s (.%s)" % (plugin.get_name(), plugin.get_extension())
file_filter.set_name(name)
file_filter.add_pattern("*.%s" % icase(plugin.get_extension()))
file_filter.add_pattern("*.%s" % plugin.get_extension())
file_filter.add_pattern(plugin.get_extension().capitalize())
import_dialog.add_filter(file_filter)
(box, type_selector) = format_maker()
@@ -532,7 +526,7 @@ class GrampsImportFileDialog(ManagedWindow):
return True
else:
try:
f = open(filename, 'w')
f = file(filename,'w')
f.close()
os.remove(filename)
except IOError:
@@ -548,6 +542,7 @@ class GrampsImportFileDialog(ManagedWindow):
self.import_info = None
self._begin_progress()
self.uistate.set_sensitive(False)
self.uistate.viewmanager.enable_menu(False)
try:
#an importer can return an object with info, object.info_text()
@@ -568,6 +563,7 @@ class GrampsImportFileDialog(ManagedWindow):
except Exception:
_LOG.error("Failed to import database.", exc_info=True)
self.uistate.set_sensitive(True)
self.uistate.viewmanager.enable_menu(True)
self._end_progress()
def build_menu_names(self, obj): # this is meaningless since it's modal
+1 -1
View File
@@ -1013,7 +1013,7 @@ class DbManager(CLIDbManager, ManagedWindow):
"""
Handle the reception of drag data
"""
drag_value = selection.get_data().decode().strip(' \r\n\x00')
drag_value = selection.get_data().decode()
fname = None
type = None
title = None
+1 -4
View File
@@ -520,10 +520,7 @@ class DisplayState(Callback):
history.push(handle)
def set_sensitive(self, state):
tbar = self.uimanager.get_widget('ToolBar')
tbar.set_sensitive(state)
self.viewmanager.hpane.set_sensitive(state)
self.uimanager.enable_all_actions(state)
self.window.set_sensitive(state)
def db_changed(self, db):
db.connect('long-op-start', self.progress_monitor.add_op)
@@ -46,7 +46,7 @@ from html import escape
#
#-------------------------------------------------------------------------
from ...widgets.undoablebuffer import UndoableBuffer
from gramps.gen.lib import (EventRoleType, EventType, Date)
from gramps.gen.lib import EventRoleType
from gramps.gen.datehandler import get_date, get_date_valid
from gramps.gen.config import config
from gramps.gen.utils.db import get_participant_from_event
@@ -175,12 +175,7 @@ class EventRefModel(Gtk.TreeStore):
"""
date = event.get_date_object()
if date and self.start_date:
if (date == self.start_date and date.modifier == Date.MOD_NONE
and not (event.get_type().is_death_fallback() or
event.get_type() == EventType.DEATH)):
return ""
else:
return (date - self.start_date).format(precision=age_precision)
return (date - self.start_date).format(precision=age_precision)
else:
return ""
+9 -10
View File
@@ -38,7 +38,7 @@ from gramps.gen.lib import EventType, NoteType
from gramps.gen.db import DbTxn
from ..glade import Glade
from .displaytabs import (CitationEmbedList, NoteTab, GalleryTab,
EventBackRefList, EventAttrEmbedList)
EventBackRefList, AttrEmbedList)
from ..widgets import (PrivacyButton, MonitoredEntry,
MonitoredDate, MonitoredDataType, MonitoredTagList)
from .editreference import RefTab, EditReference
@@ -209,10 +209,10 @@ class EditEventRef(EditReference):
self._add_tab(notebook, self.srcref_list)
self.track_ref_for_deletion("srcref_list")
self.attr_list = EventAttrEmbedList(self.dbstate,
self.uistate,
self.track,
self.source.get_attribute_list())
self.attr_list = AttrEmbedList(self.dbstate,
self.uistate,
self.track,
self.source.get_attribute_list())
self._add_tab(notebook, self.attr_list)
self.track_ref_for_deletion("attr_list")
@@ -247,11 +247,10 @@ class EditEventRef(EditReference):
self._add_tab(notebook, self.backref_tab)
self.track_ref_for_deletion("backref_tab")
self.attr_ref_list = EventAttrEmbedList(
self.dbstate,
self.uistate,
self.track,
self.source_ref.get_attribute_list())
self.attr_ref_list = AttrEmbedList(self.dbstate,
self.uistate,
self.track,
self.source_ref.get_attribute_list())
self._add_tab(notebook_ref, self.attr_ref_list)
self.track_ref_for_deletion("attr_ref_list")
+3 -9
View File
@@ -366,7 +366,6 @@ class EditName(EditSecondary):
5/ local set, not global set --> set (change local)
6/ local set, global set --> set (set to global if possible)
"""
ngm = False # name group mapping setting
closeit = True
surname = self.obj.get_primary_surname().get_surname()
group_as= self.obj.get_group_as()
@@ -389,7 +388,7 @@ class EditName(EditSecondary):
val = q.run()
if val:
#delete the grouping link on database
ngm = None # delay setting until dialog closes
self.db.set_name_group_mapping(surname, None)
self.obj.set_group_as("")
else :
closeit = False
@@ -422,9 +421,9 @@ class EditName(EditSecondary):
val = q.run()
if val:
if group_as == surname :
ngm = None # delay setting until dialog closes
self.db.set_name_group_mapping(surname, None)
else:
ngm = group_as # delay setting until dialog closes
self.db.set_name_group_mapping(surname, group_as)
self.obj.set_group_as("")
else:
if self.global_group_set :
@@ -456,15 +455,10 @@ class EditName(EditSecondary):
pass
if closeit:
db = self.db # close cleanup loses self.db, so save for later
if self.callback:
self.callback(self.obj)
self.callback = None
self.close()
# bug 12328 to avoid gui interaction during view rebuild, delay
# the rebuild until closeing this dialog
if ngm is not False:
db.set_name_group_mapping(surname, ngm)
def _cleanup_on_exit(self):
"""
+7 -6
View File
@@ -42,6 +42,7 @@ import pickle
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Pango
from gi.repository.GLib import markup_escape_text
#-------------------------------------------------------------------------
#
@@ -435,7 +436,6 @@ class EditPerson(EditPrimary):
obj.connect('changed', self._changed_name)
self.preview_name = self.top.get_object("full_name")
self.preview_name.override_font(Pango.FontDescription('sans bold 12'))
self.surntab = SurnameTab(self.dbstate, self.uistate, self.track,
self.obj.get_primary_name(),
on_change=self._changed_name)
@@ -550,7 +550,9 @@ class EditPerson(EditPrimary):
Update the window title, and default name in name tab
"""
self.update_title(self.get_menu_title())
self.preview_name.set_text(self.get_preview_name())
self.preview_name.set_markup(
"<span size='x-large' weight='bold'>%s</span>" %
markup_escape_text(self.get_preview_name(), -1))
self.name_list.update_defname()
def name_callback(self):
@@ -638,7 +640,6 @@ class EditPerson(EditPrimary):
"""
self.imgmenu = Gtk.Menu()
menu = self.imgmenu
menu.set_title(_("Media Object"))
obj = self.db.get_media_from_handle(photo.get_reference_handle())
if obj:
add_menuitem(menu, _("View"), photo,
@@ -1086,9 +1087,9 @@ class EditPerson(EditPrimary):
class GenderDialog(Gtk.MessageDialog):
def __init__(self, parent=None):
Gtk.MessageDialog.__init__(self,
parent,
flags=Gtk.DialogFlags.MODAL,
type=Gtk.MessageType.QUESTION,
transient_for=parent,
modal=True,
message_type=Gtk.MessageType.QUESTION,
)
self.set_icon(ICON)
self.set_title('')
+3 -36
View File
@@ -186,43 +186,10 @@ class EditPlace(EditPrimary):
self.db.readonly)
def set_latlongitude(self, value):
"""
This method is useful for directly copying the coordinates
of openstreetmap, googlemaps, and perhaps other if they
provide coordinates like it is define in conv_lat_lon
(see gramps/gen/utils/place.py)
To copy the coordinates:
- openstreetmap:
1 - choose the place where you want to save the coordinates.
2 - right click on this place
3 - select "show address"
4 - On the left side of the map, copy the coordinates of
"Result from internal"
5 - In the latlon field of the edit place window of gramps,
type <CTRL> V
- googlemap:
1 - choose the place where you want to save the coordinates.
2 - right click on this place
3 - select the coordinates at the top of the popup window.
They are automaticaly copied.
4 - In the latlon field of the edit place window of gramps,
type <CTRL> V
"""
try:
# Bug 12349, 12374
parts = value.split(', ')
if len(parts) == 2:
latitude = parts[0].strip().replace(',', '.')
longitude = parts[1].strip().replace(',', '.')
else:
latitude, longitude = value.split(',')
self.longitude.set_text(longitude)
self.latitude.set_text(latitude)
coma = value.index(',')
self.longitude.set_text(value[coma+1:].strip())
self.latitude.set_text(value[:coma].strip())
self.top.get_object("lat_entry").validate(force=True)
self.top.get_object("lon_entry").validate(force=True)
self.obj.set_latitude(self.latitude.get_value())
+3 -10
View File
@@ -180,16 +180,9 @@ class EditPlaceRef(EditReference):
def set_latlongitude(self, value):
try:
# Bug 12349, 12374
parts = value.split(', ')
if len(parts) == 2:
latitude = parts[0].strip().replace(',', '.')
longitude = parts[1].strip().replace(',', '.')
else:
latitude, longitude = value.split(',')
self.longitude.set_text(longitude)
self.latitude.set_text(latitude)
coma = value.index(',')
self.longitude.set_text(value[coma+1:].strip())
self.latitude.set_text(value[:coma].strip())
self.top.get_object("lat_entry").validate(force=True)
self.top.get_object("lon_entry").validate(force=True)
self.source.set_latitude(self.latitude.get_value())
+1 -1
View File
@@ -101,7 +101,7 @@ class EditTagList(ManagedWindow):
Create a dialog box to select tags.
"""
# pylint: disable-msg=E1101
top = Gtk.Dialog(parent=self.uistate.window)
top = Gtk.Dialog(transient_for=self.uistate.window)
top.vbox.set_spacing(5)
columns = [('', -1, 300),
+3 -5
View File
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.2 -->
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.10"/>
<requires lib="grampswidgets" version="0.0"/>
<object class="GtkDialog" id="editplace">
<property name="can_focus">False</property>
<property name="type_hint">dialog</property>
<child type="titlebar">
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox19">
<property name="visible">True</property>
@@ -103,7 +101,7 @@
<child>
<object class="GtkLabel" id="comment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Either use the two fields below to enter coordinates (latitude and longitude),</property>
<property name="hexpand">True</property>
+1 -1
View File
@@ -618,7 +618,7 @@ class Gramps:
and not gettext.find(GTK_GETTEXT_DOMAIN)):
_display_gtk_gettext_message(parent=self._vm.window)
#_display_welcome_message(parent=self._vm.window)
_display_welcome_message(parent=self._vm.window)
_display_translator_message(parent=self._vm.window)
+2 -2
View File
@@ -233,7 +233,7 @@ class ListModel:
new_value = not self.model[path][col]
self.model[path][col] = new_value
if col in self.function:
self.function[col](path, new_value)
self.function[col](int(path), new_value)
def __edited_cb(self, cell, path, new_text, col):
"""
@@ -241,7 +241,7 @@ class ListModel:
"""
self.model[path][col] = new_text
if col in self.function:
self.function[col](path, new_text)
self.function[col](int(path), new_text)
def unselect(self):
"""
+22 -19
View File
@@ -37,11 +37,7 @@ try:
import bsddb3 as bsddb # ok, in try/except
BSDDB_STR = str(bsddb.__version__) + " " + str(bsddb.db.version())
except:
try:
import berkeleydb as bsddb
BSDDB_STR = str(bsddb.__version__) + " " + str(bsddb.db.version())
except:
BSDDB_STR = 'not found'
BSDDB_STR = 'not found'
try:
import sqlite3
@@ -288,7 +284,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"information included in the error please remove "
"it."))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
swin = Gtk.ScrolledWindow()
@@ -304,9 +301,9 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
sw_frame = Gtk.Frame()
sw_frame.add(swin)
reset = Gtk.Button("Reset")
reset = Gtk.Button(label="Reset")
reset.connect('clicked', self._reset_error_details)
clear = Gtk.Button("Clear")
clear = Gtk.Button(label="Clear")
clear.connect('clicked', self._clear_error_details)
button_box = Gtk.ButtonBox()
@@ -368,7 +365,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"remove anything that you would rather not have "
"included in the bug report."))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
swin = Gtk.ScrolledWindow()
@@ -384,9 +382,9 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
sw_frame = Gtk.Frame()
sw_frame.add(swin)
reset = Gtk.Button("Reset")
reset = Gtk.Button(label="Reset")
reset.connect('clicked', self._reset_sys_information)
clear = Gtk.Button("Clear")
clear = Gtk.Button(label="Clear")
clear.connect('clicked', self._clear_sys_information)
@@ -445,7 +443,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"can about what you were doing when the error "
"occurred."))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
swin = Gtk.ScrolledWindow()
@@ -460,7 +459,7 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
sw_frame = Gtk.Frame()
sw_frame.add(swin)
clear = Gtk.Button("Clear")
clear = Gtk.Button(label="Clear")
clear.connect('clicked', self._clear_user_information)
button_box = Gtk.ButtonBox()
@@ -518,7 +517,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"that it does not contain anything that you do not "
"want to be sent to the developers."))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
swin = Gtk.ScrolledWindow()
@@ -584,7 +584,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"clipboard and then open a webbrowser to file a bug report at "),
URL_BUGTRACKER))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
label.set_use_markup(True)
@@ -593,11 +594,12 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"and file a bug report on the Gramps bug "
"tracking system."))
url_label.set_halign(Gtk.Align.START)
url_label.set_padding(0, 4)
url_label.set_margin_top(4)
url_label.set_margin_bottom(4)
url_label.set_line_wrap(True)
url_label.set_size_request(200, -1)
url_button = Gtk.Button("File bug report")
url_button = Gtk.Button(label="File bug report")
url_button.connect('clicked', self._start_gramps_bts_in_browser)
url_button_vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
url_button_vbox.pack_start(url_button, True, False, 0)
@@ -617,11 +619,12 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"the button below, paste the report and click "
"submit report"))
clip_label.set_halign(Gtk.Align.START)
clip_label.set_padding(0, 4)
clip_label.set_margin_top(4)
clip_label.set_margin_bottom(4)
clip_label.set_line_wrap(True)
clip_label.set_size_request(200, -1)
clip_button = Gtk.Button("Copy to clipboard")
clip_button = Gtk.Button(label="Copy to clipboard")
clip_button.connect('clicked', self._copy_to_clipboard)
clip_button_vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
clip_button_vbox.pack_start(clip_button, True, False, 0)
+1 -1
View File
@@ -105,7 +105,7 @@ class ErrorView(ManagedWindow):
def draw_window(self):
title = "%s - Gramps" % _("Error Report")
self.top = Gtk.Dialog(title)
self.top = Gtk.Dialog(title=title)
# look over the top level windows, it seems the oldest come first, so
# the most recent still visible window appears to be a good choice for
# a transient parent
-22
View File
@@ -32,14 +32,6 @@ the create/deletion of dialog windows.
import os
from io import StringIO
import html
import logging
#-------------------------------------------------------------------------
#
# Set up logging
#
#-------------------------------------------------------------------------
_LOG = logging.getLogger(".")
#-------------------------------------------------------------------------
#
# GNOME/GTK
@@ -583,9 +575,6 @@ class ManagedWindow:
Takes care of closing children and removing itself from menu.
"""
if hasattr(self, 'opened') and not self.opened:
_LOG.warning("Tried to close a ManagedWindow more than once.")
return # in case close somehow gets called again
self.opened = False
self._save_position(save_config=False) # the next line will save it
self._save_size()
@@ -633,17 +622,6 @@ class ManagedWindow:
if self.horiz_position_key is not None:
horiz_position = config.get(self.horiz_position_key)
vert_position = config.get(self.vert_position_key)
# make sure some of left side shows on screen
# for part time multi monitor setups
screen = Gtk.Window().get_screen()
s_width = screen.get_width()
s_height = screen.get_height()
if horiz_position > s_width - 50 or vert_position > s_height - 50:
(p_width, p_height) = self.parent_window.get_size()
(p_horiz, p_vert) = self.parent_window.get_position()
(w_width, w_height) = self.window.get_size()
horiz_position = p_horiz + ((p_width - w_width) // 2)
vert_position = p_vert + ((p_height - w_height) // 2)
self.window.move(horiz_position, vert_position)
def _save_position(self, save_config=True):
+11 -13
View File
@@ -75,16 +75,17 @@ class LastNameDialog(ManagedWindow):
def __init__(self, database, uistate, track, surnames, skip_list=set()):
ManagedWindow.__init__(self, uistate, track, self, modal=True)
flags = Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT
buttons = (_('_Cancel'), Gtk.ResponseType.REJECT,
_('_OK'), Gtk.ResponseType.ACCEPT)
self.__dlg = Gtk.Dialog(None, uistate.window, flags, buttons)
self.__dlg = Gtk.Dialog(
transient_for=uistate.window, destroy_with_parent=True,
modal=True)
self.__dlg.add_buttons(_('_Cancel'), Gtk.ResponseType.REJECT,
_('_OK'), Gtk.ResponseType.ACCEPT)
self.set_window(self.__dlg, None, _('Select surname'))
self.setup_configs('interface.lastnamedialog', 400, 400)
# build up a container to display all of the people of interest
self.__model = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_INT)
self.__tree_view = Gtk.TreeView(self.__model)
self.__tree_view = Gtk.TreeView(model=self.__model)
col1 = Gtk.TreeViewColumn(_('Surname'), Gtk.CellRendererText(), text=0)
col2 = Gtk.TreeViewColumn(_('Count'), Gtk.CellRendererText(), text=1)
col1.set_resizable(True)
@@ -1739,12 +1740,10 @@ class GuiDestinationOption(Gtk.Box):
else:
my_action = Gtk.FileChooserAction.SAVE
fcd = Gtk.FileChooserDialog(_("Save As"), action=my_action,
parent=self.__uistate.window,
buttons=(_('_Cancel'),
Gtk.ResponseType.CANCEL,
_('_Open'),
Gtk.ResponseType.OK))
fcd = Gtk.FileChooserDialog(title=_("Save As"), action=my_action,
transient_for=self.__uistate.window)
fcd.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
_('_Open'), Gtk.ResponseType.OK)
name = os.path.abspath(self.__option.get_value())
if self.__option.get_directory_entry():
@@ -1756,8 +1755,7 @@ class GuiDestinationOption(Gtk.Box):
name = get_curr_dir
fcd.set_current_folder(name)
else:
fcd.set_current_name(os.path.basename(name))
fcd.set_current_folder(os.path.dirname(name))
fcd.set_current_name(name)
status = fcd.run()
if status == Gtk.ResponseType.OK:
+13 -20
View File
@@ -435,12 +435,10 @@ class PluginStatus(ManagedWindow):
"""
Select a file from the file system.
"""
fcd = Gtk.FileChooserDialog(_("Load Addon"),
parent=self.__uistate.window,
buttons=(_('_Cancel'),
Gtk.ResponseType.CANCEL,
_('_Open'),
Gtk.ResponseType.OK))
fcd = Gtk.FileChooserDialog(title=_("Load Addon"),
transient_for=self.__uistate.window)
fcd.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
_('_Open'), Gtk.ResponseType.OK)
name = self.install_addon_path.get_text()
dir = os.path.dirname(name)
if not os.path.isdir(dir):
@@ -688,10 +686,10 @@ class PluginTrace(ManagedWindow):
) % {'str1': _("Plugin Error"), 'str2': name}
ManagedWindow.__init__(self, uistate, track, self)
self.set_window(Gtk.Dialog("", uistate.window,
Gtk.DialogFlags.DESTROY_WITH_PARENT,
(_('_Close'), Gtk.ResponseType.CLOSE)),
None, title)
dlg = Gtk.Dialog(title="", transient_for=uistate.window,
destroy_with_parent=True)
dlg.add_button(_('_Close'), Gtk.ResponseType.CLOSE),
self.set_window(dlg, None, title)
self.setup_configs('interface.plugintrace', 600, 400)
self.window.connect('response', self.close)
@@ -742,7 +740,7 @@ class ToolManagedWindowBase(ManagedWindow):
self.format_menu = None
self.style_button = None
window = Gtk.Dialog('Tool')
window = Gtk.Dialog(title='Tool')
self.set_window(window, None, self.get_title())
#self.window.connect('response', self.close)
@@ -814,12 +812,9 @@ class ToolManagedWindowBase(ManagedWindow):
buffer_location = view.window_to_buffer_coords(Gtk.TextWindowType.TEXT,
int(event.x),
int(event.y))
_iter = view.get_iter_at_location(*buffer_location)
if isinstance(_iter, tuple): # Gtk changed api in recent versions
_iter = _iter[1]
iter = view.get_iter_at_location(*buffer_location)
for (tag, person_handle) in self.tags:
if _iter.has_tag(tag):
if iter.has_tag(tag):
_window = view.get_window(Gtk.TextWindowType.TEXT)
_window.set_cursor(self.link_cursor)
return False # handle event further, if necessary
@@ -830,11 +825,9 @@ class ToolManagedWindowBase(ManagedWindow):
buffer_location = view.window_to_buffer_coords(Gtk.TextWindowType.TEXT,
int(event.x),
int(event.y))
_iter = view.get_iter_at_location(*buffer_location)
if isinstance(_iter, tuple): # Gtk changed api in recent versions
_iter = _iter[1]
iter = view.get_iter_at_location(*buffer_location)
for (tag, person_handle) in self.tags:
if _iter.has_tag(tag):
if iter.has_tag(tag):
person = self.db.get_person_from_handle(person_handle)
if event.button == 1:
if event.type == Gdk.EventType.DOUBLE_BUTTON_PRESS:
+6 -6
View File
@@ -286,7 +286,7 @@ class ExportAssistant(ManagedWindow, Gtk.Assistant):
self.set_page_complete(vbox, True)
def create_page_fileselect(self):
self.chooser = Gtk.FileChooserWidget(Gtk.FileChooserAction.SAVE)
self.chooser = Gtk.FileChooserWidget(action=Gtk.FileChooserAction.SAVE)
self.chooser.set_homogeneous(False) # Fix for bug #8350.
#add border
self.chooser.set_border_width(12)
@@ -586,11 +586,11 @@ class ExportAssistant(ManagedWindow, Gtk.Assistant):
ix = self.get_selected_format_index()
config.set('behavior.recent-export-type', ix)
export_function = self.map_exporters[ix].get_export_function()
success = export_function(
self.dbstate.db, filename,
User(error=ErrorDialog, parent=self.window,
callback=self.callback),
self.option_box_instance)
success = export_function(self.dbstate.db,
filename,
User(error=ErrorDialog, parent=self.uistate.window,
callback=self.callback),
self.option_box_instance)
except:
#an error not catched in the export_function itself
success = False
+16 -11
View File
@@ -164,9 +164,9 @@ class WriterOptionBox:
full_database_row.pack_start(label, True, True, 0)
people_count = len(self.dbstate.db.get_person_handles())
# translators: leave all/any {...} untranslated
button = Gtk.Button(ngettext("{number_of} Person",
"{number_of} People", people_count
).format(number_of=people_count) )
button = Gtk.Button(label=ngettext("{number_of} Person",
"{number_of} People", people_count
).format(number_of=people_count))
button.set_tooltip_text(_("Click to see preview of unfiltered data"))
button.set_size_request(107, -1)
button.connect("clicked", self.show_preview_data)
@@ -271,9 +271,9 @@ class WriterOptionBox:
from gi.repository import Gtk
from ...widgets import SimpleButton
# translators: leave all/any {...} untranslated
button = Gtk.Button(ngettext("{number_of} Person",
"{number_of} People", 0
).format(number_of=0) )
button = Gtk.Button(label=ngettext("{number_of} Person",
"{number_of} People", 0
).format(number_of=0))
button.set_size_request(107, -1)
button.connect("clicked", self.show_preview_data)
button.proxy_name = proxy_name
@@ -283,7 +283,8 @@ class WriterOptionBox:
label = Gtk.Label(label=_('_Person Filter') + COLON)
label.set_halign(Gtk.Align.START)
label.set_size_request(120, -1)
label.set_padding(5, 0)
label.set_margin_start(5)
label.set_margin_end(5)
label.set_use_underline(True)
label.set_mnemonic_widget(self.filter_obj)
box = Gtk.Box()
@@ -301,7 +302,8 @@ class WriterOptionBox:
label_note = Gtk.Label(label=_('_Note Filter') + COLON)
label_note.set_halign(Gtk.Align.START)
label_note.set_size_request(120, -1)
label_note.set_padding(5, 0)
label_note.set_margin_start(5)
label_note.set_margin_end(5)
label_note.set_use_underline(True)
label_note.set_mnemonic_widget(self.filter_note)
box = Gtk.Box()
@@ -317,7 +319,8 @@ class WriterOptionBox:
label = Gtk.Label(label=_("Privacy Filter") + COLON)
label.set_halign(Gtk.Align.START)
label.set_size_request(120, -1)
label.set_padding(5, 0)
label.set_margin_start(5)
label.set_margin_end(5)
box = Gtk.Box()
box.pack_start(label, False, True, 0)
box.add(self.private_check)
@@ -327,7 +330,8 @@ class WriterOptionBox:
label = Gtk.Label(label=_("Living Filter") + COLON)
label.set_halign(Gtk.Align.START)
label.set_size_request(120, -1)
label.set_padding(5, 0)
label.set_margin_start(5)
label.set_margin_end(5)
box = Gtk.Box()
box.pack_start(label, False, True, 0)
self.restrict_option = Gtk.ComboBox()
@@ -339,7 +343,8 @@ class WriterOptionBox:
label = Gtk.Label(label=_('Reference Filter') + COLON)
label.set_halign(Gtk.Align.START)
label.set_size_request(120, -1)
label.set_padding(5, 0)
label.set_margin_start(5)
label.set_margin_end(5)
box = Gtk.Box()
box.pack_start(label, False, True, 0)
box.pack_start(self.reference_filter, True, True, 0)
+5 -7
View File
@@ -58,13 +58,11 @@ class FileEntry(Gtk.Box):
else:
my_action = Gtk.FileChooserAction.SAVE
dialog = Gtk.FileChooserDialog(self.title,
self.parent,
action=my_action,
buttons=(_('_Cancel'),
Gtk.ResponseType.CANCEL,
_('_Open'),
Gtk.ResponseType.OK))
dialog = Gtk.FileChooserDialog(title=self.title,
transient_for=self.parent,
action=my_action)
dialog.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
_('_Open'), Gtk.ResponseType.OK)
name = os.path.basename(self.entry.get_text())
if self.dir:
+2 -1
View File
@@ -175,7 +175,8 @@ class PaperFrame(Gtk.Box):
self.paper_grid.show_all()
# Shift the grid from glade toplevel window to this box
self.paper_grid.reparent(self)
self.paper_grid.get_parent().remove(self.paper_grid)
self.add(self.paper_grid)
# need to get rid of glade toplevel now that we are done with it.
self.top.destroy()
+1 -1
View File
@@ -414,7 +414,7 @@ class StyleEditor(ManagedWindow):
spin.set_value(t.get_column_width(i))
self.column.append(spin)
hbox.pack_start(spin, False, False, 6)
hbox.pack_start(Gtk.Label('%'), False, False, 6)
hbox.pack_start(Gtk.Label(label='%'), False, False, 6)
hbox.show_all()
self.vbox.pack_start(hbox, False, False, 3)
+1 -1
View File
@@ -71,7 +71,7 @@ class GuiPluginManager(Callback):
def __init__(self):
""" This function should only be run once by get_instance() """
if GuiPluginManager.__instance != 1:
if GuiPluginManager.__instance is not 1:
raise Exception("This class is a singleton. "
"Use the get_instance() method")
+1
View File
@@ -325,6 +325,7 @@ class BaseSelector(ManagedWindow):
self.sortorder = Gtk.SortType.ASCENDING
else:
self.sortorder = Gtk.SortType.DESCENDING
self.model.reverse_order()
self.build_tree()
return True
-10
View File
@@ -496,16 +496,6 @@ class UIManager():
"""
return group.act_group.lookup_action(actionname)
def enable_all_actions(self, state):
for group in self.action_groups:
if group.act_group:
for item in group.actionlist:
action = group.act_group.lookup_action(item[ACTION_NAME])
if action:
# We check in case the group has not been inserted into
# UIManager yet
action.set_enabled(group.sensitive if state else False)
def dump_all_accels(self):
''' A function used diagnostically to see what accels are present.
This will only dump the current accel set, if other non-open windows

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