I thought it could work something like this:
As a command line option it could be like an include path or a library
path to gcc, i.e. every option "-I path" (or any other name of the
switch, this is the one for includes in gcc) is added to the existing
default list of paths. This could be useful e.g. when calling sage
from a launcher, in which case you could put these options in the
launcher so that it will always be called with these paths when ran
from the launcher.
As an environment variable it could work just like LD_LIBRARY_PATH,
PYTHONPATH or MAGMA_PATH: a list of paths separated by colons (or some
other separator) whose constituents are also added to the existing
list of paths. For reasons of implementation, maybe it is easier to
just use PYTHONPATH for sage files as well.
If this list would be directly accessible from sage, as in python
where it is stored in sys.path (which is read/write), and moreover
there were the possibility to specify a startup script which would be
executed just before entering the session (like in magma when called
with -s, or in bash and many other linux programs where it is a
standard file .bashrc), then you could also append your paths to the
standard list in the startup script.
When calling "load" or "attach" from sage with a non-absolute path, it
would cycle through this list, concatenating the paths with the string
passed to load or attach, until it finds the file.
If you consider this useful, and you could implement any of these in
sage, that would be great!

Thanks,

Utpal


On May 25, 4:48 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
> On 5/25/07, doetoe <[EMAIL PROTECTED]> wrote:
>
>
>
> > Is there a way to set a search path for sage files (for load and
> > attach), e.g. by means of an environment variable or by passing a
> > command line option when starting sage?
> > I looked for it in the documentation, but I couldn't find anything.
>
> This feature doesn't exist yet.  I hadn't thought to implement
> it until you just asked.  Could you perhaps write a little more
> about how you think it would work, so I can implement it.
> If anybody has any other comments about this, please chime up.
>
> William


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to