#378: User-specified path for load and attach
--------------------------------------------+-------------------------------
Reporter: was | Owner: was
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.6.1
Component: user interface | Keywords:
Author: Mitesh Patel, Felix Lawrence | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------------------------+-------------------------------
Comment(by rossk):
It may be too late for the following suggestions but Ill put them forward
in case you think they have enough merit to refactor the code now
(otherwise ignore them or they can go in another ticket). They are based
on the idea that the main things we want to do with a path is: (1) start
Sage with a sensible default (2) display what the current path is (3) set
the path (4) add a folder to the end/beginning of the path (5) reset the
path (6) totally clear the path. (I acknowledge some ideas have come from
other packages e.g. matlab). So here's is how the path may be made to work
in the future. Please let me know what you think. These are just ideas and
doesnt change the good work youve already done - thanks for that!
{{{
# display the default attach-path (unless a SAGE_ATTACH_PATH environment
variable is set, then the attach-path when Sage starts is the path in
SAGE_ATTACH_PATH)
sage: attach_path()
['.']
# set the attach path to a list of folders: ['./folder1','./folder2']
# (Note: if you want the current directory '.' included, you must specify
it)
sage: attach_path(['folder1','folder2'])
# append to the (end of) attach path
sage: attach_path_join(attach_path(), ['folder3'])
# display the attach path
sage: attach_path()
['folder1','folder2','folder3']
# add to the start of the attach path
sage: attach_path_join(['folder0'], attach_path())
# display the attach path again
sage: attach_path()
['folder0','folder1','folder2','folder3']
# append to the (end of) attach path *recursively*
sage: attach_path_join_subfolders(attach_path(), ['folder4'])
# display the attach path
sage: attach_path()
['folder0','folder1','folder2','folder3','folder4','folder4/dir1','folder4/dir2']
# reset the attach path - sets the attach path to the default
sage: reset_attach_path()
# clear the attach path - sets it to '' i.e. neither '.' nor
SAGE_ATTACH_PATH are included (when you want to ensure no implicit
attaching is done or to rebuild the path from scratch)
sage: clear_attach_path()
# display the attach path
sage: attach_path()
[]
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/378#comment:30>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en.