2006-11-28 Alex Roitman <shura@gramps-project.org>

* src/plugins/MediaManager.py (get_rel_path): Correctly work out
	the drive letter for the path.



svn: r7726
This commit is contained in:
Alex Roitman 2006-11-28 21:50:34 +00:00
parent bf9a96ea4a
commit fa80fc16d6
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2006-11-28 Alex Roitman <shura@gramps-project.org>
* src/plugins/MediaManager.py (get_rel_path): Correctly work out
the drive letter for the path.
2006-11-27 Alex Roitman <shura@gramps-project.org>
* src/DbLoader.py (DbLoader.save_as): Prohibit SaveAs into the
currently opened database.
@ -5,8 +9,6 @@
opened database.
* src/GrampsDb/_WriteXML.py (dump_person_ref): Properly export
associations.
2006-11-27 Alex Roitman <shura@phy.ucsf.edu>
* src/GrampsDb/_WriteGedcom.py (write_person): Typo.
2006-11-27 Martin Hawlisch <Martin.Hawlisch@gmx.de>

View File

@ -560,6 +560,13 @@ def get_rel_path(db_dir,obj_path):
obj_dir = os.path.dirname(os.path.normpath(obj_path))
obj_name = os.path.basename(os.path.normpath(obj_path))
# If the db_dir and obj_dir are on different drives (win only)
# then there cannot be a relative path. Return original obj_path
(db_drive,db_dir) = os.path.splitdrive(db_dir)
(obj_drive,obj_dir) = os.path.splitdrive(obj_dir)
if db_drive.upper() != obj_drive.upper():
return obj_path
# Get the list of dirnames for each
db_dir_list = [word for word in db_dir.split(os.path.sep) if word]
obj_dir_list = [word for word in obj_dir.split(os.path.sep) if word]