##// END OF EJS Templates
/texteditor/ in URLs -> /edit/
Thomas Kluyver -
Show More
@@ -1,29 +1,29 b''
1 1 #encoding: utf-8
2 2 """Tornado handlers for the terminal emulator."""
3 3
4 4 # Copyright (c) IPython Development Team.
5 5 # Distributed under the terms of the Modified BSD License.
6 6
7 7 from tornado import web
8 8 from ..base.handlers import IPythonHandler, path_regex
9 9 from ..utils import url_escape
10 10
11 11 class EditorHandler(IPythonHandler):
12 12 """Render the text editor interface."""
13 13 @web.authenticated
14 14 def get(self, path):
15 15 path = path.strip('/')
16 16 if not self.contents_manager.file_exists(path):
17 17 raise web.HTTPError(404, u'File does not exist: %s' % path)
18 18
19 19 basename = path.rsplit('/', 1)[-1]
20 20 self.write(self.render_template('texteditor.html',
21 21 file_path=url_escape(path),
22 22 basename=basename,
23 23 page_title=basename + " (editing)",
24 24 )
25 25 )
26 26
27 27 default_handlers = [
28 (r"/texteditor%s" % path_regex, EditorHandler),
28 (r"/edit%s" % path_regex, EditorHandler),
29 29 ] No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now