Commit Graph

3634 Commits

Author SHA1 Message Date
Mathieu
0eb340b3e2 create new notebook with same kernel 2015-01-09 04:26:16 +01:00
Jason Grout
5dea7ad30b Split apart the body attributes and classes in the notebook templates 2015-01-08 23:41:50 +00:00
Scott Sanderson
64e5c49608 DEV: Break get_checkpoint into separate methods.
One for notebooks and one for checkpoints.
2015-01-08 17:00:53 -05:00
Scott Sanderson
2569c3069d STY: s/CheckpointManager/Checkpoints
It's easy to confuse CheckpointManager and ContentsManager.
2015-01-08 14:41:46 -05:00
Scott Sanderson
021e2da495 DEV: Separate FileCheckpointManager and GenericFileCheckpointManager.
- Adds a `GenericCheckpointMixin` as a helper for implementing the two
  boundary-traversing Checkpoint API methods, `create_checkpoint` and
  `restore_checkpoint`.

- `GenericFileCheckpointManager` is implemented as a subclass of
  `FileCheckpointManager` using `GenericCheckpointMixin`.  Note that
  this is the safe subtyping relationship because of method
  signature *contra*variance: `FileCheckpointManager` accepts
  `FileContentsManager` in its method signatures type, whereas
  `GenericFileCheckpointManager` accepts any `ContentsManager`.

- Moved Checkpoint-related classes to their own files.
2015-01-08 14:07:17 -05:00
Jason Grout
0bdfdc03ca python3 does not like adding lists and map results
Thanks to @takluyver for pointing this out
2015-01-08 18:43:38 +00:00
Jason Grout
18cfbc0d11 Generate fontweight enum values without an extraneous variable from a comprehension
In python 2, the comprehension will create a new class attribute, i.  Using a map will not create the extra local variable.
2015-01-08 18:24:38 +00:00
Scott Sanderson
12fe97e2af DEV: Allow CheckpointManagers to optimize for shared backends.
On `create_checkpoint` and `restore_checkpoint`, pass a path and a
`ContentsManager` to `CheckpointManager` instead of an already-loaded
model.

The `CheckpointManager` base class provides a correct implementation of
these methods that's generic across any ContentsManager, but subclasses
are free to specialize when the storage backend of `ContentsManager` is
shared.
2015-01-07 21:23:55 -05:00
Scott Sanderson
55d4e20aaf DEV: Remove ContentsManager.walk. 2015-01-07 16:13:42 -05:00
Scott Sanderson
2b73f1e620 DEV: Implement os.walk analog for ContentsManagers. 2015-01-06 23:59:31 -05:00
Scott Sanderson
1e2e86dcca MAINT: Return dicts from CheckpointManager.get_checkpoint.
The output is going to get converted to a dict anyway, and this makes it
easier to pipe output from a CheckpointManager directly to a
ContentsManager.
2015-01-06 14:28:59 -05:00
Min RK
1cac03528b use single WebSocket connection for all channels
multiplex on a 'channel' key in message,
rather than separate websockets.

Unlike zmq, there aren't different message patterns that require the channels to be separate.

Reduces FD count by factor of 3 and connection complexity in js.
2015-01-06 11:15:15 -08:00
Matthias Bussonnier
2b7568c13f Merge pull request #7375 from minrk/empty-execute-result
ensure data, metadata are set in execute_results
2015-01-06 12:52:02 +01:00
Matthias Bussonnier
87b7f7599c Merge pull request #7278 from minrk/nb-file-ext
don't enforce .ipynb extension in URLs
2015-01-06 12:42:54 +01:00
Matthias Bussonnier
f51872c4c2 Merge pull request #7346 from jdfreder/terminal-page
Use page backdrop color in terminal page
2015-01-06 12:27:46 +01:00
Min RK
b891a50896 Merge pull request #7379 from juhasch/js-tests
Js tests
2015-01-05 11:23:11 -08:00
Jonathan Frederic
f79b914e5c invoke css 2015-01-05 11:12:43 -08:00
Jonathan Frederic
f0da3c863c Make headerbar -1 margin global 2015-01-05 11:12:23 -08:00
Juergen Hasch
5e641876da fix insert_cell_at_index call in tests 2015-01-05 11:21:30 +01:00
Juergen Hasch
2fbf8835e1 fix insert_cell_at_index call in tests 2015-01-05 11:18:41 +01:00
Matthias Bussonnier
cc0efade88 Merge pull request #7376 from minrk/modal-z-index
recompile css
2015-01-05 07:01:17 +01:00
Min RK
c9c6b8d8a2 recompile css
it had fallen out of sync with updated bootstrap
2015-01-04 12:13:50 -08:00
Min RK
d2335ab000 handle missing data, metadata in validate_mimebundle 2015-01-04 12:06:23 -08:00
Min RK
9e3e5cfca7 store widget state in single key
rather than in a dict, which doesn't work without reserializing *all* stored widget states (of all notebooks), since localStorage only supports storing strings.
2015-01-04 11:56:16 -08:00
Min RK
ffaa09492a Merge pull request #7315 from Carreau/codacy2
miscellaneous cleanup
2015-01-03 12:22:45 -08:00
Min RK
796b480922 Merge pull request #7359 from jdfreder/tab-fix
Accordion and Tab widget, fixes for ancient bugs.
2015-01-02 20:36:00 -08:00
Min RK
45d8afa32d Merge pull request #7361 from quantopian/fix-extension-rename
BUG: Fix broken codemirror highlighting on file rename.
2015-01-02 20:28:50 -08:00
dongweiming
491046425d fix widget description can not display when use --no-mathjax 2015-01-02 21:11:50 +08:00
Jonathan Frederic
ad546d89f9 Merge pull request #7341 from jdfreder/remove-popup
Remove the popup widget
2015-01-01 20:30:17 -08:00
Scott Sanderson
cbb196bb94 DOC: Add comment. 2015-01-01 22:04:16 -05:00
Scott Sanderson
782ac56768 BUG: Fix broken codemirror highlighting on file rename.
When a users uses the rename dialog in the text editor, we call
_set_mode_for_model on the returned model.  The expected model to be
returned from rename has no value for mimetype, which causes us to pass
`undefined` to `CodeMirror.findModeByMIME`, which returns `undefined`
back.  We then try access an attribute of the (undefined) return value,
causing an error.

