Re: another question from another beginner

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

Re: another question from another beginner

dave.khuon@gmail.com

I have been itching to implement this feature that I have submitted sometime ago:

ID

Project

Category

View Status

Date Submitted

Last Update

0010378

Feature Requests

Reports

public

20-Jan-2018 03:00

20-Apr-2019 19:10

 

Here is its description:

Summary

0010378: Add option to show gender for reports that support "Substitution Values"

Description

was[Not an issue, just seeking a needed feature: make gender available for reports]
I was very impressed by gramps ability to print some descendant/ancestry text reports and trees. However there is 1 important feature I feel missing: adding a person's gender (as in list of children) .

I am proposing that somebody knowledgeable in gramps architecture extend some code ( libsubstkeyword.py?),
to assign certain letters (y and Y? seem still available) to the person's gender. I am thinking something along this..
        def gender(self, person, choice): #choice y or Y
             """ A helper method for retrieving the person's gender """
             gender = person.get_gender()
             if gender:
                if choice == "y": # symbol
                    result = ("♂" if gender == person._MALE
                                  else "♀" if gender == person._FMALE else "
")
                elif choice == "Y": # text
                    result = ("male" if gender == person._MALE
                                  else "female" if gender == person._FMALE else "?gender")
                else:
                    result = ""
            return result

Then these letters can be used as part of name format, or in other places for reports customization purposes.

Just an idea. Thanks,
dave

 

Here is the output I am trying to produce:

Descendants of SMITH, Edwin Michael

1    SMITH, Edwin Michael ♂ (b. 1961-05-24 - San Jose, Santa Clara Co., CA, USA)

sp. ADAMS, Janice Ann ♀ (b. 1965-08-26 - Fremont, Alameda Co., CA, USA)

1.1 SMITH, Mason Michael ♂ (b. 1996-06-26 - Hayward, Alameda Co., CA, USA)

1.2 SMITH, Amber Marie ♀ (b. 1998-04-12 - Hayward, Alameda Co., CA, USA)

 

 

I have been inserting code fragment like the above snippet into my private versions of text reports just to fill my needs.  Needless to say it is not my preferred route to maintain private code.

 

If we don’t have resources to address this feature, and while also waiting for future consensus definition of “gender”, I would like to take a stab at extending the People? Gender? Objects or whatever to add this functionality, IF someone can help pointing me to the right direction (where the n$, b$ , d$, m$ are implemented, and how to extend them).  Any help and suggestions will be greatly appreciated, including giving a reason not to do it now.

 

Hope to be useful for a change.  Thanks.

-          Dave

Note:  didn’t mean to hijack the below conversation.  ;)

 

From: Paul Culley [mailto:[hidden email]]
Sent: Wednesday, April 17, 2019 4:28 PM
To: [hidden email]
Cc: [hidden email]
Subject: Re: [Gramps-devel] 2 questions from a beginner

 

1) The add event 'window' could be one of several things depending on how you are adding.  I suspect you are referring to the the 'displaytab' at the bottom of the Person Editor dialog.  That code is in gramps.gui.editors.displaytabs.eventembedlist.py and eventrefmodel.py.  Or you might be referring to the gramps.gui.editors.editevent.py.

 

I often look at some text string in the dialog that doesn't change; then do a string search across all the files in the gramps source directory.  If you are lucky, it will be in a *.py file, if not it might be in a *.glade file.  But the glade file name is a clue to the .py file name that might include the code.

 

Once you get a sense of our terminology for the various gui elements it is usually pretty easy to find them.

 

Since I am a Windows guy, I use Notepad++ for a lot of my editing and the search across files.  I expect there are good Linux tools for doing the same.

 

2) I use Eclipse with Pydev as my IDE; it has excellent debugging and reasonable editing for Python code.  It runs on Windows and Linux, at least.

 

Paul C.

 

On Wed, Apr 17, 2019 at 3:57 PM <[hidden email]> wrote:

Hi list,

1/ I am trying to figure out how to do something with events in gramps and for that it would be useful if I could find the source code corresponding to a given window in gramps GUI, namely the add event window for a person. My more generic question is: how do I find the source code corresponding to a given dialog in gramps?

 

2/ at the moment, I am editing my new code with sublime-text and uploading to github, however I am used to use things like R studio, vb editor, ipython... tools where I can have a look at the variables values while running experimental code, what is your recommendation?

 

Thanks

Matt

 

_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel



_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: another question from another beginner

Nick Hall
On 20/04/2019 21:43, Dave Khuon wrote:

If we don’t have resources to address this feature, and while also waiting for future consensus definition of “gender”, I would like to take a stab at extending the People? Gender? Objects or whatever to add this functionality, IF someone can help pointing me to the right direction (where the n$, b$ , d$, m$ are implemented, and how to extend them).  Any help and suggestions will be greatly appreciated, including giving a reason not to do it now.

This sounds like a good idea.  If you find it useful, it is likely that others will too.

The relevant code can be found here:

https://github.com/gramps-project/gramps/blob/master/gramps/plugins/lib/libsubstkeyword.py

Feel free to ask questions on this list.

Regards,


Nick.




_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel