Question about the name issue

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

Question about the name issue

not.spam+grampsdev
Hi everyone,

I am currently writing a plugin for exporting birthdays as an ICS file.
It is already working, but I would not like to use the preconfigured
name (see below), but nickname alternatively callname alternatively
first name(s) and last name. Don't know the function, where I can use
the specific symbols for parts of the name like 'c', 'x' ... Can
somebody help me with it?

Thank you very much!

#########################

At the moment it looks like this:

from gramps.gen.display.name import displayer as name_displayer

[...]

person_list = db.iter_people()
for person in list(person_list):

[...]

  name = person.get_primary_name()
  name = name_displayer.display_name(name)




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

Re: Question about the name issue

prculley
I'm not quite sure what you want to achieve, so here are some general thoughts.
You could add your own name format, if that does what you want; (in the displayer code see add_name_format) and then reference that one for your addon.

Or, if that doesn't quite do what you want, you could modify the person's name fields with your own code, setting the given name to the value you want, and then using a standard, or modified name format, on the modified person.  As long as you don't save the modified person, this will not affect the db.   In which case you need to carefully look at the gen.lib.name and gen.lib.surname code to fully understand how Gramps names are stored.

Or you could write your own name format routine, skipping the displayer entirely.

Several of the reports allow setting of the name display from the configured name formats; you could look at their code to see how that is done.

Paul C.

On Thu, Jun 11, 2020 at 3:17 AM <[hidden email]> wrote:
Hi everyone,

I am currently writing a plugin for exporting birthdays as an ICS file.
It is already working, but I would not like to use the preconfigured
name (see below), but nickname alternatively callname alternatively
first name(s) and last name. Don't know the function, where I can use
the specific symbols for parts of the name like 'c', 'x' ... Can
somebody help me with it?

Thank you very much!

#########################

At the moment it looks like this:

from gramps.gen.display.name import displayer as name_displayer

[...]

person_list = db.iter_people()
for person in list(person_list):

[...]

  name = person.get_primary_name()
  name = name_displayer.display_name(name)




_______________________________________________
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