This now properly checks whether the `mimetype` attribute is set on the
input model.
2015-01-01 21:33:17 -05:00
Scott Sanderson
7030a8717a DEV: Add full support for non-notebook checkpoints. 2015-01-01 20:52:00 -05:00
Scott Sanderson
23837e9ad4 DEV: Remove unnecessary notary calls. 2015-01-01 20:49:35 -05:00
Matthias Bussonnier
a82db63916 Merge pull request #7330 from minrk/display-name
use 'Python X' for IPython kernel display name
2015-01-01 19:34:36 +01:00
Matthias Bussonnier
214195ce5f Merge pull request #7327 from minrk/kernel-links
move Python-specific help links to kernel_info
2015-01-01 11:04:50 +01:00
Matthias Bussonnier
c0efca80ea Merge pull request #7331 from minrk/fix-scroll
fix scroll actions
2015-01-01 11:03:09 +01:00
Matthias Bussonnier
ea5f2066af Merge pull request #7340 from minrk/kernel-js-event
load kernel js, css, logo on spec_changed event
2015-01-01 11:02:25 +01:00
Matthias Bussonnier
41f24bbe2c Merge pull request #7358 from jdfreder/persistence-page-specific
Associate widget state persistence with current URL.
2015-01-01 11:01:07 +01:00
Matthias Bussonnier
1e6f969c39 Merge pull request #7357 from jdfreder/error-overlay
When executing a cell, clear output and ignore queued animations.
2015-01-01 10:59:30 +01:00
Matthias Bussonnier
290dab0846 Merge pull request #7342 from jdfreder/wid-border-radius
Adjust widget border radius to match new notebook style
2015-01-01 10:58:17 +01:00
Jonathan Frederic
47c12abbf3 Fix a bunch of bugs with the accordion and tab widgets 2014-12-31 13:04:47 -08:00
Jonathan Frederic
8ad7cb3f4b Associate persistence with URL 2014-12-31 12:42:17 -08:00
Jonathan Frederic
b37c5d21d0 When executing a cell, clear output and ignore queued animations. 2014-12-31 11:32:27 -08:00
Jonathan Frederic
edf737d111 invoke css 2014-12-31 08:44:52 -08:00
Jonathan Frederic
8ff7381ef3 Remove superfluous body tag from terminal less 2014-12-31 08:43:58 -08:00
Jonathan Frederic
8e54937893 Fixed pre-display "pixel-like" widget attribute parsing 2014-12-30 14:15:45 -08:00
Min RK
67abf3ddab update kernelspec test
to expect Python display name
2014-12-30 13:23:05 -08:00
Jonathan Frederic
e2bb4ca875 invoke css 2014-12-29 12:37:19 -08:00
Jonathan Frederic
7b602f07cc Use page backdrop with the terminal 2014-12-29 12:37:02 -08:00
Jonathan Frederic
d0ab0ad4aa Display kernels in alphabetical order. 2014-12-29 12:16:18 -08:00
Jonathan Frederic
992976844d Merge pull request #7302 from Carreau/1pix
a few 1 pixel fixes.
2014-12-29 11:58:53 -08:00
Jonathan Frederic
8d3f5b2865 invoke css 2014-12-29 09:14:39 -08:00
Jonathan Frederic
1a1c93b9d2 Remove modal less 2014-12-29 09:14:28 -08:00
Jonathan Frederic
2f982bd1e0 invoke css 2014-12-29 09:02:08 -08:00
Jonathan Frederic
239b4ab3dc Fix widget radii 2014-12-29 09:01:37 -08:00
Jonathan Frederic
3f2dc88154 Remove the popup widget 2014-12-29 08:08:20 -08:00
Scott Sanderson
631a68d83e TEST: Test separate roots for Contents and Checkpoints. 2014-12-29 07:01:39 -05:00
Scott Sanderson
f71f216880 DEV: More checkpoint API refactoring.
Changed the public checkpoint API to:
- `create_checkpoint(self, nb, path)`
- `get_checkpoint_content(self, checkpoint_id, path)`
- `rename_checkpoint(self, checkpoint_id, old_path, new_path)`
- `delete_checkpoint(self, checkpoint_id, path)`
- `list_checkpoints(self, path)`

