We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 39c9f02 commit ae3d7daCopy full SHA for ae3d7da
nengo_gui/server.py
@@ -54,6 +54,14 @@ def swi_static(self, *path):
54
data = pkgutil.get_data('nengo_gui', fn)
55
return (mimetype, data)
56
57
+ def swi_local(self, *path):
58
+ """Handles http://host:port/local/* by using local directory"""
59
+ fn = os.path.join('local', *path)
60
+ mimetype, encoding = mimetypes.guess_type(fn)
61
+ with open(fn, 'rb') as f:
62
+ data = f.read()
63
+ return (mimetype, data)
64
+
65
def swi_favicon_ico(self):
66
icon = pkgutil.get_data('nengo_gui', 'static/favicon.ico')
67
return ('image/ico', icon)
0 commit comments