Compare commits

..

1 Commits

Author SHA1 Message Date
Serge Noiraud
32e426b57f bug 8528: local variable 'body' referenced before assignment
bug report and fix the day of the release...
2015-05-02 10:39:25 +02:00
10 changed files with 813 additions and 872 deletions

View File

@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>Gramps</string>
<key>CFBundleGetInfoString</key>
<string>Gramps 3.4.9-1, (C) 1997-2015 The Gramps Team http://www.gramps-project.org</string>
<string>Gramps 3.4.8-1, (C) 1997-2014 The Gramps Team http://www.gramps-project.org</string>
<key>CFBundleIconFile</key>
<string>gramps.icns</string>
<key>CFBundleIdentifier</key>
@@ -17,15 +17,15 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.4.9-1</string>
<string>3.4.8-1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleName</key>
<string>Gramps</string>
<key>CFBundleVersion</key>
<string>3.4.9-1</string>
<string>3.4.8-1</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 1997 - 2015 The Gramps Team, GNU General Public License.</string>
<string>Copyright 1997 - 2014 The Gramps Team, GNU General Public License.</string>
<key>LSMinimumSystemVersion</key>
<string>10.5</string>
</dict>

View File

@@ -72,7 +72,7 @@
</binary>
<binary>
${prefix}/lib/libgtkmacintegration-gtk2.2.dylib
${prefix}/lib/libgtkmacintegration.2.dylib
</binary>
<binary>
@@ -100,7 +100,7 @@
</binary>
<binary>
${prefix}/lib/libtiff.5.dylib
${prefix}/lib/libtiff.3.dylib
</binary>
<binary dest="${bundle}/Contents/MacOS/">

View File

@@ -23,7 +23,7 @@ export GTK_PATH="$bundle_res"
export PANGO_RC_FILE="$bundle_etc/pango/pangorc"
export PANGO_SYSCONFDIR="$bundle_etc"
export PANGO_LIBDIR="$bundle_lib"
export GDK_PIXBUF_MODULE_FILE="$bundle_lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
if [ `uname -r | cut -d . -f 1` -ge 10 ]; then
export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules"
fi

View File

@@ -63,7 +63,7 @@ ige-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
<!--include href="/Users/john/Development/GTK-OSX/gtk-osx-build/modulesets-stable/gtk-osx.modules"/-->
<autotools id="gramps" autogen-sh="configure">
<branch module="gramps/gramps-3.4.9.tar.gz" version="3.4.9"
<branch module="gramps/gramps-3.4.8.tar.gz" version="3.4.8"
repo="sourceforge">
</branch>
<dependencies>

1429
po/cs.po

File diff suppressed because it is too large Load Diff

View File

@@ -356,7 +356,7 @@ class GeneWebParser(object):
def read_children_source_line(self,line,fields):
csrc = self.get_or_create_source(self.decode(fields[1]))
self.current_child_source_handle = csrc.handle
self.current_child_source_handle = csrc
return None
def read_family_comment(self,line,fields):

View File

@@ -637,8 +637,7 @@ class GrampsParser(UpdateCallback):
"datestr": (self.start_datestr, None),
"places": (None, self.stop_places),
"placeobj": (self.start_placeobj, self.stop_placeobj),
"ptitle": (None, self.stop_ptitle),
"locality": (None, self.stop_locality),
"ptitle": (None, self.stop_ptitle),
"location": (self.start_location, None),
"lds_ord": (self.start_lds_ord, self.stop_lds_ord),
"temple": (self.start_temple, None),

View File

