| OLD | NEW |
| 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 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 re | 5 import re |
| 6 import sys | 6 import sys |
| 7 | 7 |
| 8 from http_client_local import HttpClientLocal |
| 9 |
| 8 | 10 |
| 9 GIT_HASH_PATTERN = re.compile(r'^[0-9a-fA-F]{40}$') | 11 GIT_HASH_PATTERN = re.compile(r'^[0-9a-fA-F]{40}$') |
| 10 | 12 |
| 11 | 13 |
| 12 def GetOSName(platform_name=sys.platform): | 14 def GetOSName(platform_name=sys.platform): |
| 13 if platform_name == 'cygwin' or platform_name.startswith('win'): | 15 if platform_name == 'cygwin' or platform_name.startswith('win'): |
| 14 return 'win' | 16 return 'win' |
| 15 elif platform_name.startswith('linux'): | 17 elif platform_name.startswith('linux'): |
| 16 return 'unix' | 18 return 'unix' |
| 17 elif platform_name.startswith('darwin'): | 19 elif platform_name.startswith('darwin'): |
| 18 return 'mac' | 20 return 'mac' |
| 19 else: | 21 else: |
| 20 return platform_name | 22 return platform_name |
| 21 | 23 |
| 22 | 24 |
| 23 def IsGitHash(revision): | 25 def IsGitHash(revision): |
| 24 return GIT_HASH_PATTERN.match(str(revision)) | 26 return GIT_HASH_PATTERN.match(str(revision)) |
| 27 |
| 28 |
| 29 def GetHttpClient(): |
| 30 # TODO(stgao): return implementation for appengine when running on appengine. |
| 31 return HttpClientLocal |
| OLD | NEW |