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 json | 5 import json |
6 import logging | 6 import logging |
7 from StringIO import StringIO | 7 from StringIO import StringIO |
8 import posixpath | 8 import posixpath |
9 | 9 |
10 from appengine_blobstore import AppEngineBlobstore, BLOBSTORE_GITHUB | 10 from appengine_blobstore import AppEngineBlobstore, BLOBSTORE_GITHUB |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 try: | 193 try: |
194 version = json.loads(result.content)['sha'] | 194 version = json.loads(result.content)['sha'] |
195 self._stat_object_store.Set(path, version) | 195 self._stat_object_store.Set(path, version) |
196 return StatInfo(version) | 196 return StatInfo(version) |
197 except StandardError as e: | 197 except StandardError as e: |
198 logging.warning( | 198 logging.warning( |
199 ('%s: got invalid or unexpected JSON from github. Response status ' + | 199 ('%s: got invalid or unexpected JSON from github. Response status ' + |
200 'was %s, content %s') % (e, result.status_code, result.content)) | 200 'was %s, content %s') % (e, result.status_code, result.content)) |
201 return self._DefaultStat(path) | 201 return self._DefaultStat(path) |
202 | 202 |
203 def GetIdentity(self): | 203 def GetStableIdentity(self): |
204 return '%s@%s' % (self.__class__.__name__, StringIdentity(self._url)) | 204 return '%s@%s' % (self.__class__.__name__, StringIdentity(self._url)) |
OLD | NEW |