@@ -2832,31 +2832,22 @@ class GedcomParser(UpdateCallback):
return place
return None
def __add_place(self, event, sub_state):
def __create_place(self, title, location):
"""
Add a new place to an event if not already present, or update a
place.
Create a new place based on the title and primary location.
@param event: The event
@type event: gen.lib.Event
@param substate: The sub-state for PLAC or ADDR elements (i.e. parsed by
event_parse_tbl)
@type sub_state: CurrentState
@param title: The place title
@type title: string
@param location: The current location
@type location: gen.lib.Location
@return gen.lib.Place
"""
if sub_state.place:
# see whether this place already exists
place = self.__find_place(sub_state.place.get_title(),
sub_state.place.get_main_location())
if place is None:
place = sub_state.place
self.dbase.add_place(place, self.trans)
self.place_names[place.get_title()].append(place.get_handle())
event.set_place_handle(place.get_handle())
else:
place.merge(sub_state.place)
self.dbase.commit_place(place, self.trans)
event.set_place_handle(place.get_handle())
sub_state.pf.load_place(place, place.get_title())
place = gen.lib.Place()
place.set_title(title)
place.set_main_location(location)
self.dbase.add_place(place, self.trans)
self.place_names[title].append(place.get_handle())
return place
def __find_file(self, fullname, altpath):
tries = []
@@ -3763,13 +3754,10 @@ class GedcomParser(UpdateCallback):
sub_state.level = state.level+1
sub_state.event = event
sub_state.event_ref = event_ref
sub_state.pf = self.place_parser
self.__parse_level(sub_state, self.event_parse_tbl, self.__undefined)
state.msg += sub_state.msg
self.__add_place(event, sub_state)
self.dbase.commit_event(event, self.trans)
event_ref.ref = event.handle
state.person.add_event_ref(event_ref)
@@ -3970,13 +3958,10 @@ class GedcomParser(UpdateCallback):
sub_state.level = state.level+1
sub_state.event = event
sub_state.event_ref = event_ref
sub_state.pf = self.place_parser
self.__parse_level(sub_state, self.event_parse_tbl, self.__undefined)
state.msg += sub_state.msg
self.__add_place(event, sub_state)
self.dbase.add_event(event, self.trans)
event_ref.ref = event.handle
state.person.add_event_ref(event_ref)
@@ -4423,14 +4408,11 @@ class GedcomParser(UpdateCallback):
try:
title = line.data
place = self.__find_place(title, None)
if place is None:
place = gen.lib.Place()
place.set_title(title)
self.dbase.add_place(place, self.trans)
self.place_names[place.get_title()].append(place.get_handle())
if place:
state.place = place
else:
pass
state.lds_ord.set_place_handle(place.handle)
state.place = self.__create_place(title, None)
state.lds_ord.set_place_handle(state.place.handle)
except NameError:
return
@@ -4791,13 +4773,10 @@ class GedcomParser(UpdateCallback):
sub_state.level = state.level+1
sub_state.event = event
sub_state.event_ref = event_ref
sub_state.pf = self.place_parser
self.__parse_level(sub_state, self.event_parse_tbl, self.__undefined)
state.msg += sub_state.msg
self.__add_place(event, sub_state)
if event.type == gen.lib.EventType.MARRIAGE:
descr = event.get_description()
if descr == "Civil Union":
@@ -4837,12 +4816,9 @@ class GedcomParser(UpdateCallback):
sub_state.level = state.level+1
sub_state.event = event
sub_state.event_ref = event_ref
sub_state.pf = self.place_parser
self.__parse_level(sub_state, self.event_parse_tbl, self.__undefined)
state.msg += sub_state.msg
self.__add_place(event, sub_state)
self.dbase.commit_event(event, self.trans)
event_ref.ref = event.handle
@@ -5265,33 +5241,74 @@ class GedcomParser(UpdateCallback):
@type state: CurrentState
"""
location = None
if self.is_ftw and state.event.type in FTW_BAD_PLACE:
state.event.set_description(line.data)
else:
place = state.place
if place:
title = line.data
place_handle = state.event.get_place_handle()
if place_handle:
# We encounter a PLAC, having previously encountered an ADDR
if place.get_title() and place.get_title() != "":
old_place = self.dbase.get_place_from_handle(place_handle)
old_title = old_place.get_title()
location = old_place.get_main_location()
if old_title != "":
# We have previously found a PLAC
self.__add_msg(_("A second PLAC ignored"), line, state)
# ignore this second PLAC, and use the old one
title = old_title
place = old_place
else:
# This is the first PLAC
place.set_title(line.data)
refs = list(self.dbase.find_backlink_handles(place_handle))
# We haven't commited the event yet, so the place will not
# be linked to it. If there are any refs they will be from
# other events (etc)
if len(refs) == 0:
place = self.__find_place(title, location)
if place is None:
place = old_place
place.set_title(title)
self.place_names[old_title].remove(place_handle)
self.place_names[title].append(place_handle)
else:
place.merge(old_place)
self.dbase.remove_place(place_handle, self.trans)
self.place_names[old_title].remove(place_handle)
else:
place = self.__find_place(title, location)
if place is None:
place = self.__create_place(title, location)
else:
pass
else:
# The first thing we encounter is PLAC
state.place = gen.lib.Place()
place = state.place
place.set_title(line.data)
location = None
place = self.__find_place(title, location)
if place is None:
place = self.__create_place(title, location)
state.event.set_place_handle(place.handle)
sub_state = CurrentState()
sub_state.place = place
sub_state.level = state.level+1
sub_state.pf = self.place_parser
self.__parse_level(sub_state, self.event_place_map,
self.__undefined)
state.msg += sub_state.msg
sub_state.pf.load_place(place, place.get_title())
# If we already had a remembered location, we set it into the main
# location if that is empty, else the alternate location
if location and not location.is_empty():
if place.get_main_location().is_empty():
place.set_main_location(location)
else:
place.add_alternate_locations(location)
self.dbase.commit_place(place, self.trans)
def __event_place_note(self, line, state):
"""
@param line: The current line in GedLine format
@@ -5411,29 +5428,53 @@ class GedcomParser(UpdateCallback):
self.__merge_address(free_form, sub_state.location, line, state)
location = sub_state.location
place = state.place
if place:
place_handle = state.event.get_place_handle()
if place_handle:
# We encounter an ADDR having previously encountered a PLAC
if len(place.get_alternate_locations()) != 0 and \
not place.get_main_location().is_empty():
old_place = self.dbase.get_place_from_handle(place_handle)
title = old_place.get_title()
if not old_place.get_main_location().is_empty():
# We have perviously found an ADDR, or have populated location
# from PLAC title
self.__add_msg(_("Location already populated; ADDR ignored"),
line, state)
# ignore this second ADDR, and use the old one
location = old_place.get_main_location()
place = old_place
else:
# This is the first ADDR
place.set_main_location(location)
refs = list(self.dbase.find_backlink_handles(place_handle))
# We haven't commited the event yet, so the place will not be
# linked to it. If there are any refs they will be from other
# events (etc)
if len(refs) == 0:
place = self.__find_place(title, location)
if place is None:
place = old_place
place.set_main_location(location)
else:
place.merge(old_place)
self.dbase.remove_place(place_handle, self.trans)
self.place_names[title].remove(place_handle)
else:
place = self.__find_place(title, location)
if place is None:
place = self.__create_place(title, location)
else:
pass
else:
# The first thing we encounter is ADDR
state.place = gen.lib.Place()
place = state.place
place.set_main_location(location)
title = ""
place = self.__find_place(title, location)
if place is None:
place = self.__create_place(title, location)
# merge notes etc into place
place.merge(sub_state.place)
state.event.set_place_handle(place.get_handle())
self.dbase.commit_place(place, self.trans)
def __add_location(self, place, location):
"""
@param place: A place object we have found or created
@@ -5461,10 +5502,12 @@ class GedcomParser(UpdateCallback):
@param state: The current state
@type state: CurrentState
"""
place = state.place
if place:
place_handle = state.event.get_place_handle()
if place_handle:
place = self.dbase.get_place_from_handle(place_handle)
location = place.get_main_location()
location.set_phone(line.data)
self.dbase.commit_place(place, self.trans)
def __event_privacy(self, line, state):
"""
@@ -7369,13 +7412,9 @@ class GedcomParser(UpdateCallback):
sub_state.event_ref = event_ref
sub_state.event = event
sub_state.person = state.person
sub_state.pf = self.place_parser
self.__parse_level(sub_state, event_map, self.__undefined)
state.msg += sub_state.msg
self.__add_place(event, sub_state)
self.dbase.commit_event(event, self.trans)
event_ref.set_reference_handle(event.handle)
@@ -7397,13 +7436,10 @@ class GedcomParser(UpdateCallback):
sub_state.level = state.level+1
sub_state.event = event
sub_state.event_ref = event_ref
sub_state.pf = self.place_parser
self.__parse_level(sub_state, event_map, self.__undefined)
state.msg += sub_state.msg
self.__add_place(event, sub_state)
self.dbase.commit_event(event, self.trans)
event_ref.set_reference_handle(event.handle)
return event_ref
@@ -7588,9 +7624,9 @@ class GedcomStageOne(object):
continue
if level == 0 and key[0] == '@':
if value in ("FAM", "FAMILY") :
if value == ("FAM", "FAMILY") :
current_family_id = key.strip()[1:-1]
elif value in ("INDI", "INDIVIDUAL"):
elif value == ("INDI", "INDIVIDUAL"):
self.pcnt += 1
elif key in ("HUSB", "HUSBAND", "WIFE") and \
self.__is_xref_value(value):

View File

@@ -58,47 +58,6 @@ import LdsUtils
from gen.db.dbconst import *
import const
LDS_ORD_BAPT_STATUS = (
gen.lib.LdsOrd.STATUS_NONE,
gen.lib.LdsOrd.STATUS_CHILD, gen.lib.LdsOrd.STATUS_CLEARED,
gen.lib.LdsOrd.STATUS_COMPLETED, gen.lib.LdsOrd.STATUS_INFANT,
gen.lib.LdsOrd.STATUS_PRE_1970, gen.lib.LdsOrd.STATUS_QUALIFIED,
gen.lib.LdsOrd.STATUS_STILLBORN, gen.lib.LdsOrd.STATUS_SUBMITTED,
gen.lib.LdsOrd.STATUS_UNCLEARED)
LDS_ORD_CHILD_SEALING_STATUS = (
gen.lib.LdsOrd.STATUS_NONE,
gen.lib.LdsOrd.STATUS_BIC, gen.lib.LdsOrd.STATUS_CLEARED,
gen.lib.LdsOrd.STATUS_COMPLETED,gen.lib.LdsOrd.STATUS_DNS,
gen.lib.LdsOrd.STATUS_PRE_1970, gen.lib.LdsOrd.STATUS_QUALIFIED,
gen.lib.LdsOrd.STATUS_STILLBORN, gen.lib.LdsOrd.STATUS_SUBMITTED,
gen.lib.LdsOrd.STATUS_UNCLEARED)
LDS_ENDOWMENT_DATE_STATUS = (
gen.lib.LdsOrd.STATUS_NONE,
gen.lib.LdsOrd.STATUS_CHILD, gen.lib.LdsOrd.STATUS_CLEARED,
gen.lib.LdsOrd.STATUS_COMPLETED, gen.lib.LdsOrd.STATUS_INFANT,
gen.lib.LdsOrd.STATUS_PRE_1970, gen.lib.LdsOrd.STATUS_QUALIFIED,
gen.lib.LdsOrd.STATUS_STILLBORN, gen.lib.LdsOrd.STATUS_SUBMITTED,
gen.lib.LdsOrd.STATUS_UNCLEARED)
LDS_SPOUSE_SEALING_DATE_STATUS = (
gen.lib.LdsOrd.STATUS_NONE,
gen.lib.LdsOrd.STATUS_CANCELED, gen.lib.LdsOrd.STATUS_CLEARED,
gen.lib.LdsOrd.STATUS_COMPLETED, gen.lib.LdsOrd.STATUS_DNS,
gen.lib.LdsOrd.STATUS_DNS_CAN, gen.lib.LdsOrd.STATUS_PRE_1970,
gen.lib.LdsOrd.STATUS_QUALIFIED, gen.lib.LdsOrd.STATUS_SUBMITTED,
gen.lib.LdsOrd.STATUS_UNCLEARED)
LDS_INDIVIDUAL_ORD = [(gen.lib.LdsOrd.BAPTISM, LDS_ORD_BAPT_STATUS),
(gen.lib.LdsOrd.CONFIRMATION, LDS_ORD_BAPT_STATUS),
(gen.lib.LdsOrd.ENDOWMENT, LDS_ENDOWMENT_DATE_STATUS),
(gen.lib.LdsOrd.SEAL_TO_PARENTS,
LDS_ORD_CHILD_SEALING_STATUS)]
LDS_SPOUSE_SEALING = [(gen.lib.LdsOrd.SEAL_TO_SPOUSE,
LDS_SPOUSE_SEALING_DATE_STATUS)]
#-------------------------------------------------------------------------
#
#
@@ -1582,17 +1541,14 @@ class TestcaseGenerator(tool.BatchTool):
while randint(0,1) == 1:
ldsord = gen.lib.LdsOrd()
self.fill_object( ldsord)
if isinstance(o,gen.lib.Person):
lds_type = choice([item for item in LDS_INDIVIDUAL_ORD] )
if isinstance(o,gen.lib.Family):
lds_type = LDS_SPOUSE_SEALING[0]
if self.generated_families:
ldsord.set_family_handle(
choice(self.generated_families))
ldsord.set_type(lds_type[0])
status = choice(lds_type[1])
if status != gen.lib.LdsOrd.STATUS_NONE:
ldsord.set_status(status)
# TODO: adapt type and status to family/person
#if isinstance(o,gen.lib.Person):
#if isinstance(o,gen.lib.Family):
ldsord.set_type( choice(
[item[0] for item in gen.lib.LdsOrd._TYPE_MAP] ))
ldsord.set_status( randint(0,len(gen.lib.LdsOrd._STATUS_MAP)-1))
if self.generated_families:
ldsord.set_family_handle( choice(self.generated_families))
o.add_lds_ord( ldsord)
if isinstance(o,gen.lib.Location):

View File

@@ -168,7 +168,6 @@
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow4">
<property name="height_request">150</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>