Re: User config

Graham White wrote:


>> IsaViz locates the current user's home directory and tries to get an 
>> isaviz.cfg file from it. If it fails to find one, it tries to load the 
>> one located in IsaViz' main dir.
> 
> 
> This is clearly not happening, because, if I modify the isaviz.cfg file
> in the IsaViz main dir, and if I don't have an isaviz.cfg file in my
> home dir, then, when I launch IsaViz, I get its own (Windows
> style) defaults, rather than the ones that I've put into the isaviz.cfg
> file in the IsaViz main dir. It's a mystery to me where it gets
> them from, but it does.

The default file is searched in the directory where IsaViz is launched 
from (execution directory). If you do not start it in the directory 
where run.bat or run.sh are located, it will fail to find it, reverting 
back to hardcoded default values. There might be a bug somewhere though.

To get an idea of what values are set for relevant directories, you can 
go to the Help/About IsaViz menu, where you will get info about:
- item 'user home directory' which is where the user's cfg file is 
searched for,
- the execution directory (item "launching from") which is where the 
default cfg file is searched for.


>> I don't know how this fits with what you are trying to do. I'm willing 
>> to modify the code so that you can give a command line parameter to 
>> say where the CFG file should be loaded from (if that's what you need).
> 
> I don't think the IsaViz behaviour makes any sense, and being able to
> specify another configuration file on the command line would not help
> matters. I think that what should happen is that, *for each
> configuration item*, it should look to see whether the user
> has a configuration file and whether that item is set
> in it, and if that is not the case, then
> it should get it from a default file (presumably in the IsaViz main 
> directory). 
> This is the way that, for example, the Preferences class
> in Java works, or the NextStep/OSX NetInfo system. It makes sense
> in the case of IsaViz, because there are configuration items
> (such as the location of the dot executable) which ought
> to be set system-wide, there are items (such as the web browser) for
> which there certainly ought to be a system-wide default but which
> the user ought to be able to override, and there are items
> (such as the RDF directory) which ought to be set user by user
> (though perhaps in this case a default relative to the user's
> home directory would be good).

That would indeed be a better way to handle preferences. I'll implement 
this when I get time.

Thanks for the suggestion,
Emmanuel

-- 
Emmanuel Pietriga (epietriga@nuxeo.com)
http://claribole.net

Received on Thursday, 4 March 2004 03:49:53 UTC