* src/plugins/WriteGedcom.py: Fix image path problem.
svn: r3272
This commit is contained in:
parent
e6780e09f2
commit
a4badb4bd9
@ -1,6 +1,7 @@
|
|||||||
2004-07-13 Alex Roitman <shura@alex.neuro.umn.edu>
|
2004-07-13 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||||
* src/Exporter.py: Fix EXPAND/FILL state of the chooser widget.
|
* src/Exporter.py: Fix EXPAND/FILL state of the chooser widget.
|
||||||
* src/DbPrompter.py (SaveAsDbPrompter): Remove class.
|
* src/DbPrompter.py (SaveAsDbPrompter): Remove class.
|
||||||
|
* src/plugins/WriteGedcom.py: Fix image path problem.
|
||||||
|
|
||||||
2004-07-12 Don Allingham <dallingham@users.sourceforge.net>
|
2004-07-12 Don Allingham <dallingham@users.sourceforge.net>
|
||||||
* src/plugins/WriteGedcom.py: use the correct id value
|
* src/plugins/WriteGedcom.py: use the correct id value
|
||||||
|
@ -142,7 +142,7 @@ class Exporter:
|
|||||||
'your data, or convert it to a format that will allow '
|
'your data, or convert it to a format that will allow '
|
||||||
'you to trasnfer it to a different program.\n\n'
|
'you to trasnfer it to a different program.\n\n'
|
||||||
'If you change your mind during this process, you '
|
'If you change your mind during this process, you '
|
||||||
'can safely press Cancel button at any time and your '
|
'can safely press the Cancel button at any time and your '
|
||||||
'present database will still be intact.'))
|
'present database will still be intact.'))
|
||||||
return p
|
return p
|
||||||
|
|
||||||
@ -222,8 +222,8 @@ class Exporter:
|
|||||||
self.last_page.set_title(_('Saving failed'))
|
self.last_page.set_title(_('Saving failed'))
|
||||||
self.last_page.set_text(_('There was an error '
|
self.last_page.set_text(_('There was an error '
|
||||||
'while saving your data. Please go back and try again.\n\n'
|
'while saving your data. Please go back and try again.\n\n'
|
||||||
'Your currently opened database is safe, it is a copy '
|
'Note: your currently opened database is safe. It was only '
|
||||||
'of your data that failed to save.'))
|
'a copy of your data that failed to save.'))
|
||||||
|
|
||||||
def build_format_page(self):
|
def build_format_page(self):
|
||||||
"""
|
"""
|
||||||
|
@ -472,6 +472,8 @@ class GedcomWriterOptionBox:
|
|||||||
if self.images:
|
if self.images:
|
||||||
images_path = self.topDialog.get_widget ("images_path")
|
images_path = self.topDialog.get_widget ("images_path")
|
||||||
self.images_path = unicode(images_path.get_text ())
|
self.images_path = unicode(images_path.get_text ())
|
||||||
|
else:
|
||||||
|
self.images_path = ""
|
||||||
|
|
||||||
self.dest = self.target_ged.get_dest()
|
self.dest = self.target_ged.get_dest()
|
||||||
self.adopt = self.target_ged.get_adopt()
|
self.adopt = self.target_ged.get_adopt()
|
||||||
@ -536,6 +538,7 @@ class GedcomWriter:
|
|||||||
self.private = self.option_box.private
|
self.private = self.option_box.private
|
||||||
self.copy = self.option_box.copy
|
self.copy = self.option_box.copy
|
||||||
self.images = self.option_box.images
|
self.images = self.option_box.images
|
||||||
|
self.images_path = self.option_box.images_path
|
||||||
self.target_ged = self.option_box.target_ged
|
self.target_ged = self.option_box.target_ged
|
||||||
self.dest = self.option_box.dest
|
self.dest = self.option_box.dest
|
||||||
self.adopt = self.option_box.adopt
|
self.adopt = self.option_box.adopt
|
||||||
@ -617,11 +620,11 @@ class GedcomWriter:
|
|||||||
msg2 = _("Could not create %s") % filename
|
msg2 = _("Could not create %s") % filename
|
||||||
ErrorDialog(msg2,str(msg))
|
ErrorDialog(msg2,str(msg))
|
||||||
# self.progress.destroy()
|
# self.progress.destroy()
|
||||||
return
|
return 0
|
||||||
except:
|
except:
|
||||||
ErrorDialog(_("Could not create %s") % filename)
|
ErrorDialog(_("Could not create %s") % filename)
|
||||||
# self.progress.destroy()
|
# self.progress.destroy()
|
||||||
return
|
return 0
|
||||||
|
|
||||||
date = time.ctime(time.time()).split()
|
date = time.ctime(time.time()).split()
|
||||||
|
|
||||||
@ -698,6 +701,7 @@ class GedcomWriter:
|
|||||||
|
|
||||||
self.writeln("0 TRLR")
|
self.writeln("0 TRLR")
|
||||||
self.g.close()
|
self.g.close()
|
||||||
|
return 1
|
||||||
|
|
||||||
def write_copy(self):
|
def write_copy(self):
|
||||||
import time
|
import time
|
||||||
@ -1000,10 +1004,12 @@ class GedcomWriter:
|
|||||||
photos = []
|
photos = []
|
||||||
|
|
||||||
for photo in photos:
|
for photo in photos:
|
||||||
if photo.ref.get_mime_type() == "image/jpeg":
|
photo_obj_id = photo.get_reference_id()
|
||||||
|
photo_obj = self.db.try_to_find_object_from_id(photo_obj_id)
|
||||||
|
if photo_obj and photo_obj.get_mime_type() == "image/jpeg":
|
||||||
self.writeln('1 OBJE')
|
self.writeln('1 OBJE')
|
||||||
self.writeln('2 FORM jpeg')
|
self.writeln('2 FORM jpeg')
|
||||||
path = photo.ref.get_path ()
|
path = photo_obj.get_path ()
|
||||||
dirname = os.path.join (self.dirname, self.images_path)
|
dirname = os.path.join (self.dirname, self.images_path)
|
||||||
basename = os.path.basename (path)
|
basename = os.path.basename (path)
|
||||||
self.writeln('2 FILE %s' % os.path.join(self.images_path,
|
self.writeln('2 FILE %s' % os.path.join(self.images_path,
|
||||||
@ -1269,8 +1275,7 @@ def exportData(database,filename,person,option_box):
|
|||||||
ret = 0
|
ret = 0
|
||||||
try:
|
try:
|
||||||
gw = GedcomWriter(database,person,0,filename,option_box)
|
gw = GedcomWriter(database,person,0,filename,option_box)
|
||||||
gw.export_data(filename)
|
ret = gw.export_data(filename)
|
||||||
ret = 1
|
|
||||||
except:
|
except:
|
||||||
import DisplayTrace
|
import DisplayTrace
|
||||||
DisplayTrace.DisplayTrace()
|
DisplayTrace.DisplayTrace()
|
||||||
@ -1283,7 +1288,7 @@ def exportData(database,filename,person,option_box):
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
_title = _('GE_DCOM 5.5')
|
_title = _('GE_DCOM 5.5')
|
||||||
_description = _('GEDCOM is used to transfer data between genealogy programs. '
|
_description = _('GEDCOM is used to transfer data between genealogy programs. '
|
||||||
'Nearly all genealogy software will accept a GEDCOM file as input. ')
|
'Most genealogy software will accept a GEDCOM file as input. ')
|
||||||
#option_box = GedcomWriterOptionBox()
|
#option_box = GedcomWriterOptionBox()
|
||||||
_config = (_('GEDCOM export options'),GedcomWriterOptionBox)
|
_config = (_('GEDCOM export options'),GedcomWriterOptionBox)
|
||||||
_filename = 'ged'
|
_filename = 'ged'
|
||||||
|
Loading…
Reference in New Issue
Block a user