amandasaurus / gedcompy

Python library to parse and work with GEDCOM (geneology/family tree) files
GNU General Public License v3.0
39 stars 18 forks source link

UnboundLocalError: local variable 'first' referenced before assignment #19

Open Tuisto59 opened 7 years ago

Tuisto59 commented 7 years ago

Traceback (most recent call last): File "C:\Python27\lib\lib-tk\Tkinter.py", line 1536, in call return self.func(*args) File "Launcher.py", line 1426, in gedcom_step1 self.get_data_gedcom() File "Launcher.py", line 1044, in get_data_gedcom name = " ".join(ind.name) File "C:\Python27\lib\site-packages\gedcom__init__.py", line 431, in name return first, last UnboundLocalError: local variable 'first' referenced before assignment

It's because sometime surname have symbol like "/" to seperate different type of name

it's possible to split at the first "/" ? like:

        vals = preferred_name.value.split("/")

to:

        vals = preferred_name.value.split("/",1)

It's can work ?

Because some people add some special symbol into their Familly tree software like "SMIT/SMITH" in the surname. Now poeple like to add some more information to explain the different kind of writing a surname can have like :

Lefeivre, Lefelvre, Lefesvre, Lefeubvre, Lefeuve, Lefeuvre, Lefève, Lefever, Lefevere, Lefèvres, Lefebvre or with slash Lefeivre / Lefelvre / Lefesvre / Lefeubvre / Lefeuve / Lefeuvre / Lefève / Lefever / Lefevere / Lefèvres / Lefebvre

or regex-like to avoid the writting of all the surname form:

LEFE(I-L-S-U)(B)V(R)E(R)(E)

I use your library in my application, it's can be usefull i I can push out the surnmae and the firstname individually than to call the individu.name method

Thanks

Yoan https://peregrination.jimdo.com/ https://github.com/Tuisto59/Peregrination