OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from HTMLParser import HTMLParser | 5 from HTMLParser import HTMLParser |
6 import mimetypes | 6 import mimetypes |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 | 9 |
10 from compiled_file_system import SingleFile | 10 from compiled_file_system import SingleFile |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 # Check for a zip file first, if zip is enabled. | 78 # Check for a zip file first, if zip is enabled. |
79 if self._directory_zipper and ext == '.zip': | 79 if self._directory_zipper and ext == '.zip': |
80 zip_future = self._directory_zipper.Zip(base) | 80 zip_future = self._directory_zipper.Zip(base) |
81 return Future(delegate=Gettable( | 81 return Future(delegate=Gettable( |
82 lambda: ContentAndType(zip_future.Get(), 'application/zip'))) | 82 lambda: ContentAndType(zip_future.Get(), 'application/zip'))) |
83 | 83 |
84 return self._content_cache.GetFromFile(path, binary=True) | 84 return self._content_cache.GetFromFile(path, binary=True) |
85 | 85 |
86 def Cron(self): | 86 def Cron(self): |
87 # Running Refresh() on the file system is enough to pull GitHub content, | 87 # Running Refresh() on the file system is enough to pull GitHub content, |
88 # which is all we need for now. | 88 # which is all we need for now while the full render-every-page cron step |
89 self.file_system.Refresh().Get() | 89 # is in effect. |
| 90 # TODO(kalman): Walk over the whole filesystem and compile the content. |
| 91 return self.file_system.Refresh() |
OLD | NEW |