Show More
@@ -55,7 +55,7 b' class KernelHandler(IPythonHandler):' | |||||
55 | @web.authenticated |
|
55 | @web.authenticated | |
56 | def get(self, kernel_id): |
|
56 | def get(self, kernel_id): | |
57 | km = self.kernel_manager |
|
57 | km = self.kernel_manager | |
58 | model = km.kernel_model(kernel_id,self.ws_url) |
|
58 | model = km.kernel_model(kernel_id, self.ws_url) | |
59 | self.finish(jsonapi.dumps(model)) |
|
59 | self.finish(jsonapi.dumps(model)) | |
60 |
|
60 | |||
61 | @web.authenticated |
|
61 | @web.authenticated | |
@@ -76,7 +76,7 b' class KernelActionHandler(IPythonHandler):' | |||||
76 | self.set_status(204) |
|
76 | self.set_status(204) | |
77 | if action == 'restart': |
|
77 | if action == 'restart': | |
78 | km.restart_kernel(kernel_id) |
|
78 | km.restart_kernel(kernel_id) | |
79 | model = km.kernel_model(kernel_id,self.ws_url) |
|
79 | model = km.kernel_model(kernel_id, self.ws_url) | |
80 | self.set_header('Location', '{0}api/kernels/{1}'.format(self.base_kernel_url, kernel_id)) |
|
80 | self.set_header('Location', '{0}api/kernels/{1}'.format(self.base_kernel_url, kernel_id)) | |
81 | self.write(jsonapi.dumps(model)) |
|
81 | self.write(jsonapi.dumps(model)) | |
82 | self.finish() |
|
82 | self.finish() |
@@ -31,8 +31,7 b' from ...base.handlers import IPythonHandler, authenticate_unless_readonly' | |||||
31 |
|
31 | |||
32 |
|
32 | |||
33 | class SessionRootHandler(IPythonHandler): |
|
33 | class SessionRootHandler(IPythonHandler): | |
34 |
|
34 | |||
35 |
|
||||
36 | @authenticate_unless_readonly |
|
35 | @authenticate_unless_readonly | |
37 | def get(self): |
|
36 | def get(self): | |
38 | sm = self.session_manager |
|
37 | sm = self.session_manager | |
@@ -40,8 +39,7 b' class SessionRootHandler(IPythonHandler):' | |||||
40 | km = self.kernel_manager |
|
39 | km = self.kernel_manager | |
41 | sessions = sm.list_sessions() |
|
40 | sessions = sm.list_sessions() | |
42 | self.finish(jsonapi.dumps(sessions)) |
|
41 | self.finish(jsonapi.dumps(sessions)) | |
43 |
|
42 | |||
44 |
|
||||
45 | @web.authenticated |
|
43 | @web.authenticated | |
46 | def post(self): |
|
44 | def post(self): | |
47 | sm = self.session_manager |
|
45 | sm = self.session_manager | |
@@ -55,18 +53,17 b' class SessionRootHandler(IPythonHandler):' | |||||
55 | kernel = km.kernel_model(kernel_id, self.ws_url) |
|
53 | kernel = km.kernel_model(kernel_id, self.ws_url) | |
56 | model = sm.session_model(session_id, notebook_name, path, kernel) |
|
54 | model = sm.session_model(session_id, notebook_name, path, kernel) | |
57 | self.finish(jsonapi.dumps(model)) |
|
55 | self.finish(jsonapi.dumps(model)) | |
58 |
|
56 | |||
59 |
|
||||
60 | class SessionHandler(IPythonHandler): |
|
57 | class SessionHandler(IPythonHandler): | |
61 |
|
58 | |||
62 | SUPPORTED_METHODS = ('GET', 'PATCH', 'DELETE') |
|
59 | SUPPORTED_METHODS = ('GET', 'PATCH', 'DELETE') | |
63 |
|
60 | |||
64 | @authenticate_unless_readonly |
|
61 | @authenticate_unless_readonly | |
65 | def get(self, session_id): |
|
62 | def get(self, session_id): | |
66 | sm = self.session_manager |
|
63 | sm = self.session_manager | |
67 | model = sm.get_session_from_id(session_id) |
|
64 | model = sm.get_session_from_id(session_id) | |
68 | self.finish(jsonapi.dumps(model)) |
|
65 | self.finish(jsonapi.dumps(model)) | |
69 |
|
66 | |||
70 | @web.authenticated |
|
67 | @web.authenticated | |
71 | def patch(self, session_id): |
|
68 | def patch(self, session_id): | |
72 | sm = self.session_manager |
|
69 | sm = self.session_manager | |
@@ -79,7 +76,7 b' class SessionHandler(IPythonHandler):' | |||||
79 | sm.delete_mapping_for_session(session_id) |
|
76 | sm.delete_mapping_for_session(session_id) | |
80 | model = sm.session_model(session_id, notebook_name, path, kernel) |
|
77 | model = sm.session_model(session_id, notebook_name, path, kernel) | |
81 | self.finish(jsonapi.dumps(model)) |
|
78 | self.finish(jsonapi.dumps(model)) | |
82 |
|
79 | |||
83 | @web.authenticated |
|
80 | @web.authenticated | |
84 | def delete(self, session_id): |
|
81 | def delete(self, session_id): | |
85 | sm = self.session_manager |
|
82 | sm = self.session_manager | |
@@ -90,7 +87,7 b' class SessionHandler(IPythonHandler):' | |||||
90 | sm.delete_mapping_for_session(session_id) |
|
87 | sm.delete_mapping_for_session(session_id) | |
91 | self.set_status(204) |
|
88 | self.set_status(204) | |
92 | self.finish() |
|
89 | self.finish() | |
93 |
|
90 | |||
94 |
|
91 | |||
95 | #----------------------------------------------------------------------------- |
|
92 | #----------------------------------------------------------------------------- | |
96 | # URL to handler mappings |
|
93 | # URL to handler mappings |
@@ -32,7 +32,6 b' var IPython = (function (IPython) {' | |||||
32 |
|
32 | |||
33 | Session.prototype.notebook_rename = function (notebook_path) { |
|
33 | Session.prototype.notebook_rename = function (notebook_path) { | |
34 | this.notebook_path = notebook_path; |
|
34 | this.notebook_path = notebook_path; | |
35 | console.log("TEST"); |
|
|||
36 | var settings = { |
|
35 | var settings = { | |
37 | processData : false, |
|
36 | processData : false, | |
38 | cache : false, |
|
37 | cache : false, |
General Comments 0
You need to be logged in to leave comments.
Login now