Show More
@@ -749,6 +749,8 class FileFindHandler(web.StaticFileHandler): | |||
|
749 | 749 | _static_paths = {} |
|
750 | 750 | |
|
751 | 751 | def initialize(self, path, default_filename=None): |
|
752 | if isinstance(path, basestring): | |
|
753 | path = [path] | |
|
752 | 754 | self.roots = tuple( |
|
753 | 755 | os.path.abspath(os.path.expanduser(p)) + os.path.sep for p in path |
|
754 | 756 | ) |
@@ -849,14 +851,16 class FileFindHandler(web.StaticFileHandler): | |||
|
849 | 851 | could be determined. |
|
850 | 852 | """ |
|
851 | 853 | # begin subclass override: |
|
852 | static_path = settings['static_path'] | |
|
854 | static_paths = settings['static_path'] | |
|
855 | if isinstance(static_paths, basestring): | |
|
856 | static_paths = [static_paths] | |
|
853 | 857 | roots = tuple( |
|
854 | os.path.abspath(os.path.expanduser(p)) + os.path.sep for p in static_path | |
|
858 | os.path.abspath(os.path.expanduser(p)) + os.path.sep for p in static_paths | |
|
855 | 859 | ) |
|
856 | 860 | |
|
857 | 861 | try: |
|
858 | 862 | abs_path = filefind(path, roots) |
|
859 |
except |
|
|
863 | except IOError: | |
|
860 | 864 | logging.error("Could not find static file %r", path) |
|
861 | 865 | return None |
|
862 | 866 |
@@ -155,7 +155,7 class NotebookWebApplication(web.Application): | |||
|
155 | 155 | |
|
156 | 156 | settings = dict( |
|
157 | 157 | template_path=os.path.join(os.path.dirname(__file__), "templates"), |
|
158 | static_path=os.path.join(os.path.dirname(__file__), "static"), | |
|
158 | static_path=ipython_app.static_file_path, | |
|
159 | 159 | static_handler_class = FileFindHandler, |
|
160 | 160 | cookie_secret=os.urandom(1024), |
|
161 | 161 | login_url="%s/login"%(base_project_url.rstrip('/')), |
General Comments 0
You need to be logged in to leave comments.
Login now