All paths in the above are API-style paths, and the `nb` argument to
`create_checkpoint` is a dictionary suitable for passing to
`nbformat.write`.

The new `get_checkpoint_content` method returns an unvalidated notebook
content dictionary.  It is used by `ContentManager.restore_checkpoint`
to load content to be written via `save`.
2014-12-29 07:00:30 -05:00
Min RK
2587cf710c load kernel js, css, logo on spec_changed event
Ensures kernel.js is always loaded.
It wasn't being loaded when creating a new notebook with a particular kernel because `change_kernel` wasn't being called. Only the `spec_changed` event is triggered by all the various ways a kernel can be loaded,
so load kernel stuff on that event.
2014-12-28 23:59:12 -08:00
Min RK
026ec844f9 update new notebook button with kernelspec changes
display_name is in the spec, not top-level.
2014-12-28 23:26:05 -08:00
Matthias Bussonnier
c1d9f4d436 Merge pull request #7283 from minrk/kernel-spec-model
add resource URLs to kernelspec model
2014-12-28 16:38:50 +01:00
Min RK
c6b610f04f make FilesRedirectHandler redirect logic accessible
from a static method

instead of calling FRH.get(self), which doesn't work on Python 2
due to unbound method class checking.
2014-12-27 15:11:42 -08:00
Min RK
86dca85890 handle deprecated files redirect on /notebooks 2014-12-27 14:23:49 -08:00
Matthias Bussonnier
4e2dfe2527 Some code cleanup in javascript and python
change patern that are prone to error, like function redifinition
and other.
2014-12-27 21:39:07 +01:00
Min RK
96a5661648 fix scroll actions
div#notebook no longer scrolls at all.
Instead, only the body scrolls.
This may be a problem, but at least scroll actions work now.
2014-12-27 01:51:23 -08:00
Min RK
83f51e877c move Python-specific help links to kernel_info
help_links in kernel_info were already in the msg spec,
but not implemented.

Python-specific docs are now linked to the Python version.
2014-12-27 01:11:10 -08:00
Min RK
cb0c95575e friendlier error messages when invoke/lessc are missing
and not needed.
2014-12-27 00:16:28 -08:00
Scott Sanderson
dc295f67bd MAINT: Add missing config=Trues. 2014-12-27 00:48:57 -05:00
Scott Sanderson
4da8a30f20 DEV: Refactor checkpoint logic from FileContentsManager.
- Add a `CheckpointManager` base class and infrastructure for creating a
  `checkpoint_manager` instance attribute on `ContentsManager`.

- Provide default implementations of `delete` and `rename` in the base
  `ContentsManager` class.  `ContentsManager` subclasses are now
  required to implement `delete_file` and `rename_file`.  These methods
  no longer need to manage checkpoints.

- Move checkpoint-related functionality from `FileContentsManager` to a
  dedicated `FileCheckpointManager` subclass.

- Move shared filesystem interaction logic into `FileManagerMixin`
  used by both `FileContentsManager` and `FileCheckpointManager`.

- Minor tweaks to ContentsManager tests to get methods from the right
  object.

The purpose of this change is to provide an API for users to replace
just the checkpoint logic associated with a particular
`ContentsManager`.  In particular, this change makes it possible to
easily support remote storage of checkpoints while otherwise retaining
normal filesystem interactions.
2014-12-27 00:23:14 -05:00
Brian E. Granger
df578b8835 Merge pull request #7307 from Carreau/remove-white
remove whitespace below menubar when toolbar hidden.
2014-12-26 17:06:13 -08:00
Brian E. Granger
87ab53bcfe Merge pull request #7311 from Carreau/reform-css-2
Reform css 2
2014-12-26 16:59:45 -08:00
Brian E. Granger
dd2c077939 Merge pull request #7318 from Carreau/dialog-border-radius
fix border radius on element.
2014-12-26 16:49:23 -08:00
Matthias Bussonnier
031e829daf stack vertically keyboard shortcut on narrow viewport. 2014-12-26 19:07:59 +01:00
Matthias Bussonnier
0165e97c7c unify submenu style with menu style
closes #7303.

Also change the arrow that indicate submenu for a fontawesoem icon,
instead of the ugly hack that show only the left border of a rectangle element
which with is twice the one of its border to get a triangle.
2014-12-26 18:03:40 +01:00
Matthias Bussonnier
39444a7190 fix border radius on element.
set a value to border-radius large, and actually make border radius
small smaller than border radius large.

Make dialog border radius coherent with the rest of the UI.
2014-12-26 17:56:19 +01:00
Min RK
52d37ca17a Merge pull request #7312 from quantopian/refactor-contents-update
MAINT: Move `update` from FileContentsManager to ContentsManager.
2014-12-25 12:55:14 -08:00
Min RK
729c233f7d Merge pull request #7308 from Carreau/reform-css
reformat css
2014-12-25 12:49:09 -08:00
Scott Sanderson
9aad3c631f MAINT: Move update from FileContentsManager to ContentsManager.
The implementation in FileContentsManager is written entirely in terms
of the required API, and is sensible for other ContentsManager
implementations.
2014-12-25 13:17:10 -05:00
Matthias Bussonnier
160690f50a reformat css
cause I want to inject some variable in it after (like border radius)
and a few other thigs.

This is just a reformating that does not change the generated css.
2014-12-25 11:42:36 +01:00
Min RK
d94479ad29 Merge pull request #7251 from Carreau/unregister-preset
add ability to unregister a preset
2014-12-24 13:21:55 -08:00
Matthias Bussonnier
54a3f47905 remove whitespace below menubar when toolbar hidden.
closes #7292
2014-12-24 18:54:20 +01:00
Min RK
47b41d980b Merge pull request #7287 from Carreau/mistake
binary or is rare in JS
2014-12-23 20:19:54 -08:00
Jonathan Frederic
09b289d932 Merge pull request #7274 from Carreau/global-command
make global css change on command/edit mode
2014-12-23 18:20:19 -08:00
Matthias Bussonnier
27f3c224c2 a few 1 pixel fixes.
this uses the same html/css structure acroos the tabs, and reduce the overlay
click zone that expended the size of the header to 25px instead of 24px
2014-12-23 23:20:03 +01:00
Matthias Bussonnier
b003b62de4 Actually test that the j-nth cell. 2014-12-23 22:29:51 +01:00
Brian E. Granger
7b21e13705 Merge pull request #7242 from jdfreder/terminal-fixes
Some UI design changes for the Notebook and associates
2014-12-23 13:20:20 -08:00
Jonathan Frederic
34c08c035f New file open editor 2014-12-23 12:31:54 -08:00
Jonathan Frederic
6e86c7645b Fix JS test new button selector 2014-12-23 12:15:06 -08:00
Jonathan Frederic
9e3b18605a Reverse order of file/folder and notebooks in new menu 2014-12-23 12:15:06 -08:00
Jonathan Frederic
e593e6a123 Dont prompt for name. 2014-12-23 12:15:06 -08:00
Jonathan Frederic
2c43bc60ae invoke css 2014-12-23 12:15:06 -08:00
Jonathan Frederic
e0adde46f3 New new button 2014-12-23 12:15:06 -08:00
Jonathan Frederic
849c96ae61 Merge pull request #7268 from Carreau/ungroup-button
ungroup button on dashboard
2014-12-23 11:24:30 -08:00
Jonathan Frederic
c6548ebe0e Merge pull request #7288 from Carreau/that/this
remove that.
2014-12-23 11:17:37 -08:00
Matthias Bussonnier
7a295d1924 Merge pull request #7273 from Carreau/content-no-namespace
Do not inject self in IPython namespace
2014-12-23 19:35:16 +01:00
Matthias Bussonnier
123c0f3b28 remove that. 2014-12-23 13:00:57 +01:00
Matthias Bussonnier
6b57f44bf6 ungroup button on dashboard
fix a few instanced of button toolbar that were not with the right class or not in btn groups.
2014-12-23 11:32:15 +01:00
Matthias Bussonnier
1dfdda6e97 binary or is rare in JS 2014-12-23 11:07:43 +01:00
Min RK
43da311f5e add Notebook.ensure_extension
allows override of file-extension logic in notebook extensions
2014-12-22 13:21:14 -08:00
Matthias Bussonnier
06d4d1505a Merge pull request #7266 from Carreau/shutdown-orange
make shutdown yellow/orange
2014-12-22 18:12:29 +01:00