Show More
@@ -0,0 +1,43 b'' | |||
|
1 | """A notebook manager for when the logic is done client side (in JavaScript).""" | |
|
2 | ||
|
3 | #----------------------------------------------------------------------------- | |
|
4 | # Copyright (C) 2011 The IPython Development Team | |
|
5 | # | |
|
6 | # Distributed under the terms of the BSD License. The full license is in | |
|
7 | # the file COPYING, distributed as part of this software. | |
|
8 | #----------------------------------------------------------------------------- | |
|
9 | ||
|
10 | #----------------------------------------------------------------------------- | |
|
11 | # Imports | |
|
12 | #----------------------------------------------------------------------------- | |
|
13 | ||
|
14 | from .nbmanager import NotebookManager | |
|
15 | ||
|
16 | from fnmatch import fnmatch | |
|
17 | import itertools | |
|
18 | import os | |
|
19 | ||
|
20 | from IPython.config.configurable import LoggingConfigurable | |
|
21 | from IPython.nbformat import current, sign | |
|
22 | from IPython.utils.traitlets import Instance, Unicode, List | |
|
23 | ||
|
24 | #----------------------------------------------------------------------------- | |
|
25 | # Classes | |
|
26 | #----------------------------------------------------------------------------- | |
|
27 | ||
|
28 | class ClientSideNotebookManager(NotebookManager): | |
|
29 | # The notebook directory is meaningless since we are not using | |
|
30 | # the local filesystem. | |
|
31 | notebook_dir = '' | |
|
32 | ||
|
33 | def path_exists(self, path): | |
|
34 | # Always return true, because this check is now done client side. | |
|
35 | return True | |
|
36 | ||
|
37 | def is_hidden(self, path): | |
|
38 | # Always return false, because this check is now done client side. | |
|
39 | return False | |
|
40 | ||
|
41 | def notebook_exists(self, name, path=''): | |
|
42 | # Always return true, because this check is now done client side. | |
|
43 | return True |
@@ -136,6 +136,13 b' class IPythonHandler(AuthenticatedHandler):' | |||
|
136 | 136 | @property |
|
137 | 137 | def ws_url(self): |
|
138 | 138 | return self.settings.get('websocket_url', '') |
|
139 | ||
|
140 | @property | |
|
141 | def contentmanager_js_source(self): | |
|
142 | self.log.debug("Using contentmanager: %s", self.settings.get('contentmanager_js_source', | |
|
143 | 'base/js/contentmanager')) | |
|
144 | return self.settings.get('contentmanager_js_source', | |
|
145 | 'base/js/contentmanager') | |
|
139 | 146 | |
|
140 | 147 | #--------------------------------------------------------------- |
|
141 | 148 | # Manager objects |
@@ -224,7 +231,8 b' class IPythonHandler(AuthenticatedHandler):' | |||
|
224 | 231 | logged_in=self.logged_in, |
|
225 | 232 | login_available=self.login_available, |
|
226 | 233 | static_url=self.static_url, |
|
227 | sys_info=sys_info | |
|
234 | sys_info=sys_info, | |
|
235 | contentmanager_js_source=self.contentmanager_js_source, | |
|
228 | 236 | ) |
|
229 | 237 | |
|
230 | 238 | def get_json_body(self): |
@@ -5,7 +5,7 b' require([' | |||
|
5 | 5 | 'base/js/namespace', |
|
6 | 6 | 'jquery', |
|
7 | 7 | 'notebook/js/notebook', |
|
8 |
' |
|
|
8 | 'contentmanager', | |
|
9 | 9 | 'base/js/utils', |
|
10 | 10 | 'base/js/page', |
|
11 | 11 | 'notebook/js/layoutmanager', |
General Comments 0
You need to be logged in to leave comments.
Login now