From eda23b8ecc73ae2daf78900be2bfbfc9d99d0110 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 1 Aug 2004 04:21:31 +0000 Subject: [PATCH] * src/AddSpouse.py: fix gender selection * src/DbPrompter.py: support other DB formats * src/GrampsBSDDB.py: BSDDB format, derived from GrampsDbBase * src/GrampsDbBase.py: base class for database classes * src/GrampsGEDDB.py: GEDCOM format, derived from GrampsDbBase * src/GrampsXMLDB.py: XML format, derived from GrampsDbBase * src/PeopleModel.py: handle rebuilds better * src/RelLib.py: use try_to_find_person_from_handle * src/WriteXML.py: use gramps ids instead of handles * src/const.py.in: handle family relations correctly * src/gramps_main.py: remove prefix settings * src/data/gnome-mime-application-x-gramps-xml.png: new icon * src/data/gramps.applications: support for x-gramps-xml * src/data/gramps.keys: support for x-gramps-xml * src/data/gramps.mime: support for x-gramps-xml * src/data/gramps.schemas: added event format * src/data/gramps.xml: support for x-gramps-xml * src/plugins/ReadGedcom.py: start of GEDDB support * src/plugins/WriteGedcom.py: start of GEDDB support svn: r3306 --- ChangeLog | 21 + example/gramps/data.gramps | Bin 24343 -> 5599 bytes src/AddSpouse.py | 3 +- src/DbPrompter.py | 16 + src/GrampsBSDDB.py | 1146 +--------------- src/GrampsCfg.py | 6 + src/GrampsDbBase.py | 1186 +++++++++++++++++ src/GrampsGEDDB.py | 102 ++ src/GrampsXMLDB.py | 110 ++ src/PeopleModel.py | 4 +- src/ReadXML.py | 8 +- src/RelLib.py | 16 +- src/WriteXML.py | 10 +- src/const.py.in | 5 +- src/data/Makefile.am | 1 + .../gnome-mime-application-x-gramps-xml.png | Bin 0 -> 2966 bytes src/data/gramps.applications | 2 +- src/data/gramps.keys | 11 + src/data/gramps.mime | 3 + src/data/gramps.schemas | 13 + src/data/gramps.xml | 4 + src/gramps_main.py | 6 +- src/plugins/ReadGedcom.py | 30 +- src/plugins/WriteGedcom.py | 3 + 24 files changed, 1531 insertions(+), 1175 deletions(-) create mode 100644 src/GrampsDbBase.py create mode 100644 src/GrampsGEDDB.py create mode 100644 src/GrampsXMLDB.py create mode 100644 src/data/gnome-mime-application-x-gramps-xml.png diff --git a/ChangeLog b/ChangeLog index e2def9193..5c813927a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2004-07-31 Don Allingham + * src/AddSpouse.py: fix gender selection + * src/DbPrompter.py: support other DB formats + * src/GrampsBSDDB.py: BSDDB format, derived from GrampsDbBase + * src/GrampsDbBase.py: base class for database classes + * src/GrampsGEDDB.py: GEDCOM format, derived from GrampsDbBase + * src/GrampsXMLDB.py: XML format, derived from GrampsDbBase + * src/PeopleModel.py: handle rebuilds better + * src/RelLib.py: use try_to_find_person_from_handle + * src/WriteXML.py: use gramps ids instead of handles + * src/const.py.in: handle family relations correctly + * src/gramps_main.py: remove prefix settings + * src/data/gnome-mime-application-x-gramps-xml.png: new icon + * src/data/gramps.applications: support for x-gramps-xml + * src/data/gramps.keys: support for x-gramps-xml + * src/data/gramps.mime: support for x-gramps-xml + * src/data/gramps.schemas: added event format + * src/data/gramps.xml: support for x-gramps-xml + * src/plugins/ReadGedcom.py: start of GEDDB support + * src/plugins/WriteGedcom.py: start of GEDDB support + 2004-07-30 Don Allingham * src/const.py.in: fix relationship types diff --git a/example/gramps/data.gramps b/example/gramps/data.gramps index 65d86ea43ee668d9aaf4f0c843626ae0f43b6669..ee302713f8b98c2c6368c9d6ee5509ddff6ac8e5 100644 GIT binary patch literal 5599 zcmV<56(H&#iwFogHw-}n|1W57ZDlWHZ*E~PWMy_`Y%gVaVQp}1WiMxPVQp}8FJxhK zVJ>HKVQp}80M$L~cH%gb|K};Z{MfU5P7-YH?56WAwz-B|Fqd#k5Lkf0wv25cJk&nL zzSv4KAtV!nL%Z>r={enCmsF*yQmLv`68Hal(^O^yO-n)guMl^~h8U<%kgVvlU!hhr zcbf|R>*25ae-mp$vs=$HGO)oISdfvrQZrj&LNgO+hIJ>~a){{S3%dz2=$ zATTHMcN&~WI?&*Qh;$~Ss+ccxpx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db.get_person_keys() @@ -498,7 +498,7 @@ class XmlWriter: if ord.get_status() != 0: self.g.write('%s\n' % (sp2,ord.get_status())) if ord.get_family_handle(): - self.g.write('%s\n' % (sp2,self.fix(ord.get_family_handle().get_handle()))) + self.g.write('%s\n' % (sp2,self.fix(ord.get_family_handle().get_gramps_id()))) if ord.get_note() != "": self.write_note("note",ord.get_note_object(),index+1) for s in ord.get_source_references(): @@ -533,7 +533,7 @@ class XmlWriter: def write_id(self,label,person,index=1): if person: - self.g.write('%s<%s id="%s"' % (" "*index,label,person.get_handle())) + self.g.write('%s<%s id="%s"' % (" "*index,label,person.get_gramps_id())) comp = person.get_complete() if comp: self.g.write(' complete="1"') @@ -792,8 +792,8 @@ class XmlWriter: # #------------------------------------------------------------------------- def sortById(first,second): - fid = first.get_handle() - sid = second.get_handle() + fid = first.get_gramps_id() + sid = second.get_gramps_id() if fid < sid: return -1 diff --git a/src/const.py.in b/src/const.py.in index 92e91fb4e..7fe0bab7e 100644 --- a/src/const.py.in +++ b/src/const.py.in @@ -483,7 +483,10 @@ def display_frel(st): return family_relations.find_value(st) def save_frel(st): - return family_relations.find_key(st) + try: + return family_relations[st][0] + except: + return _("Unknown") #------------------------------------------------------------------------- # diff --git a/src/data/Makefile.am b/src/data/Makefile.am index 33a60d2bf..b2f63605a 100644 --- a/src/data/Makefile.am +++ b/src/data/Makefile.am @@ -9,6 +9,7 @@ dist_pkgdata_DATA = \ gnome-mime-application-x-gramps.png \ gnome-mime-application-x-gedcom.png \ gnome-mime-application-x-gramps-package.png \ + gnome-mime-application-x-gramps-xml.png \ gramps.applications \ gramps.desktop \ gramps.svg \ diff --git a/src/data/gnome-mime-application-x-gramps-xml.png b/src/data/gnome-mime-application-x-gramps-xml.png new file mode 100644 index 0000000000000000000000000000000000000000..63bef300f3648e428cab6e66315af7ac006e8ea0 GIT binary patch literal 2966 zcmV;H3u*L;P)12{jO-J#HM)7`$k!TP@5CJbBAaWIU*#&m@efnW9?836Urm@;H zv%~Jg^S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SeN}ASSQ&D~yI5QERIbL8R4ABd zU0t0BA=vi2trV9Ocn_jIQSm8<)9DI&Kly**4^X0$zNV%oN=wUVXlP*j_U!;40FA(h z5}qG>px5h2Ntw<4`<>WqHgq~&l#kdW1DOmw+LIuo(ZtZuL(C1vWA96Iy*ZV9v%*vx~Jy%LQ%dx2A1PFu~+(5hs8jw z_xMuc=`{h20S|yKz~%#M_JUXbA2{F!9Dp5gNdYaz(+oV6BQn5$09MgnH${QIlmGw# M07*qoM6N<$f&uQeV*mgE literal 0 HcmV?d00001 diff --git a/src/data/gramps.applications b/src/data/gramps.applications index 8f5ba8c0c..98192823b 100644 --- a/src/data/gramps.applications +++ b/src/data/gramps.applications @@ -4,4 +4,4 @@ gramps can_open_multiple_files=false expects_uris=false requires_terminal=false - mime_types=application/x-gramps,application/x-gedcom,application/x-gramps-package + mime_types=application/x-gramps,application/x-gedcom,application/x-gramps-package,application/x-gramps-xml diff --git a/src/data/gramps.keys b/src/data/gramps.keys index 5c93b8dcc..f70a05bd7 100644 --- a/src/data/gramps.keys +++ b/src/data/gramps.keys @@ -20,6 +20,17 @@ application/x-gramps-package: icon-filename=/usr/share/gramps/gramps.png open=gramps %f +application/x-gramps-xml: + description=GRAMPS XML database + default_action_type=application + short_list_application_ids=gramps + short_list_application_ids_for_novice_user_level=gramps + short_list_application_ids_for_intermediate_user_level=gramps + short_list_application_ids_for_advanced_user_level=gramps + category=Documents/Genealogy + icon-filename=/usr/share/gramps/gramps.png + open=gramps %f + application/x-gedcom: description=GEDCOM default_action_type=application diff --git a/src/data/gramps.mime b/src/data/gramps.mime index 7494685fa..073597b54 100644 --- a/src/data/gramps.mime +++ b/src/data/gramps.mime @@ -1,6 +1,9 @@ application/x-gramps ext: grdb +application/x-gramps-xml + ext: gramps + application/x-gramps-package ext: gpkg diff --git a/src/data/gramps.schemas b/src/data/gramps.schemas index 8cf0db346..dfa29a04c 100644 --- a/src/data/gramps.schemas +++ b/src/data/gramps.schemas @@ -107,6 +107,19 @@ + + /schemas/apps/gramps/preferences/eprefix + /apps/gramps/preferences/eprefix + gramps + string + E%04d + + Default event GRAMPS ID pattern + The new GRAMPS IDs for the events are generated according + to this format string. + + + /schemas/apps/gramps/preferences/iprefix /apps/gramps/preferences/iprefix diff --git a/src/data/gramps.xml b/src/data/gramps.xml index 8525f11ff..e29914ebc 100644 --- a/src/data/gramps.xml +++ b/src/data/gramps.xml @@ -12,4 +12,8 @@ GRAMPS package + + GRAMPS XML database + + diff --git a/src/gramps_main.py b/src/gramps_main.py index 88e2d5d4f..bdde0950a 100755 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -53,6 +53,7 @@ import gtk.gdk #------------------------------------------------------------------------- import RelLib import GrampsBSDDB +import GrampsXMLDB import PedView import MediaView import PlaceView @@ -130,11 +131,6 @@ class Gramps: self.hindex = -1 self.db = GrampsBSDDB.GrampsBSDDB() - self.db.set_iprefix(GrampsCfg.get_iprefix()) - self.db.set_oprefix(GrampsCfg.get_oprefix()) - self.db.set_fprefix(GrampsCfg.get_fprefix()) - self.db.set_sprefix(GrampsCfg.get_sprefix()) - self.db.set_pprefix(GrampsCfg.get_pprefix()) GrampsCfg.loadConfig() diff --git a/src/plugins/ReadGedcom.py b/src/plugins/ReadGedcom.py index 3950baa6c..b26e46c50 100644 --- a/src/plugins/ReadGedcom.py +++ b/src/plugins/ReadGedcom.py @@ -129,6 +129,8 @@ def importData(database, filename, cb=None): # add some checking here glade_file = "%s/gedcomimport.glade" % os.path.dirname(__file__) + if not os.path.isfile(glade_file): + glade_file = "plugins/gedcomimport.glade" statusTop = gtk.glade.XML(glade_file,"status","gramps") statusWindow = statusTop.get_widget("status") @@ -219,6 +221,7 @@ class GedcomParser: self.broken_conc = 0 self.is_ftw = 0 self.idswap = {} + self.gid2id = {} self.f = open(file,"rU") self.filename = file @@ -514,7 +517,7 @@ class GedcomParser: self.indi_count = self.indi_count + 1 id = matches[1] id = id[1:-1] - self.person = self.find_or_create_person(id) + self.person = self.find_or_create_person(self.map_gid(id)) self.added[self.person.get_handle()] = 1 self.parse_individual() self.db.commit_person(self.person, self.trans) @@ -545,14 +548,23 @@ class GedcomParser: if self.idswap.get(id): return self.idswap[id] else: - if self.db.idtrans.get(str(id)): + if self.db.id_trans.get(str(id)): self.idswap[id] = self.db.find_next_gid() else: self.idswap[id] = id return self.idswap[id] - def find_or_create_person(self,id): - person = self.db.find_person_from_gramps_id(self.map_gid(id),self.trans) + def find_or_create_person(self,gramps_id): + person = RelLib.Person() + intid = self.gid2id.get(gramps_id) + if self.db.person_map.has_key(intid): + person.unserialize(self.db.person_map.get(intid)) + else: + intid = Utils.create_id() + person.set_handle(intid) + person.set_gramps_id(gramps_id) + self.db.add_person_as(person,self.trans) + self.gid2id[gramps_id] = intid return person def parse_cause(self,event,level): @@ -620,12 +632,12 @@ class GedcomParser: return elif matches[1] == "HUSB": id = matches[2] - person = self.find_or_create_person(id[1:-1]) + person = self.find_or_create_person(self.map_gid(id[1:-1])) self.family.set_father_handle(person.get_handle()) self.ignore_sub_junk(2) elif matches[1] == "WIFE": id = matches[2] - person = self.find_or_create_person(id[1:-1]) + person = self.find_or_create_person(self.map_gid(id[1:-1])) self.family.set_mother_handle(person.get_handle()) self.ignore_sub_junk(2) elif matches[1] == "SLGS": @@ -639,7 +651,7 @@ class GedcomParser: elif matches[1] == "CHIL": mrel,frel = self.parse_ftw_relations(2) id = matches[2] - child = self.find_or_create_person(id[1:-1]) + child = self.find_or_create_person(self.map_gid(id[1:-1])) self.family.add_child_handle(child.get_handle()) for f in child.get_parent_family_handle_list(): @@ -1734,7 +1746,7 @@ class GedcomParser: new_key = prefix % val new_pmax = max(new_pmax,val) - person = self.db.find_person_from_handle(pid,self.trans) + person = self.db.try_to_find_person_from_handle(pid,self.trans) # new ID is not used if not self.db.has_person_handle(new_key): @@ -1743,7 +1755,7 @@ class GedcomParser: person.set_gramps_id(new_key) self.db.add_person(person,self.trans) else: - tp = self.db.find_person_from_handle(new_key,self.trans) + tp = self.db.try_to_find_person_from_handle(new_key,self.trans) # same person, just change it if person == tp: self.db.remove_person_handle(pid,self.trans) diff --git a/src/plugins/WriteGedcom.py b/src/plugins/WriteGedcom.py index 054d21277..8def35f8a 100644 --- a/src/plugins/WriteGedcom.py +++ b/src/plugins/WriteGedcom.py @@ -374,6 +374,9 @@ class GedcomWriterOptionBox: self.adopt = GedcomInfo.ADOPT_EVENT glade_file = "%s/gedcomexport.glade" % os.path.dirname(__file__) + if not os.path.isfile(glade_file): + glade_file = "plugins/gedcomexport.glade" + self.topDialog = gtk.glade.XML(glade_file,"gedcomExport","gramps") self.topDialog.signal_autoconnect({ "gnu_free" : self.gnu_free,