| OLD | NEW |
| 1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 | 28 |
| 29 import os | 29 import os |
| 30 from os.path import exists | 30 from os.path import exists |
| 31 from os.path import isdir | 31 from os.path import isdir |
| 32 from os.path import join | 32 from os.path import join |
| 33 import platform | 33 import platform |
| 34 import re | 34 import re |
| 35 import urllib2 |
| 35 | 36 |
| 36 | 37 |
| 37 def GetSuitePaths(test_root): | 38 def GetSuitePaths(test_root): |
| 38 def IsSuite(path): | 39 def IsSuite(path): |
| 39 return isdir(path) and exists(join(path, 'testcfg.py')) | 40 return isdir(path) and exists(join(path, 'testcfg.py')) |
| 40 return [ f for f in os.listdir(test_root) if IsSuite(join(test_root, f)) ] | 41 return [ f for f in os.listdir(test_root) if IsSuite(join(test_root, f)) ] |
| 41 | 42 |
| 42 | 43 |
| 43 # Reads a file into an array of strings | 44 # Reads a file into an array of strings |
| 44 def ReadLinesFrom(name): | 45 def ReadLinesFrom(name): |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 107 |
| 107 def GuessWordsize(): | 108 def GuessWordsize(): |
| 108 if '64' in platform.machine(): | 109 if '64' in platform.machine(): |
| 109 return '64' | 110 return '64' |
| 110 else: | 111 else: |
| 111 return '32' | 112 return '32' |
| 112 | 113 |
| 113 | 114 |
| 114 def IsWindows(): | 115 def IsWindows(): |
| 115 return GuessOS() == 'windows' | 116 return GuessOS() == 'windows' |
| 117 |
| 118 |
| 119 def URLRetrieve(source, destination): |
| 120 """urllib is broken for SSL connections via a proxy therefore we |
| 121 can't use urllib.urlretrieve().""" |
| 122 with open(destination, 'w') as f: |
| 123 f.write(urllib2.urlopen(source).read()) |
| OLD | NEW |