Hello,
I have used a Supertool script to list attributes of people, events, sources and citations.
In Expressions to display I have Gramps_id, title, attribute and it works well.
How to display only non private attributes and how to make them private?
Thank you pour your answer!
Since the âPrivateâ lock (and âprobably livingâ filter) is normally only considered during export and report generation, perhaps you ought to clarify what your goal is in setting Privacy on all the secondary objects?
Generally, when locking the Privacy on a Person, the secondary objects are going to be omitted from the export/report when the Person is omitted.
Setting additional locks might be work that you donât need to do.
(Note that I generally mark all eMail addresses as Private as well as my Research Notes that are logs of discussion threads. Those secondary objects are clearly modern with living people and it is difficult to predict where people will feel confidentiality was implied.)
Thank you emyoulation,
I use attributes for personal informations and researchs in people, events, sources, citations, and I donât want them to be exported. For this, I want to make them private.
In Supertool is it possible to display the âprivate statutâ of these attributs in people, events, sources and citations? And to make them private?
Yes. The script can be Execute without the âCommit changesâ option selected to show the current status and what the status would be after âcommittingâ. Here, I have used the script in Places category with a few places selected from the Example.gramps sample tree. (Added a "longname, type, " to the Expressions to Display to make the results more human-readable):
Just making certain that your goal is to set the Privacy so these items can be excluded in a subsequent Export or for Reports, right? Since there is no global Privacy redaction for data in the GUI. (The filter gramplets can hide stuff⊠but it is sloooowwwww and would have to be filtered at each separate view.)
Given the above assumption, your script above is not doing a .set_privacy(True) for any of the attribute objects being listed. So even if the âcommit changesâ was set, it doesnât make the change. (Since I donât like changing values in the blind, I always .get_privacy() to read the original privacy flag setting, list that and then the updated value. It is reassuring to do a test run without committing changes first.)
Unfortunately Patriceâs code does not work because âattributesâ is just a list of (name,value) tuples and does not give access to the underlying Gramps Attribute objects. Maybe that was a bad design decision but that is how it works.
Instead you could use the lower-level Gramps method âget_attribute_listâ, something like
for attr in obj.get_attribute_list():
if not attr.get_privacy():
attr.set_privacy(True)
You should add some comments that describe the purpose of the script and a URL of this discussion.
A library of saved scripts gets unruly very quickly. So you need strict organization workflows. (It is similar with the more complex custom filters.)
Also, add a bookmark in the GTK File Chooser dialog so you can find your saved scripts easily. (I bookmarked the Gramps User Directory and have a folder for my scripts there.)