Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notebook -- worksheet should call sys.path.append(DATA) when being initalized #3844

Closed
williamstein opened this issue Aug 14, 2008 · 12 comments

Comments

@williamstein
Copy link
Contributor

If we do the above then one can upload/attach a .py file and import it in the worksheet, which is really sweet.

Component: notebook

Author: William Stein

Reviewer: Mitesh Patel

Merged: sagenb-0.7

Issue created by migration from https://trac.sagemath.org/ticket/3844

@williamstein
Copy link
Contributor Author

comment:1

Attachment: sage-3844.patch.gz

@TimothyClemans
Copy link
Mannequin

TimothyClemans mannequin commented Aug 14, 2008

comment:2

When I attached hi.py, "import hi" didn't work. Also on http://sage.math.washington.edu:8999/home/admin/3/datafile?name=hi.py, there is no mention of this new functionality.

@williamstein
Copy link
Contributor Author

comment:3

I've attached a totally new patch that is 1-line, works, and does the right thing, and is imho quite nice.

I still don't have my computer setup for Selenium, but a test this works is to do this in the notebook:

DATA in sys.path
///
True

@williamstein
Copy link
Contributor Author

Attachment: sagenb_3844.patch.gz

apply only this -- ignore the old sage-3844.patch

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Dec 6, 2009

comment:4

I've come across the same problem as TimothyClemans -- importing it after attachment does not work. Also, it would probably be best to advertise the functionality on the data page, as TimothyClemans stated.

@TimDumol TimDumol mannequin added s: needs work and removed s: needs review labels Dec 6, 2009
@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 22, 2010

Attachment: trac_3844-DATA_in_sys_path.2.patch.gz

Updates tutorial.py. Replaces previous.

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 22, 2010

comment:5

This works for me -- After I upload a data file foo.py (or create a new one), I can import foo in a worksheet cell.

Positive review. V2 just adds the changes to tutorial.py from the original patch.

A load / attach analogue of sys.path might be warmly-received: #378, #1484, #5169.

By the way, FF 3.6 will permit drag-and-drop file uploads. See this blog post for a video and simple demo.

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 22, 2010

Author: William Stein

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 22, 2010

Reviewer: Mitesh Patel

@qed777 qed777 mannequin added s: needs review and removed s: needs work labels Jan 22, 2010
@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 25, 2010

Attachment: trac_3844-DATA_in_sys_path.3.patch.gz

Rebased for SageNB 0.6 + queue in comment. Replaces previous.

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 25, 2010

Merged: sagenb-0.7

@qed777 qed777 mannequin removed the s: positive review label Jan 25, 2010
@qed777 qed777 mannequin closed this as completed Jan 25, 2010
@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 25, 2010

comment:8

V3 is rebased for this queue:

sagenb-0.6
trac_7249-jinja2_v9.5.patch
trac_7962-link-worksheets-zip-file.patch
trac_7969-escaped-backslash.patch
trac_4217-html-system-formatting.3.patch
trac_3083-print-documentation.5.patch
trac_6182-double-quotes-ws.2.patch
trac_5263-publish-url.patch
trac_7631-republish-name.patch
trac_6353-cookies-diff-ports.patch
trac_7207-sagenb-future-import.3.patch
trac_8000-utf-8-coding-directive.2.patch
trac_4450-cursor-wrap-last-cell.patch
trac_7848-misleading_HTML_cells.patch
trac_7963-download-multiple-worksheets.patch
trac_7752-delete-worksheet-quit.patch
trac_7996-invisible_text.patch
trac_6475-error-delete-data-file.patch
trac_5675-address-launch.patch
trac_7435-dir-var.patch
trac_3844-DATA_in_sys_path.2.patch

Patch versions may be off by one.

@qed777 qed777 mannequin mentioned this issue Feb 10, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants