def send_client_files(self):
"""
Sends the client our standard CSS and JS.
"""
# Render and send the client our terminal.css
terminal_css = resource_filename(
'applications', '/templates/terminal.css')
#terminal_css = os.path.join(getsettings('BASE_DIR'), 'static', 'templates', 'terminal.css')
self.render_and_send_css(terminal_css, element_id="terminal.css")
# Send the client our JavaScript files
js_files = resource_listdir('applications', '/static/')
#js_files = os.listdir(os.path.join(getsettings('BASE_DIR'), 'static', 'terminal'))
js_files.sort()
for fname in js_files:
if fname.endswith('.js'):
js_file_path = resource_filename(
'applications', '/static/%s' % fname)
#js_file_path = os.path.join(os.path.join(getsettings('BASE_DIR'), 'static', 'terminal'),fname)
if fname == 'terminal.js':
self.ws.send_js(js_file_path, requires=["terminal.css"])
elif fname == 'terminal_input.js':
self.ws.send_js(js_file_path, requires="terminal.js")
else:
self.ws.send_js(js_file_path, requires='terminal_input.js')
self.ws.send_plugin_static_files(
'go_terminal_plugins',
requires=["terminal_input.js"])
# Send the client the 256-color style information and our printing CSS
self.send_256_colors()
self.send_print_stylesheet()
评论列表
文章目录