Opened 15 years ago

Last modified 11 years ago

#378 closed enhancement

User-specified path for load and attach — at Version 9

Reported by: was Owned by: was
Priority: major Milestone: sage-4.6.1
Component: user interface Keywords:
Cc: rossk Merged in:
Authors: Mitesh Patel Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by mpatel)

The patch allows

sage: load_attach_path()
['.']
sage: load_attach_path('/path/to/my/sage/scripts')
sage: load_attach_path()
['.', '/path/to/my/sage/scripts']
sage: attach('nifty_script1.sage')
sage: attached_files()
['/path/to/my/sage/scripts/nifty_script1.sage']

You can also set an environment variable:

$ export SAGE_LOAD_ATTACH_PATH="$HOME/foo:$HOME/bar"
$ sage
sage: load_attach_path()
['.', '/home/mpatel/foo', '/home/mpatel/bar']

Note: We now use the full path in the attached files dictionary.

Change History (11)

comment:1 Changed 14 years ago by mabshoff

  • Milestone set to Sage-2.10

comment:2 Changed 12 years ago by mpatel

  • Report Upstream set to N/A

#1484 is related.

comment:3 Changed 12 years ago by mpatel

So is #516.

comment:4 Changed 12 years ago by mpatel

That should be #5169.

Changed 12 years ago by mpatel

First take on load / attach path. sage repo.

comment:5 Changed 12 years ago by mpatel

  • Authors set to Mitesh Patel
  • Description modified (diff)
  • Priority changed from minor to major
  • Status changed from new to needs_review
  • Summary changed from user-specified sage load path to User-specified path for load and attach

Feel free to improve the patch!

comment:6 Changed 12 years ago by mpatel

  • Description modified (diff)

comment:7 Changed 12 years ago by mpatel

  • Status changed from needs_review to needs_work

We should skip the search, if the given filename is an absolute path.

comment:8 Changed 12 years ago by mpatel

Should we add an option (recurse=False?) that makes load and attach search the entire directory tree under each search path?

Changed 12 years ago by mpatel

More examples. Handle absolute paths. Replaces previous.

comment:9 Changed 12 years ago by mpatel

  • Description modified (diff)
  • Status changed from needs_work to needs_review

With V2, we skip the search if given an absolute path. I've also added some examples.

Note: See TracTickets for help on using tickets.