-
Notifications
You must be signed in to change notification settings - Fork 317
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
Command install activate nbgrader extension. #168
Conversation
Awesome! Though maybe it would be more consistent for this to go in |
I was feeling that this was more a once in a blue moon thing, that you probably don't want to run everyday, and that only admins run, so pretty hidden. Up to you. |
|
I think I'll give up on installing the nbextension in the temporary folder created in test_nbextension... |
I think that's fine. Probably the test doesn't need to actually create a temporary directory -- I'm not entirely sure why I had it do that, so I think it would be fine if you just removed that functionality if you wanted to. |
@@ -1,7 +1,10 @@ | |||
import subprocess as sp | |||
import tempfile | |||
import os | |||
import os.path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this import is redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, sys also I guess. I need to clean a bit...
|
o_O that's a bit scary how things wrk or not... if I do the following with data_files:
And move things around at install time, it should work on user machine. Though for development, If you So you cannot run things fro inside dev dir and/or you have to special case in code ... 3rd possibility, is I do smth really wrong. I think I'll revert to move the nbextension data files in package tomorrow. |
Ok, I think this is working the way it's supposed to -- I guess the only other thing would be to implement the deactivation part? I can do that in a bit, too. |
Ok @Carreau you should take a look over this -- is there anything else you wanted to do with it? If not, then let me know, and I'll merge it! |
Ahhhhh the comma after install.... why did I missed it ! Will have a look. |
if 'nbgrader/create_assignment' not in config['load_extensions']: | ||
return | ||
|
||
config['load_extensions']['nbgrader/create_assignment'] = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will deactivate the ext. Actually the JS config use a dict as a set, but set do not exist in json, the value dont' have effet yet. You we might have to delete the key.
Let me check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, ok, good catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's the case, then probably the tests should be updated too to make sure the key doesn't exist rather than checking for False
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
Le 25 mars 2015 à 15:03, Jessica B. Hamrick notifications@github.com a écrit :
In nbgrader/install.py:
- json_dir = os.path.join(pdir, 'nbconfig')
- json_file = os.path.expanduser(os.path.join(json_dir, 'notebook.json'))
- try:
with io.open(json_file, 'r') as f:
config = json.loads(f.read())
- except IOError:
# file doesn't exist yet. IPython might have never been launched.
return
- if 'load_extensions' not in config:
return
- if 'nbgrader/create_assignment' not in config['load_extensions']:
return
- config['load_extensions']['nbgrader/create_assignment'] = False
If that's the case, then probably the tests should be updated too to make sure the key doesn't exist rather than checking for False.—
Reply to this email directly or view it on GitHub.
Key should be removed and not set to false to deactivate
Yeahhhh works ! @jhamrick I'll let you push Little Greeny |
Woohoo! 🎉 🍰 Thanks @Carreau ! |
[Work in progress] Command install activate nbgrader extension.
Hey ! Go take care of your relatives ! |
Doing that now :) |
Rip off from jupyter-drive installation for now.
Need some modifications.