I have been itching to implement this feature that I have submitted sometime ago:
Here is its description:
0010378: Add option to show gender for reports that support "Substitution Values"
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.
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.
Note: didn’t mean to hijack the below conversation. ;)
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.
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?
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.