diff --git a/src/plugins/lib/libgedcom.py b/src/plugins/lib/libgedcom.py index 84378a8a4..0c29aa464 100644 --- a/src/plugins/lib/libgedcom.py +++ b/src/plugins/lib/libgedcom.py @@ -248,6 +248,7 @@ TOKEN_LONG = 122 TOKEN_FACT = 123 TOKEN_EMAIL = 124 TOKEN_WWW = 125 +TOKEN_URL = 126 TOKENS = { "HEAD" : TOKEN_HEAD, "MEDI" : TOKEN_MEDI, @@ -349,6 +350,7 @@ TOKENS = { "_PAREN" : TOKEN_IGNORE,"_PLACE" : TOKEN_IGNORE, "FACT" : TOKEN_FACT, "EMAIL" : TOKEN_EMAIL, "EMAI" : TOKEN_EMAIL, "WWW" : TOKEN_WWW, + "_URL" : TOKEN_URL, "URL" : TOKEN_URL, } ADOPT_NONE = 0 @@ -1850,7 +1852,9 @@ class GedcomParser(UpdateCallback): TOKEN_CHAN : self.__person_chan, TOKEN_ADDR : self.__person_addr, - TOKEN_PHON : self.__person_phon, + TOKEN_PHON : self.__person_phon, + TOKEN_EMAIL : self.__person_email, + TOKEN_URL : self.__person_url, TOKEN__TODO : self.__skip_record, TOKEN_TITL : self.__person_titl, } @@ -3113,6 +3117,36 @@ class GedcomParser(UpdateCallback): addr.set_street("Unknown") addr.set_phone(line.data) state.person.add_address(addr) + + def __person_email(self, line, state): + """ + O INDI + 1 EMAIL {0:3} + + @param line: The current line in GedLine format + @type line: GedLine + @param state: The current state + @type state: CurrentState + """ + url = gen.lib.Url() + url.set_path(line.data) + url.set_type(gen.lib.UrlType(gen.lib.UrlType.EMAIL)) + state.person.add_url(url) + + def __person_url(self, line, state): + """ + O INDI + 1 URL {0:3} + + @param line: The current line in GedLine format + @type line: GedLine + @param state: The current state + @type state: CurrentState + """ + url = gen.lib.Url() + url.set_path(line.data) + url.set_type(gen.lib.UrlType(gen.lib.UrlType.WEB_HOME)) + state.person.add_url(url) def __person_titl(self, line, state): """