Potential research help tools

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Potential research help tools

Simon C. Tremblay
I just saw that the free app Family Tree Analyzer has a report, the "Census Lists"  that "lists everyone in a gedcom that should be alive on a census at a particular date and for whom you have not yet found a census entry"

I tried to do that with filters in Gramps, but it got ugly real fast. I'm sure if a report like that was created, it would be a great research tools, but I'm totally unable to program this myself.

Anyone else thinks that would be helpful?

Anyhow, just created a feature request for it (0010388), let's see if it can get some traction.

Also, there's a similar report for males alive and of fighting age for each World Wars.  That could be useful too.

Simon

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

Ron Johnson
On 01/23/2018 11:14 PM, Simon C. Tremblay wrote:
> I just saw that the free app Family Tree Analyzer has a report, the
> "Census Lists"  that "lists everyone in a gedcom that should be alive on a
> census at a particular date and for whom you have not yet found a census
> entry"

Is this for smartphones, which reads GEDCOMs?

--
World Peace Through Nuclear Pacification


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

paul womack
In reply to this post by Simon C. Tremblay
Simon C. Tremblay wrote:
> I just saw that the free app Family Tree Analyzer has a report, the "Census Lists"  that "lists everyone in a gedcom that should be alive on a census at a particular date and for whom you have not yet found a census entry"
>
> I tried to do that with filters in Gramps, but it got ugly real fast. I'm sure if a report like that was created, it would be a great research tools, but I'm totally unable to program this myself.
>
> Anyone else thinks that would be helpful?
>
> Anyhow, just created a feature request for it (0010388), let's see if it can get some traction.
>
> Also, there's a similar report for males alive and of fighting age for each World Wars.  That could be useful too.

Me preference in such an instance is always to create meta tools.
In this case the more abstract requirment is "missing document for person for whom one would expect the document".

One might also expect a Crockford's clerical directory entry for a priest in the UK after 1858.

In order to code this we need to know how "is a priest" is represented (in my gramps usage,
this would be the presence of an Occupation Event with Description regexp priest|vicar|clergy|bishop).

We also need to know how Crockfords is cited (probably a Source or Repository). "Has a Crockford's entry
would then become "has at least one Event who citation is Crockfords".

IIRC there are distinct limitations in the ability to search Citations, Sources and Repositories, stemming
from the pre-citation days of Gramps code.

Further, as Simon says, elaborate filters in Gramps are currently VERY painful.

But a filter model that can *express* this report is MUCH more valuable that *this report*.

I have a feature request/proposal pending on making general Gramps filters easier to use.

https://gramps-project.org/bugs/view.php?id=8651

   BugBear

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

Tim Lyons
Administrator
In reply to this post by Simon C. Tremblay
Simon C. Tremblay wrote
> ... "lists everyone in a gedcom that should be alive on a census
> at a particular date and for whom you have not yet found a census entry"


I wrote a QuickView report to do exactly that for my own use. I use it in
gramps34, where I have backported the newer 'forms' gramplet. The two
CensusCheckQuickview files need to be in the same directory as the forms
gramplet.

It only checks a person and their spouse and children, because that is
enough to concentrate on at one time to try to find the missing census
entries.

