##// END OF EJS Templates
Clean up sessions code from static analysis
Thomas Kluyver -
Show More
@@ -83,11 +83,9 b' class SessionHandler(IPythonHandler):'
83 def patch(self, session_id):
83 def patch(self, session_id):
84 # Currently, this handler is strictly for renaming notebooks
84 # Currently, this handler is strictly for renaming notebooks
85 sm = self.session_manager
85 sm = self.session_manager
86 nbm = self.notebook_manager
87 km = self.kernel_manager
88 model = self.get_json_body()
86 model = self.get_json_body()
89 if model is None:
87 if model is None:
90 raise HTTPError(400, "No JSON data provided")
88 raise web.HTTPError(400, "No JSON data provided")
91 changes = {}
89 changes = {}
92 if 'notebook' in model:
90 if 'notebook' in model:
93 notebook = model['notebook']
91 notebook = model['notebook']
@@ -104,7 +102,6 b' class SessionHandler(IPythonHandler):'
104 def delete(self, session_id):
102 def delete(self, session_id):
105 # Deletes the session with given session_id
103 # Deletes the session with given session_id
106 sm = self.session_manager
104 sm = self.session_manager
107 nbm = self.notebook_manager
108 km = self.kernel_manager
105 km = self.kernel_manager
109 session = sm.get_session(id=session_id)
106 session = sm.get_session(id=session_id)
110 sm.delete_session(session_id)
107 sm.delete_session(session_id)
@@ -16,15 +16,13 b' Authors:'
16 # Imports
16 # Imports
17 #-----------------------------------------------------------------------------
17 #-----------------------------------------------------------------------------
18
18
19 import os
20 import uuid
19 import uuid
21 import sqlite3
20 import sqlite3
22
21
23 from tornado import web
22 from tornado import web
24
23
25 from IPython.config.configurable import LoggingConfigurable
24 from IPython.config.configurable import LoggingConfigurable
26 from IPython.nbformat import current
25 from IPython.utils.traitlets import TraitError
27 from IPython.utils.traitlets import List, Dict, Unicode, TraitError
28
26
29 #-----------------------------------------------------------------------------
27 #-----------------------------------------------------------------------------
30 # Classes
28 # Classes
@@ -8,7 +8,6 b' import shutil'
8
8
9 pjoin = os.path.join
9 pjoin = os.path.join
10
10
11 from IPython.utils.jsonutil import date_default
12 from IPython.html.utils import url_path_join
11 from IPython.html.utils import url_path_join
13 from IPython.html.tests.launchnotebook import NotebookTestBase
12 from IPython.html.tests.launchnotebook import NotebookTestBase
14 from IPython.nbformat.current import new_notebook, write
13 from IPython.nbformat.current import new_notebook, write
General Comments 0
You need to be logged in to leave comments. Login now