* src/AddMedia.py: use full paths for calculations to avoid pwd issues

* src/DbLoader.py: fix working directories
	* example/gramps/example.gramps: remove hard coded paths
	* example/gramps/data.gramps: remove hard coded paths


svn: r6977
This commit is contained in:
Don Allingham
2006-07-01 04:55:36 +00:00
parent 1353edcca9
commit 3f750b2e40
5 changed files with 34 additions and 21 deletions

View File

@@ -131,20 +131,23 @@ class AddMediaObject(ManagedWindow.ManagedWindow):
mobj.set_mime_type(None)
else:
filename = self.file_text.get_filename()
full_file = filename
if self.relpath.get_active():
p = self.db.get_save_path()
if not os.path.isdir(p):
p = os.path.dirname(p)
filename = Utils.relative_path(filename,p)
print os.getcwd(), filename, full_file
if os.path.exists(filename) == 0:
msgstr = _("Cannot import %s")
msgstr2 = _("The filename supplied could not be found.")
ErrorDialog(msgstr % filename, msgstr2)
return
mtype = Mime.get_type(filename)
mtype = Mime.get_type(full_file)
if description == "":
description = os.path.basename(filename)