From: Tim L. <guy...@gm...> - 2010-08-23 13:47:03
|
jerome wrote: > >> please note that it doesn't work if you have a family with a spouse >> missing (i.e. an unknown spouse) > > I was not going so far away! I thought it was related to multiple spouses. > So, I just added a rought test on fo.spouse(pid): > > if fo.spouse(pid): > spo = tpeople[fo.spouse(pid)] > fm = Family(p, Person(spo.text())) > last = po.last > if spo.gender == 'M': > last = spo.last > for cpid in fo.children: > cpo = tpeople[cpid] > fm.add_child(do_person(cpid, last)) > #else: > #pass > > Does it mean we need to use try/except when we know to could generate an > error and if (and optional else) for a simple test ? > Maybe there is a notion of function or calculation on try/except, isn't it > ? > Sorry, I am not sure I understand what you are saying. If you are saying that it would be better to do an if/then/else, rather that a try/except, then I agree - as I said, I had done a simple cludge fix that I was not happy with, just to get my report produced quickly. Does it work with multiple spouses, either with your fix or without? -- View this message in context: http://gramps.1791082.n4.nabble.com/Draw-a-family-tree-from-a-GRAMPS-database-tp2322511p2335130.html Sent from the GRAMPS - Dev mailing list archive at Nabble.com. |