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 from data_source import DataSource | 5 from data_source import DataSource |
6 from future import Future | 6 from future import Future |
7 from operator import itemgetter | 7 from operator import itemgetter |
8 from platform_util import GetPlatforms | 8 from platform_util import GetPlatforms |
9 | 9 |
10 from docs_server_utils import MarkFirstAndLast, MarkLast | 10 from docs_server_utils import MarkFirstAndLast, MarkLast |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 return data | 112 return data |
113 def return_or_generate(data): | 113 def return_or_generate(data): |
114 if data is None: | 114 if data is None: |
115 return self._GenerateAPIDict().Then(persist_and_return) | 115 return self._GenerateAPIDict().Then(persist_and_return) |
116 return data | 116 return data |
117 return self._object_store.Get('api_data').Then(return_or_generate) | 117 return self._object_store.Get('api_data').Then(return_or_generate) |
118 | 118 |
119 def get(self, key): | 119 def get(self, key): |
120 return self._GetCachedAPIData().Get().get(key) | 120 return self._GetCachedAPIData().Get().get(key) |
121 | 121 |
122 def Refresh(self, path): | 122 def Refresh(self): |
123 return self._GetCachedAPIData() | 123 return self._GetCachedAPIData() |
OLD | NEW |