| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 import logging | 5 import logging |
| 6 import traceback | 6 import traceback |
| 7 | 7 |
| 8 from data_source import DataSource | 8 from data_source import DataSource |
| 9 from extensions_paths import EXAMPLES | 9 from extensions_paths import EXAMPLES |
| 10 from future import All, Future | 10 from future import All, Future |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 def _GetImpl(self, platform): | 68 def _GetImpl(self, platform): |
| 69 cache = self._platform_bundle.GetSamplesModel(platform).GetCache() | 69 cache = self._platform_bundle.GetSamplesModel(platform).GetCache() |
| 70 create_view = lambda samp_list: CreateSamplesView(samp_list, self._request) | 70 create_view = lambda samp_list: CreateSamplesView(samp_list, self._request) |
| 71 return cache.GetFromFileListing('' if platform == 'apps' | 71 return cache.GetFromFileListing('' if platform == 'apps' |
| 72 else EXAMPLES).Then(create_view) | 72 else EXAMPLES).Then(create_view) |
| 73 | 73 |
| 74 def get(self, platform): | 74 def get(self, platform): |
| 75 return self._GetImpl(platform).Get() | 75 return self._GetImpl(platform).Get() |
| 76 | 76 |
| 77 def Cron(self): | 77 def GetRefreshPaths(self): |
| 78 return All([self._GetImpl(platform) for platform in GetPlatforms()]) | 78 return [platform for platform in GetPlatforms()] |
| 79 |
| 80 def Refresh(self, path): |
| 81 return self._GetImpl(path) |
| OLD | NEW |