OLD | NEW |
(Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import re |
| 6 import sys |
| 7 |
| 8 |
| 9 GIT_HASH_PATTERN = re.compile(r'^[0-9a-fA-F]{40}$') |
| 10 |
| 11 |
| 12 def GetOSName(platform_name=sys.platform): |
| 13 if platform_name == 'cygwin' or platform_name.startswith('win'): |
| 14 return 'win' |
| 15 elif platform_name.startswith('linux'): |
| 16 return 'unix' |
| 17 elif platform_name.startswith('darwin'): |
| 18 return 'mac' |
| 19 else: |
| 20 return platform_name |
| 21 |
| 22 |
| 23 def IsGitHash(revision): |
| 24 return GIT_HASH_PATTERN.match(str(revision)) |
OLD | NEW |