Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Make init.sage work #267

Merged
merged 1 commit into from
Dec 18, 2014
Merged

Make init.sage work #267

merged 1 commit into from
Dec 18, 2014

Conversation

kcrisman
Copy link
Member

@kcrisman kcrisman commented Dec 3, 2014

Ideally, this would later be changed to use attach again.

Ideally, this would later be changed to use `attach` again.
@kcrisman
Copy link
Member Author

kcrisman commented Dec 3, 2014

This would fix #251. Needs review.

@kcrisman
Copy link
Member Author

kcrisman commented Dec 3, 2014

An interesting point is that there is a separate place with an init.sage file expected in DOT_SAGENB:

def load_any_changed_attached_files(self, s):
r"""
Modify ``s`` by prepending any necessary load commands
corresponding to attached files that have changed.
"""
A = self.attached_files()
init_sage = DOT_SAGENB + 'init.sage'
if not init_sage in A.keys() and os.path.exists(init_sage):
A[init_sage] = 0

Maybe people won't want init.sage in the notebook... well, easy enough to just move it, I suppose.

@migeruhito
Copy link
Contributor

I tested your patch, and init.sage is correctly loaded.

Ideally, this would later be changed to use attach again.

I'm not sure. This is the documented behavior, but it is the expected behavior for the average user? In almost all the software we run, a init process means an immutable startup procedure.

An interesting point is that there is a separate place with an init.sage file expected in DOT_SAGENB:

At a first glance, it seems to me an inconsistent coding practice, but I haven't yet a deep and global understanding of the notebook a its code. This code could be there for a reason (an undocumented reason, as far as I know).

@kcrisman
Copy link
Member Author

Thanks!

kcrisman added a commit that referenced this pull request Dec 18, 2014
@kcrisman kcrisman merged commit d4a75fc into sagemath:master Dec 18, 2014
@kcrisman kcrisman deleted the initfix branch December 18, 2014 17:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants