For the moment OpenEV saves in project files all paths (raster, shapefiles,
dem, ... filenames) in local system forms (example '/home/dem/tmp/file.tif'
on Unix or 'C:\\my_dir\\tmp\\file.tif' on Windows, other on Mac, ...).
The other limitation is that drive names ('C:', or mount points on Unix)
aren't portable too.
I've implemented OpenEV projects portability between platforms : instead of
saving the local system path, I store the path in "absolute splitted list
form" (without local separator), and if possible in "relative to the
project file form" (if they have common prefix). These informations are
stored in a PortablePath object implemented in pymod/pathutils.py.
PortablePaths can be serialized and InstantiedFromXML, and have a
local_path method to return the local system path by testing first the
"absolute splitted list form" and then the "relative to the project file
form" if it exists. If the local path cannot be retrieved from the
PortablePath, an exception is raised.
The modifications keep backward compatibility with old OpenEV project files
(when reload the project file is reloaded, OpenEV first try to use directly
the XML string as filename ; if the file doesn't exist it try to transform
this XML string to PortablePath and use it).
This solution allows to move projects between platforms, if all data
filenames have a common prefix with the project filename.
I've tested it between Solaris, Linux and Windows.
I've also made another change to don't allow to open project files with
unresolved path(s) into.
For this I've commented the raise in gvutils.XMLInstantiate() ; when
debugging we should reactive it.
Can I commit these changes ?
Note that they use a function only in Python 2.2 (os.realpath) ; is this a