fvpolpeta / devide

Automatically exported from code.google.com/p/devide
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Path substitution logic (primarily for data relative to dvn path) #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When saving a network to disk, DeVIDE should automatically convert all
paths specified in the DVN, if they are below the DVN path, to relative
paths with some keyword, for example $(DV_NPATH)/the/rest/data.dat

Everytime that the DVN is saved, DeVIDE should check the filenames and
modify them if required.  Everytime that a network is loaded, the filenames
should be checked again and expanded if necessary.

Original issue reported on code.google.com by cpbotha on 9 Jul 2008 at 12:12

GoogleCodeExporter commented 9 years ago

Original comment by cpbotha on 9 Jul 2008 at 12:12

GoogleCodeExporter commented 9 years ago
NetworkManager.save_network() and load_network() would be the place to integrate
this.  In save_network(), it should definitely be an optional thing (for 
example when
the user selects "export network" and not "save network").  In load_network, if 
it
finds $(DVN_DIR), it should always substitute.

I'm thinking a separate substitute / unsubstitute method that can be invoked by
load_network and save_network.

The following would generate a list of all keys containing potential filenames:
[k for k in c.__dict__ if k.find('file') >= 0]
One could then check for string or list values (the latter in the case of the
DICOMReader for example), and then do the (un)substitution.  Easy.

Original comment by cpbotha on 27 Jul 2008 at 8:37

GoogleCodeExporter commented 9 years ago
Fixen in r3199, r3200 and r3201.

Original comment by cpbotha on 31 Jul 2008 at 8:27