It is so short that I have attached it below in case it is any use.
(provided the mailing list gremlins don't strip it as too long).


Known bugs!

It only works in conjunction with the forms gramplet. It may need some
changes to make it work for gramps4x or gramps5x. It gets a bit confused
sometimes when dates are approximate because probably_alive doesn't always
work right. I have changed ;;date-about-range=50 in gramps.ini from the
default 50 to date-about-range=1, because when I say the date is 'about' I
mean that it is within a year of that date (but now that I check, I haven't
done that for the current gramps.ini I am using, so perhaps that is why
probably_alive sometimes doesn't work for me!). I didn't check whether a
person's parents exist, so it crashes, for example when you run it for a
person with children but no spouse. If you have census sources for more than
one country, it will check them all. It is only the UK 1939 register that
has closed records, but the check applies for all census forms.

Regards,
Tim Lyons


Here are the files.


CensusCheckQuickview.py

#
# Gramps - a GTK+/GNOME based genealogy program
#
# 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#
# $Id:
#
#
"""
Display whether census records have been found for a person, their spouse(s)
and
children
"""

from Simple import SimpleAccess, SimpleDoc, SimpleTable
from TransUtils import get_addon_translator
import Relationship
import form
from Utils import probably_alive, probably_alive_range

_ = get_addon_translator(__file__).ugettext
rel_calc = Relationship.get_relationship_calculator()

def process_person(database, sa, stab, person, census_list):
    if not person:
        return

    # Check for any existing census events for the person
    found_census = []
    for event_ref in person.get_event_ref_list():
        event = database.get_event_from_handle(event_ref.ref)
        if event:
            citation = form.get_form_citation(database, event)
            if citation:
                source_handle = citation.get_reference_handle()
                source = database.get_source_from_handle(source_handle)
                if source:
                    form_id = form.get_form_id(source)
                    found_census.append(form_id)
                   
    # Process all the possible censuses
    census_result = ()
    for key in sorted(census_list):
        if key in found_census:
            census_result += ("OK", )
        else:
            (b, d, ex, rel) = probably_alive_range(person, database)
            if probably_alive(person, database, census_list[key]):
                # If the person would be less than 100, the record may be
closed
                if probably_alive(person, database, max_age_prob_alive=100):
                    census_result += ("closed", )
                else:
                    census_result += ("miss", )
            else:
                census_result += ("-", )
   
    # Construct the results line
    columns = (sa.name(person), sa.birth_date_obj(person),
               sa.death_date_obj(person)) + census_result
    stab.row(*columns)

def run(database, document, person):
    """
    Display whether census records have been found for a person, their
spouse(s)
    and children
    """
   
    # Construct a dictionary of census IDs and date
    census_list = {}
    for handle in database.get_source_handles():
        source = database.get_source_from_handle(handle)
        form_id = form.get_form_id(source)
        if form_id in form.get_form_ids():
            form_type = form.get_form_type(form_id)
            if form_type == "Census":
                census_list[form_id] = form.get_form_date(form_id)

    sa = SimpleAccess(database)
    sd = SimpleDoc(document)
    sd.title(_("Census Check for %s") % sa.name(person))
    sd.paragraph("")
    stab = SimpleTable(sa)
   
    columns = (_("Name"), _("Birth date"), _("Death date")) + \
                tuple(key for key in sorted(census_list))
    stab.columns(*columns)
    stab.set_link_col(4)

    process_person(database, sa, stab, person, census_list)
   
    for family in sa.parent_in(person):
        father = sa.father(family)
        mother = sa.mother(family)
        if father.handle <> person.handle:
            spouse = father
        else:
            spouse = mother
        process_person(database, sa, stab, spouse, census_list)
        for child in sa.children(spouse):
            process_person(database, sa, stab, child, census_list)
   
    stab.write(sd)
    sd.paragraph("")



CensusCheckQuickview.gpr.py

#------------------------------------------------------------------------
#
# Register the report
#
#------------------------------------------------------------------------

register(QUICKREPORT,
         id    = 'censuscheckquickview',
         name  = _("CensusCheck"),
         description= _("Check whether any Census events are missing for a
person and some of their descendents"),
         version = '1.0.1',
         gramps_target_version = '3.4',
         status = STABLE,
         fname = 'CensusCheckQuickviewx.py',
         authors = ["Tim Lyons"],
         authors_email = ["hidden"],
         category = CATEGORY_QR_PERSON,
         runfunc = 'run',
  )




--
Sent from: http://gramps.1791082.n4.nabble.com/GRAMPS-User-f1807095.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

Simon C. Tremblay
Hey Tim,

That looks like something I could use.  Should it work with gramps 4.2.5, because I created the two files and saved them to the form folder under plugins and it gives an error.
I did change the value of gramps_target_version in the grp file to 4.2. The express report is listed, but I can see in the console that it throws a Syntax Error on what is line 108 for me:

if father.handle <> person.handle:

Is this error version related, or I missed something?

Simon

On 25 January 2018 at 06:33, Tim Lyons <[hidden email]> wrote:
Simon C. Tremblay wrote
> ... "lists everyone in a gedcom that should be alive on a census
> at a particular date and for whom you have not yet found a census entry"


I wrote a QuickView report to do exactly that for my own use. I use it in
gramps34, where I have backported the newer 'forms' gramplet. The two
CensusCheckQuickview files need to be in the same directory as the forms
gramplet.

It only checks a person and their spouse and children, because that is
enough to concentrate on at one time to try to find the missing census
entries.

It is so short that I have attached it below in case it is any use.
(provided the mailing list gremlins don't strip it as too long).


Known bugs!

It only works in conjunction with the forms gramplet. It may need some
changes to make it work for gramps4x or gramps5x. It gets a bit confused
sometimes when dates are approximate because probably_alive doesn't always
work right. I have changed ;;date-about-range=50 in gramps.ini from the
default 50 to date-about-range=1, because when I say the date is 'about' I
mean that it is within a year of that date (but now that I check, I haven't
done that for the current gramps.ini I am using, so perhaps that is why
probably_alive sometimes doesn't work for me!). I didn't check whether a
person's parents exist, so it crashes, for example when you run it for a
person with children but no spouse. If you have census sources for more than
one country, it will check them all. It is only the UK 1939 register that
has closed records, but the check applies for all census forms.

Regards,
Tim Lyons


Here are the files.


CensusCheckQuickview.py

#
# Gramps - a GTK+/GNOME based genealogy program
#
# 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#
# $Id:
#
#
"""
Display whether census records have been found for a person, their spouse(s)
and
children
"""

from Simple import SimpleAccess, SimpleDoc, SimpleTable
from TransUtils import get_addon_translator
import Relationship
import form
from Utils import probably_alive, probably_alive_range

_ = get_addon_translator(__file__).ugettext
rel_calc = Relationship.get_relationship_calculator()

def process_person(database, sa, stab, person, census_list):
    if not person:
        return

    # Check for any existing census events for the person
    found_census = []
    for event_ref in person.get_event_ref_list():
        event = database.get_event_from_handle(event_ref.ref)
        if event:
            citation = form.get_form_citation(database, event)
            if citation:
                source_handle = citation.get_reference_handle()
                source = database.get_source_from_handle(source_handle)
                if source:
                    form_id = form.get_form_id(source)
                    found_census.append(form_id)

    # Process all the possible censuses
    census_result = ()
    for key in sorted(census_list):
        if key in found_census:
            census_result += ("OK", )
        else:
            (b, d, ex, rel) = probably_alive_range(person, database)
            if probably_alive(person, database, census_list[key]):
                # If the person would be less than 100, the record may be
closed
                if probably_alive(person, database, max_age_prob_alive=100):
                    census_result += ("closed", )
                else:
                    census_result += ("miss", )
            else:
                census_result += ("-", )

    # Construct the results line
    columns = (sa.name(person), sa.birth_date_obj(person),
               sa.death_date_obj(person)) + census_result
    stab.row(*columns)

def run(database, document, person):
    """
    Display whether census records have been found for a person, their
spouse(s)
    and children
    """

    # Construct a dictionary of census IDs and date
    census_list = {}
    for handle in database.get_source_handles():
        source = database.get_source_from_handle(handle)
        form_id = form.get_form_id(source)
        if form_id in form.get_form_ids():
            form_type = form.get_form_type(form_id)
            if form_type == "Census":
                census_list[form_id] = form.get_form_date(form_id)

    sa = SimpleAccess(database)
    sd = SimpleDoc(document)
    sd.title(_("Census Check for %s") % sa.name(person))
    sd.paragraph("")
    stab = SimpleTable(sa)

    columns = (_("Name"), _("Birth date"), _("Death date")) + \
                tuple(key for key in sorted(census_list))
    stab.columns(*columns)
    stab.set_link_col(4)

    process_person(database, sa, stab, person, census_list)

    for family in sa.parent_in(person):
        father = sa.father(family)
        mother = sa.mother(family)
        if father.handle <> person.handle:
            spouse = father
        else:
            spouse = mother
        process_person(database, sa, stab, spouse, census_list)
        for child in sa.children(spouse):
            process_person(database, sa, stab, child, census_list)

    stab.write(sd)
    sd.paragraph("")



CensusCheckQuickview.gpr.py

#------------------------------------------------------------------------
#
# Register the report
#
#------------------------------------------------------------------------

register(QUICKREPORT,
         id    = 'censuscheckquickview',
         name  = _("CensusCheck"),
         description= _("Check whether any Census events are missing for a
person and some of their descendents"),
         version = '1.0.1',
         gramps_target_version = '3.4',
         status = STABLE,
         fname = 'CensusCheckQuickviewx.py',
         authors = ["Tim Lyons"],
         authors_email = ["hidden"],
         category = CATEGORY_QR_PERSON,
         runfunc = 'run',
  )




--
Sent from: http://gramps.1791082.n4.nabble.com/GRAMPS-User-f1807095.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

prculley
It appears that addon was developed way back when Gramps used Python 2.x.  Python 3.x (used since Gramps 4.1.x) syntax has changed a bit, in particular the '<>' is not allowed any more, the new syntax is '!='.  I don't see any other obvious syntax issues in a quick look...

Paul C.

On Sat, Jan 27, 2018 at 2:56 PM, Simon C. Tremblay <[hidden email]> wrote:
Hey Tim,

That looks like something I could use.  Should it work with gramps 4.2.5, because I created the two files and saved them to the form folder under plugins and it gives an error.
I did change the value of gramps_target_version in the grp file to 4.2. The express report is listed, but I can see in the console that it throws a Syntax Error on what is line 108 for me:

if father.handle <> person.handle:

Is this error version related, or I missed something?

Simon

On 25 January 2018 at 06:33, Tim Lyons <[hidden email]> wrote:
Simon C. Tremblay wrote
> ... "lists everyone in a gedcom that should be alive on a census
> at a particular date and for whom you have not yet found a census entry"


I wrote a QuickView report to do exactly that for my own use. I use it in
gramps34, where I have backported the newer 'forms' gramplet. The two
CensusCheckQuickview files need to be in the same directory as the forms
gramplet.

It only checks a person and their spouse and children, because that is
enough to concentrate on at one time to try to find the missing census
entries.

It is so short that I have attached it below in case it is any use.
(provided the mailing list gremlins don't strip it as too long).


Known bugs!

It only works in conjunction with the forms gramplet. It may need some
changes to make it work for gramps4x or gramps5x. It gets a bit confused
sometimes when dates are approximate because probably_alive doesn't always
work right. I have changed ;;date-about-range=50 in gramps.ini from the
default 50 to date-about-range=1, because when I say the date is 'about' I
mean that it is within a year of that date (but now that I check, I haven't
done that for the current gramps.ini I am using, so perhaps that is why
probably_alive sometimes doesn't work for me!). I didn't check whether a
person's parents exist, so it crashes, for example when you run it for a
person with children but no spouse. If you have census sources for more than
one country, it will check them all. It is only the UK 1939 register that
has closed records, but the check applies for all census forms.

Regards,
Tim Lyons


Here are the files.


CensusCheckQuickview.py

#
# Gramps - a GTK+/GNOME based genealogy program
#
# 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#
# $Id:
#
#
"""
Display whether census records have been found for a person, their spouse(s)
and
children
"""

from Simple import SimpleAccess, SimpleDoc, SimpleTable
from TransUtils import get_addon_translator
import Relationship
import form
from Utils import probably_alive, probably_alive_range

_ = get_addon_translator(__file__).ugettext
rel_calc = Relationship.get_relationship_calculator()

def process_person(database, sa, stab, person, census_list):
    if not person:
        return

    # Check for any existing census events for the person
    found_census = []
    for event_ref in person.get_event_ref_list():
        event = database.get_event_from_handle(event_ref.ref)
        if event:
            citation = form.get_form_citation(database, event)
            if citation:
                source_handle = citation.get_reference_handle()
                source = database.get_source_from_handle(source_handle)
                if source:
                    form_id = form.get_form_id(source)
                    found_census.append(form_id)

    # Process all the possible censuses
    census_result = ()
    for key in sorted(census_list):
        if key in found_census:
            census_result += ("OK", )
        else:
            (b, d, ex, rel) = probably_alive_range(person, database)
            if probably_alive(person, database, census_list[key]):
                # If the person would be less than 100, the record may be
closed
                if probably_alive(person, database, max_age_prob_alive=100):
                    census_result += ("closed", )
                else:
                    census_result += ("miss", )
            else:
                census_result += ("-", )

    # Construct the results line
    columns = (sa.name(person), sa.birth_date_obj(person),
               sa.death_date_obj(person)) + census_result
    stab.row(*columns)

def run(database, document, person):
    """
    Display whether census records have been found for a person, their
spouse(s)
    and children
    """

    # Construct a dictionary of census IDs and date
    census_list = {}
    for handle in database.get_source_handles():
        source = database.get_source_from_handle(handle)
        form_id = form.get_form_id(source)
        if form_id in form.get_form_ids():
            form_type = form.get_form_type(form_id)
            if form_type == "Census":
                census_list[form_id] = form.get_form_date(form_id)

    sa = SimpleAccess(database)
    sd = SimpleDoc(document)
    sd.title(_("Census Check for %s") % sa.name(person))
    sd.paragraph("")
    stab = SimpleTable(sa)

    columns = (_("Name"), _("Birth date"), _("Death date")) + \
                tuple(key for key in sorted(census_list))
    stab.columns(*columns)
    stab.set_link_col(4)

    process_person(database, sa, stab, person, census_list)

    for family in sa.parent_in(person):
        father = sa.father(family)
        mother = sa.mother(family)
        if father.handle <> person.handle:
            spouse = father
        else:
            spouse = mother
        process_person(database, sa, stab, spouse, census_list)
        for child in sa.children(spouse):
            process_person(database, sa, stab, child, census_list)

    stab.write(sd)
    sd.paragraph("")



CensusCheckQuickview.gpr.py

#------------------------------------------------------------------------
#
# Register the report
#
#------------------------------------------------------------------------

register(QUICKREPORT,
         id    = 'censuscheckquickview',
         name  = _("CensusCheck"),
         description= _("Check whether any Census events are missing for a
person and some of their descendents"),
         version = '1.0.1',
         gramps_target_version = '3.4',
         status = STABLE,
         fname = 'CensusCheckQuickviewx.py',
         authors = ["Tim Lyons"],
         authors_email = ["hidden"],
         category = CATEGORY_QR_PERSON,
         runfunc = 'run',
  )




--
Sent from: http://gramps.1791082.n4.nabble.com/GRAMPS-User-f1807095.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

Simon C. Tremblay
Thanks Paul.  I had tried NE instead of <>.  (I'm not a dev, just a code tweaker; Prog languages are colliding in my head).  That got rid of that error, but now I have "No module named 'Simple'.  That's probably something Gramps 3. specific too.

Simon

On 27 January 2018 at 16:37, Paul Culley <[hidden email]> wrote:
It appears that addon was developed way back when Gramps used Python 2.x.  Python 3.x (used since Gramps 4.1.x) syntax has changed a bit, in particular the '<>' is not allowed any more, the new syntax is '!='.  I don't see any other obvious syntax issues in a quick look...

Paul C.

On Sat, Jan 27, 2018 at 2:56 PM, Simon C. Tremblay <[hidden email]> wrote:
Hey Tim,

That looks like something I could use.  Should it work with gramps 4.2.5, because I created the two files and saved them to the form folder under plugins and it gives an error.
I did change the value of gramps_target_version in the grp file to 4.2. The express report is listed, but I can see in the console that it throws a Syntax Error on what is line 108 for me:

if father.handle <> person.handle:

Is this error version related, or I missed something?

Simon

On 25 January 2018 at 06:33, Tim Lyons <[hidden email]> wrote:
Simon C. Tremblay wrote
> ... "lists everyone in a gedcom that should be alive on a census
> at a particular date and for whom you have not yet found a census entry"


I wrote a QuickView report to do exactly that for my own use. I use it in
gramps34, where I have backported the newer 'forms' gramplet. The two
CensusCheckQuickview files need to be in the same directory as the forms
gramplet.

It only checks a person and their spouse and children, because that is
enough to concentrate on at one time to try to find the missing census
entries.

It is so short that I have attached it below in case it is any use.
(provided the mailing list gremlins don't strip it as too long).


Known bugs!

It only works in conjunction with the forms gramplet. It may need some
changes to make it work for gramps4x or gramps5x. It gets a bit confused
sometimes when dates are approximate because probably_alive doesn't always
work right. I have changed ;;date-about-range=50 in gramps.ini from the
default 50 to date-about-range=1, because when I say the date is 'about' I
mean that it is within a year of that date (but now that I check, I haven't
done that for the current gramps.ini I am using, so perhaps that is why
probably_alive sometimes doesn't work for me!). I didn't check whether a
person's parents exist, so it crashes, for example when you run it for a
person with children but no spouse. If you have census sources for more than
one country, it will check them all. It is only the UK 1939 register that
has closed records, but the check applies for all census forms.

Regards,
Tim Lyons


Here are the files.


CensusCheckQuickview.py

#
# Gramps - a GTK+/GNOME based genealogy program
#
# 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#
# $Id:
#
#
"""
Display whether census records have been found for a person, their spouse(s)
and
children
"""

from Simple import SimpleAccess, SimpleDoc, SimpleTable
from TransUtils import get_addon_translator
import Relationship
import form
from Utils import probably_alive, probably_alive_range

_ = get_addon_translator(__file__).ugettext
rel_calc = Relationship.get_relationship_calculator()

def process_person(database, sa, stab, person, census_list):
    if not person:
        return

    # Check for any existing census events for the person
    found_census = []
    for event_ref in person.get_event_ref_list():
        event = database.get_event_from_handle(event_ref.ref)
        if event:
            citation = form.get_form_citation(database, event)
            if citation:
                source_handle = citation.get_reference_handle()
                source = database.get_source_from_handle(source_handle)
                if source:
                    form_id = form.get_form_id(source)
                    found_census.append(form_id)

    # Process all the possible censuses
    census_result = ()
    for key in sorted(census_list):
        if key in found_census:
            census_result += ("OK", )
        else:
            (b, d, ex, rel) = probably_alive_range(person, database)
            if probably_alive(person, database, census_list[key]):
                # If the person would be less than 100, the record may be
closed
                if probably_alive(person, database, max_age_prob_alive=100):
                    census_result += ("closed", )
                else:
                    census_result += ("miss", )
            else:
                census_result += ("-", )

    # Construct the results line
    columns = (sa.name(person), sa.birth_date_obj(person),
               sa.death_date_obj(person)) + census_result
    stab.row(*columns)

def run(database, document, person):
    """
    Display whether census records have been found for a person, their
spouse(s)
    and children
    """

    # Construct a dictionary of census IDs and date
    census_list = {}
    for handle in database.get_source_handles():
        source = database.get_source_from_handle(handle)
        form_id = form.get_form_id(source)
        if form_id in form.get_form_ids():
            form_type = form.get_form_type(form_id)
            if form_type == "Census":
                census_list[form_id] = form.get_form_date(form_id)

    sa = SimpleAccess(database)
    sd = SimpleDoc(document)
    sd.title(_("Census Check for %s") % sa.name(person))
    sd.paragraph("")
    stab = SimpleTable(sa)

    columns = (_("Name"), _("Birth date"), _("Death date")) + \
                tuple(key for key in sorted(census_list))
    stab.columns(*columns)
    stab.set_link_col(4)

    process_person(database, sa, stab, person, census_list)

    for family in sa.parent_in(person):
        father = sa.father(family)
        mother = sa.mother(family)
        if father.handle <> person.handle:
            spouse = father
        else:
            spouse = mother
        process_person(database, sa, stab, spouse, census_list)
        for child in sa.children(spouse):
            process_person(database, sa, stab, child, census_list)

    stab.write(sd)
    sd.paragraph("")



CensusCheckQuickview.gpr.py

#------------------------------------------------------------------------
#
# Register the report
#
#------------------------------------------------------------------------

register(QUICKREPORT,
         id    = 'censuscheckquickview',
         name  = _("CensusCheck"),
         description= _("Check whether any Census events are missing for a
person and some of their descendents"),
         version = '1.0.1',
         gramps_target_version = '3.4',
         status = STABLE,
         fname = 'CensusCheckQuickviewx.py',
         authors = ["Tim Lyons"],
         authors_email = ["hidden"],
         category = CATEGORY_QR_PERSON,
         runfunc = 'run',
  )




--
Sent from: http://gramps.1791082.n4.nabble.com/GRAMPS-User-f1807095.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

prculley
Sorry about that. After looking into this a bit deeper, and trying to start converting it to a modern Gramps installation, it appears that this is not going to be that easy.  There appears to be some part of this Quickview that is using a previously un-debugged part of Gramps, and it is not working.

Running out of time now...

Paul C.

On Sat, Jan 27, 2018 at 4:32 PM, Simon C. Tremblay <[hidden email]> wrote:
Thanks Paul.  I had tried NE instead of <>.  (I'm not a dev, just a code tweaker; Prog languages are colliding in my head).  That got rid of that error, but now I have "No module named 'Simple'.  That's probably something Gramps 3. specific too.

Simon

On 27 January 2018 at 16:37, Paul Culley <[hidden email]> wrote:
It appears that addon was developed way back when Gramps used Python 2.x.  Python 3.x (used since Gramps 4.1.x) syntax has changed a bit, in particular the '<>' is not allowed any more, the new syntax is '!='.  I don't see any other obvious syntax issues in a quick look...

Paul C.

On Sat, Jan 27, 2018 at 2:56 PM, Simon C. Tremblay <[hidden email]> wrote:
Hey Tim,

That looks like something I could use.  Should it work with gramps 4.2.5, because I created the two files and saved them to the form folder under plugins and it gives an error.
I did change the value of gramps_target_version in the grp file to 4.2. The express report is listed, but I can see in the console that it throws a Syntax Error on what is line 108 for me:

if father.handle <> person.handle:

Is this error version related, or I missed something?

Simon

On 25 January 2018 at 06:33, Tim Lyons <[hidden email]> wrote:
Simon C. Tremblay wrote
> ... "lists everyone in a gedcom that should be alive on a census
> at a particular date and for whom you have not yet found a census entry"


I wrote a QuickView report to do exactly that for my own use. I use it in
gramps34, where I have backported the newer 'forms' gramplet. The two
CensusCheckQuickview files need to be in the same directory as the forms
gramplet.

It only checks a person and their spouse and children, because that is
enough to concentrate on at one time to try to find the missing census
entries.

It is so short that I have attached it below in case it is any use.
(provided the mailing list gremlins don't strip it as too long).


Known bugs!

It only works in conjunction with the forms gramplet. It may need some
changes to make it work for gramps4x or gramps5x. It gets a bit confused
sometimes when dates are approximate because probably_alive doesn't always
work right. I have changed ;;date-about-range=50 in gramps.ini from the
default 50 to date-about-range=1, because when I say the date is 'about' I
mean that it is within a year of that date (but now that I check, I haven't
done that for the current gramps.ini I am using, so perhaps that is why
probably_alive sometimes doesn't work for me!). I didn't check whether a
person's parents exist, so it crashes, for example when you run it for a
person with children but no spouse. If you have census sources for more than
one country, it will check them all. It is only the UK 1939 register that
has closed records, but the check applies for all census forms.

Regards,
Tim Lyons


Here are the files.


CensusCheckQuickview.py

#
# Gramps - a GTK+/GNOME based genealogy program
#
# 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#
# $Id:
#
#
"""
Display whether census records have been found for a person, their spouse(s)
and
children
"""

from Simple import SimpleAccess, SimpleDoc, SimpleTable
from TransUtils import get_addon_translator
import Relationship
import form
from Utils import probably_alive, probably_alive_range

_ = get_addon_translator(__file__).ugettext
rel_calc = Relationship.get_relationship_calculator()

def process_person(database, sa, stab, person, census_list):
    if not person:
        return

    # Check for any existing census events for the person
    found_census = []
    for event_ref in person.get_event_ref_list():
        event = database.get_event_from_handle(event_ref.ref)
        if event:
            citation = form.get_form_citation(database, event)
            if citation:
                source_handle = citation.get_reference_handle()
                source = database.get_source_from_handle(source_handle)
                if source:
                    form_id = form.get_form_id(source)
                    found_census.append(form_id)

    # Process all the possible censuses
    census_result = ()
    for key in sorted(census_list):
        if key in found_census:
            census_result += ("OK", )
        else:
            (b, d, ex, rel) = probably_alive_range(person, database)
            if probably_alive(person, database, census_list[key]):
                # If the person would be less than 100, the record may be
closed
                if probably_alive(person, database, max_age_prob_alive=100):
                    census_result += ("closed", )
                else:
                    census_result += ("miss", )
            else:
                census_result += ("-", )

    # Construct the results line
    columns = (sa.name(person), sa.birth_date_obj(person),
               sa.death_date_obj(person)) + census_result
    stab.row(*columns)

def run(database, document, person):
    """
    Display whether census records have been found for a person, their
spouse(s)
    and children
    """

    # Construct a dictionary of census IDs and date
    census_list = {}
    for handle in database.get_source_handles():
        source = database.get_source_from_handle(handle)
        form_id = form.get_form_id(source)
        if form_id in form.get_form_ids():
            form_type = form.get_form_type(form_id)
            if form_type == "Census":
                census_list[form_id] = form.get_form_date(form_id)

    sa = SimpleAccess(database)
    sd = SimpleDoc(document)
    sd.title(_("Census Check for %s") % sa.name(person))
    sd.paragraph("")
    stab = SimpleTable(sa)

    columns = (_("Name"), _("Birth date"), _("Death date")) + \
                tuple(key for key in sorted(census_list))
    stab.columns(*columns)
    stab.set_link_col(4)

    process_person(database, sa, stab, person, census_list)

    for family in sa.parent_in(person):
        father = sa.father(family)
        mother = sa.mother(family)
        if father.handle <> person.handle:
            spouse = father
        else:
            spouse = mother
        process_person(database, sa, stab, spouse, census_list)
        for child in sa.children(spouse):
            process_person(database, sa, stab, child, census_list)

    stab.write(sd)
    sd.paragraph("")



CensusCheckQuickview.gpr.py

#------------------------------------------------------------------------
#
# Register the report
#
#------------------------------------------------------------------------

register(QUICKREPORT,
         id    = 'censuscheckquickview',
         name  = _("CensusCheck"),
         description= _("Check whether any Census events are missing for a
person and some of their descendents"),
         version = '1.0.1',
         gramps_target_version = '3.4',
         status = STABLE,
         fname = 'CensusCheckQuickviewx.py',
         authors = ["Tim Lyons"],
         authors_email = ["hidden"],
         category = CATEGORY_QR_PERSON,
         runfunc = 'run',
  )




--
Sent from: http://gramps.1791082.n4.nabble.com/GRAMPS-User-f1807095.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

phil wharram



Hi Been following this for a little while

Could someone explain what the the x does in the gpr.py file

fname = 'CensusCheckQuickviewx.py',

when the file name does not have this

Sorry for being thick or having missed this part of the discussion


Regards
Phil
MLFHS 12583
Dumfries
On 28/01/2018 00:25, Paul Culley wrote:
> fname = 'CensusCheckQuickviewx.py

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

prculley
You guys should regard the posted code as a 'work in progress'; it doesn't work as is for a variety of reasons.  I'm looking at patching it up to work correctly, will post here when I have it done.

Paul C.

On Sun, Jan 28, 2018 at 9:54 AM, phil wharram <[hidden email]> wrote:



Hi Been following this for a little while

Could someone explain what the the x does in the gpr.py file

fname = 'CensusCheckQuickviewx.py',

when the file name does not have this

Sorry for being thick or having missed this part of the discussion


Regards
Phil
MLFHS 12583
Dumfries
On 28/01/2018 00:25, Paul Culley wrote:
fname = 'CensusCheckQuickviewx.py

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

Simon C. Tremblay
Thanks Paul C.  I clearly understand that this is "personnal code" done for a previous version of Gramps that Tim was gracious enough to share with us.  Was just really curious to see it in action.

Phil, forgot to mention that's the second change I did to the code while trying to debug it.  It really looks like a typo, or a debug version Tim was working on when he posted the script.

Simon

On 28 January 2018 at 11:00, Paul Culley <[hidden email]> wrote:
You guys should regard the posted code as a 'work in progress'; it doesn't work as is for a variety of reasons.  I'm looking at patching it up to work correctly, will post here when I have it done.

Paul C.

On Sun, Jan 28, 2018 at 9:54 AM, phil wharram <[hidden email]> wrote:



Hi Been following this for a little while

Could someone explain what the the x does in the gpr.py file

fname = 'CensusCheckQuickviewx.py',

when the file name does not have this

Sorry for being thick or having missed this part of the discussion


Regards
Phil
MLFHS 12583
Dumfries
On 28/01/2018 00:25, Paul Culley wrote:
fname = 'CensusCheckQuickviewx.py

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

phil wharram


Hi Simon

Thanks for that was interested in
a) the concept I am considering keeping a separate spreadsheet with all
the names and events to highlight ones I am missing
b) the programming don't know anything really about python so part of
the learning process

Regards
Phil
MLFHS 12583
Dumfries

On 28/01/2018 16:10, Simon C. Tremblay wrote:

> Thanks Paul C.  I clearly understand that this is "personnal code" done for
> a previous version of Gramps that Tim was gracious enough to share with
> us.  Was just really curious to see it in action.
>
> Phil, forgot to mention that's the second change I did to the code while
> trying to debug it.  It really looks like a typo, or a debug version Tim
> was working on when he posted the script.
>
> Simon
>
> On 28 January 2018 at 11:00, Paul Culley <[hidden email]> wrote:
>
>> You guys should regard the posted code as a 'work in progress'; it doesn't
>> work as is for a variety of reasons.  I'm looking at patching it up to work
>> correctly, will post here when I have it done.
>>
>> Paul C.
>>
>> On Sun, Jan 28, 2018 at 9:54 AM, phil wharram <[hidden email]
>>> wrote:
>>
>>>
>>>
>>>
>>> Hi Been following this for a little while
>>>
>>> Could someone explain what the the x does in the gpr.py file
>>>
>>> fname = 'CensusCheckQuickviewx.py',
>>>
>>> when the file name does not have this
>>>
>>> Sorry for being thick or having missed this part of the discussion
>>>
>>>
>>> Regards
>>> Phil
>>> MLFHS 12583
>>> Dumfries
>>> On 28/01/2018 00:25, Paul Culley wrote:
>>>
>>>> fname = 'CensusCheckQuickviewx.py
>>>>
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Gramps-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/gramps-users
>>> https://gramps-project.org
>>>
>>
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gramps-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gramps-users
>> https://gramps-project.org
>>
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

prculley
Here is the updated CensusCheck Quick report.  As before, you install the two files into the "~/gramps/gramps42/plugins/Form" directory (Linux) or "C:\Users\you\AppData\Roaming\gramps\gramps50\plugins\Form" for Windows.

The censuscheckquickview.gpr.py file:
#------------------------------------------------------------------------
#
# Register the report
#
#------------------------------------------------------------------------

register(QUICKREPORT,
         id    = 'censuscheckquickview',
         name  = _("Census Check"),
         description= _("Check whether any Census events are missing for"
                        " a person and some of their descendents"),
         version = '1.0.2',
         gramps_target_version = '4.2',
         status = STABLE,
         fname = 'censuscheckquickview.py',
         authors = ["Tim Lyons"],
         authors_email = ["hidden"],
         category = CATEGORY_QR_PERSON,
         runfunc = 'run',
  )

******************************************************************************************
The censuscheckquickview.py file:
#
# Gramps - a GTK+/GNOME based genealogy program
#
# 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#
# $Id:
#

#
"""
Display whether census records have been found for a person, their spouse(s)
and
children
"""

from gramps.gen.simple import SimpleAccess, SimpleDoc, SimpleTable
from gramps.gui.plug.quick import QuickTable
from gramps.gen.const import GRAMPS_LOCALE as glocale
import form
from gramps.gen.utils.alive import probably_alive, probably_alive_range

_ = glocale.get_addon_translator(__file__).gettext


def process_person(database, sa, stab, person, census_list):
    if not person:

        return

    # Check for any existing census events for the person
    found_census = []
    for event_ref in person.get_event_ref_list():
        event = database.get_event_from_handle(event_ref.ref)
        if event:
            citation = form.get_form_citation(database, event)
            if citation:
                source_handle = citation.get_reference_handle()
                source = database.get_source_from_handle(source_handle)
                if source:
                    form_id = form.get_form_id(source)
                    found_census.append(form_id)

    # Process all the possible censuses
    census_result = ()
    for key in sorted(census_list):
        if key in found_census:
            census_result += ("OK", )
        else:
            (b, d, ex, rel) = probably_alive_range(person, database)
            if probably_alive(person, database, census_list[key]):
                # If the person would be less than 100, the record may be closed
                if probably_alive(person, database, max_age_prob_alive=100):
                    census_result += ("closed", )
                else:
                    census_result += ("miss", )
            else:
                census_result += ("-", )

    # Construct the results line
    columns = (sa.name(person), sa.birth_date_obj(person),
               sa.death_date_obj(person)) + census_result
    stab.row(*columns)


def run(database, document, person):
    """
    Display whether census records have been found for a person, their
    spouse(s) and children
    """

    # Construct a dictionary of census IDs and date
    census_list = {}
    for handle in database.get_source_handles():
        source = database.get_source_from_handle(handle)
        form_id = form.get_form_id(source)
        if form_id in form.get_form_ids():
            form_type = form.get_form_type(form_id)
            if form_type == "Census":
                census_list[form_id] = form.get_form_date(form_id)

    sa = SimpleAccess(database)
    sd = SimpleDoc(document)
    sd.title(_("Census Check for %s") % sa.name(person))
    sd.paragraph("")
    stab = QuickTable(sa)

    columns = (_("Name"), _("Birth date"), _("Death date")) + \
        tuple(key for key in sorted(census_list))
    stab.columns(*columns)
    stab.set_link_col(4)

    process_person(database, sa, stab, person, census_list)

    for family in sa.parent_in(person):
        father = sa.father(family)
        mother = sa.mother(family)
        if father.handle != person.handle:
            spouse = father
        else:
            spouse = mother
        process_person(database, sa, stab, spouse, census_list)
        for child in sa.children(spouse):
            process_person(database, sa, stab, child, census_list)

    stab.write(sd)
    sd.paragraph("")
*************************************************************************************************
This was tested, and appears to be working on Gramps4.2.6, and will also work on Gramps5.0.0x if you change the first file line from "gramps_target_version = '4.2'" to "gramps_target_version = '5.0'".

Paul C.

P.S. if there is enough interest and Tim Lyons gives permission, this can be published to the Gramps Addons so anyone can download/install like any other addon.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

Tim Lyons
Administrator
Paul,

Thanks very much indeed for fixing that for me. I'm sorry I couldn't get it
fixed myself. I have just spent most of this afternoon getting a git
repository sorted out for my environment for gramps42, so that I could look
at it, and I was completely mystified!

I still don't understand why it was working on gramps34, but not (even when
the imports were corrected) on gramps42. Any idea?

Am I right in thinking that the only real change was to replace SimpleTable
with QuickTable? There is still a use of SimpleTable in gramps42, in
onthisday, and that doesn't crash (it doesn't seem to work either, but that
is not important right now). SimpleTable was used in several other places in
QuickViews in gramps34, but those now seem to have been replaced.

Yes, I'd be very pleaded to publish it as a gramps addon, but it needs to be
part of the forms grampslet, because the code depends on it. So it is not
just up to me, but also up to Nick Hall because the forms gramplet is his.

Paul, would it be a good idea to please add this code to your bug10228 PR,
and also mention that this now resolves bug 10288. Then when PR#102 is
reviewed and pushed, would it then be appropriate to push this change back
to gramps42, or is it better to make an entirely new change?

regards,
Tim Lyons.


(I think it still doesn't work for single parent families, and I plan to
look at that).



--
Sent from: http://gramps.1791082.n4.nabble.com/GRAMPS-User-f1807095.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

Tim Lyons
Administrator
In reply to this post by phil wharram
Just in case it is ever of any use to anyone else, the x in the name was
indeed a debug hack. It was so that it referred to a separate file:

CensusCheckQuickviewx.py

import CensusCheckQuickview
import imp
for i in ["CensusCheckQuickview"]:
    module = __import__(i)
    imp.reload(module)

def run(database, document, person):
    """
    Display a person's timeline.
    """
    CensusCheckQuickview.run(database, document, person)

===========================================

The purpose of this is that if you change the source file on disk while
gramps is running, and then use the reload button in the Help -> Plugin
Manager, it will cause the code for CensusCheckQuickview to be reloaded.

Sorry, I had quite forgotten that I had done this - it was all in about
April last year.

It should be ignored entirely, but I just mention it in case it is ever of
use to anyone else. Again this is just work in progress, so it may not work
with current code.



--
Sent from: http://gramps.1791082.n4.nabble.com/GRAMPS-User-f1807095.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

Simon C. Tremblay
In reply to this post by Tim Lyons
I just tested Paul's updated version and works.

Tim, it looks good, I like it a lot.  It will definitely help me organise my research.

Simon

On 28 January 2018 at 19:59, Tim Lyons <[hidden email]> wrote:
Paul,

Thanks very much indeed for fixing that for me. I'm sorry I couldn't get it
fixed myself. I have just spent most of this afternoon getting a git
repository sorted out for my environment for gramps42, so that I could look
at it, and I was completely mystified!

I still don't understand why it was working on gramps34, but not (even when
the imports were corrected) on gramps42. Any idea?

Am I right in thinking that the only real change was to replace SimpleTable
with QuickTable? There is still a use of SimpleTable in gramps42, in
onthisday, and that doesn't crash (it doesn't seem to work either, but that
is not important right now). SimpleTable was used in several other places in
QuickViews in gramps34, but those now seem to have been replaced.

Yes, I'd be very pleaded to publish it as a gramps addon, but it needs to be
part of the forms grampslet, because the code depends on it. So it is not
just up to me, but also up to Nick Hall because the forms gramplet is his.

Paul, would it be a good idea to please add this code to your bug10228 PR,
and also mention that this now resolves bug 10288. Then when PR#102 is
reviewed and pushed, would it then be appropriate to push this change back
to gramps42, or is it better to make an entirely new change?

regards,
Tim Lyons.


(I think it still doesn't work for single parent families, and I plan to
look at that).



--
Sent from: http://gramps.1791082.n4.nabble.com/GRAMPS-User-f1807095.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

phil wharram



Hi All

Just tried it on Ubuntu Mate Gramps 5 and it will not work unless I am
looking in the wrong place, updated .gpr file to 5.0 and put both in
plugins form folder anything else I need to do

Regards
Phil
MLFHS 12583
Dumfries
On 29/01/2018 01:38, Simon C. Tremblay wrote:

> I just tested Paul's updated version and works.
>
> Tim, it looks good, I like it a lot.  It will definitely help me organise
> my research.
>
> Simon
>
> On 28 January 2018 at 19:59, Tim Lyons <[hidden email]> wrote:
>
>> Paul,
>>
>> Thanks very much indeed for fixing that for me. I'm sorry I couldn't get it
>> fixed myself. I have just spent most of this afternoon getting a git
>> repository sorted out for my environment for gramps42, so that I could look
>> at it, and I was completely mystified!
>>
>> I still don't understand why it was working on gramps34, but not (even when
>> the imports were corrected) on gramps42. Any idea?
>>
>> Am I right in thinking that the only real change was to replace SimpleTable
>> with QuickTable? There is still a use of SimpleTable in gramps42, in
>> onthisday, and that doesn't crash (it doesn't seem to work either, but that
>> is not important right now). SimpleTable was used in several other places
>> in
>> QuickViews in gramps34, but those now seem to have been replaced.
>>
>> Yes, I'd be very pleaded to publish it as a gramps addon, but it needs to
>> be
>> part of the forms grampslet, because the code depends on it. So it is not
>> just up to me, but also up to Nick Hall because the forms gramplet is his.
>>
>> Paul, would it be a good idea to please add this code to your bug10228 PR,
>> and also mention that this now resolves bug 10288. Then when PR#102 is
>> reviewed and pushed, would it then be appropriate to push this change back
>> to gramps42, or is it better to make an entirely new change?
>>
>> regards,
>> Tim Lyons.
>>
>>
>> (I think it still doesn't work for single parent families, and I plan to
>> look at that).
>>
>>
>>
>> --
>> Sent from: http://gramps.1791082.n4.nabble.com/GRAMPS-User-f1807095.html
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gramps-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gramps-users
>> https://gramps-project.org
>>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
>
>
> _______________________________________________
> Gramps-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gramps-users
> https://gramps-project.org
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

Tim Lyons
Administrator
phil wharram wrote

> Hi All
>
> Just tried it on Ubuntu Mate Gramps 5 and it will not work unless I am
> looking in the wrong place, updated .gpr file to 5.0 and put both in
> plugins form folder anything else I need to do
>
> Regards
> Phil
> MLFHS 12583
> Dumfries

Not sure what the problem might be, but please note that the Quickview will
only check against form information that you have already setup within a
source.

See
https://gramps-project.org/wiki/index.php?title=Form_Addons#Configuration

So if you have configured the 1841 census as a source, it will check whether
the people have a citation for that source.

Regards,
Tim.



--
Sent from: http://gramps.1791082.n4.nabble.com/GRAMPS-User-f1807095.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

Gary Griffin
In reply to this post by prculley
I tried to load this on my Gramps 4.2.4 on MacOSX High Sierra and it did not
work - no menu item was added to select.  I have about 10 forms (census,
b/m/d) which I use. I modified the formgramplet.gpr.py in the same directory
and see those changes reflected so I believe I put the censuscheckquickview
files in the proper place.



--
Sent from: http://gramps.1791082.n4.nabble.com/GRAMPS-User-f1807095.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Potential research help tools

Tim Lyons
Administrator
Gary Griffin wrote
> I tried to load this on my Gramps 4.2.4 on MacOSX High Sierra and it did
> not
> work - no menu item was added to select.  I have about 10 forms (census,
> b/m/d) which I use. I modified the formgramplet.gpr.py in the same
> directory
> and see those changes reflected so I believe I put the
> censuscheckquickview
> files in the proper place.

To see the Quickview, you have to select the People category, then click on
a person to select that person, then right click on the selected person,
which will bring up a pop-up menu, one of the entries should be QuickView,
then select the CensusCheck menu item.

QuickViews are described here:
https://gramps-project.org/wiki/index.php?title=Gramps_4.2_Wiki_Manual_-_Reports_-_part_8

There is a page about writing your own quickreports:
https://gramps-project.org/wiki/index.php?title=Quick_Views (the pop-up for
QuickViews doesn't work for me on Mac OS X when right clicking on a blank
space on the person editor - the pop-up menu appears, but the sub-menu for
the views doesn't appear).



--
Sent from: http://gramps.1791082.n4.nabble.com/GRAMPS-User-f1807095.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
12