|
Lines 37-43
from webkitcorepy import Version
a/Tools/Scripts/webkitpy/common/system/platforminfo.py_sec1
|
| 37 |
|
37 |
|
| 38 |
from webkitpy.common.memoized import memoized |
38 |
from webkitpy.common.memoized import memoized |
| 39 |
from webkitpy.common.version_name_map import PUBLIC_TABLE, INTERNAL_TABLE, VersionNameMap |
39 |
from webkitpy.common.version_name_map import PUBLIC_TABLE, INTERNAL_TABLE, VersionNameMap |
| 40 |
from webkitpy.common.system.executive import Executive, ScriptError |
40 |
from webkitpy.common.system.executive import ScriptError |
| 41 |
from webkitpy.port.config import apple_additions |
41 |
from webkitpy.port.config import apple_additions |
| 42 |
|
42 |
|
| 43 |
|
43 |
|
|
Lines 59-68
class PlatformInfo(object):
a/Tools/Scripts/webkitpy/common/system/platforminfo.py_sec2
|
| 59 |
newer than one known to the code. |
59 |
newer than one known to the code. |
| 60 |
""" |
60 |
""" |
| 61 |
|
61 |
|
| 62 |
def __init__(self, sys_module=None, platform_module=None, executive=None): |
62 |
def __init__(self, sys_module, platform_module, executive): |
| 63 |
sys_module = sys_module or sys |
63 |
self._executive = executive |
| 64 |
|
|
|
| 65 |
self._executive = executive or Executive() |
| 66 |
self._platform_module = platform_module |
64 |
self._platform_module = platform_module |
| 67 |
self.os_name = self._determine_os_name(sys_module.platform) |
65 |
self.os_name = self._determine_os_name(sys_module.platform) |
| 68 |
self.os_version = None |
66 |
self.os_version = None |
|
Lines 136-147
class PlatformInfo(object):
a/Tools/Scripts/webkitpy/common/system/platforminfo.py_sec3
|
| 136 |
def display_name(self): |
134 |
def display_name(self): |
| 137 |
# platform.platform() returns Darwin information for Mac, which is just confusing. |
135 |
# platform.platform() returns Darwin information for Mac, which is just confusing. |
| 138 |
if self.is_mac(): |
136 |
if self.is_mac(): |
| 139 |
return "Mac OS X %s" % (self._platform_module or platform).mac_ver()[0] |
137 |
return "Mac OS X %s" % self._platform_module.mac_ver()[0] |
| 140 |
|
138 |
|
| 141 |
# Returns strings like: |
139 |
# Returns strings like: |
| 142 |
# Linux-2.6.18-194.3.1.el5-i686-with-redhat-5.5-Final |
140 |
# Linux-2.6.18-194.3.1.el5-i686-with-redhat-5.5-Final |
| 143 |
# Windows-2008ServerR2-6.1.7600 |
141 |
# Windows-2008ServerR2-6.1.7600 |
| 144 |
return (self._platform_module or platform).platform() |
142 |
return self._platform_module.platform() |
| 145 |
|
143 |
|
| 146 |
def os_version_name(self, table=None): |
144 |
def os_version_name(self, table=None): |
| 147 |
if not self.os_version: |
145 |
if not self.os_version: |
|
Lines 248-254
class PlatformInfo(object):
a/Tools/Scripts/webkitpy/common/system/platforminfo.py_sec4
|
| 248 |
return Version.from_iterable(match_object.groups()) |
246 |
return Version.from_iterable(match_object.groups()) |
| 249 |
|
247 |
|
| 250 |
def _win_version_str(self): |
248 |
def _win_version_str(self): |
| 251 |
version = (self._platform_module or platform).win32_ver()[1] |
249 |
version = self._platform_module.win32_ver()[1] |
| 252 |
if version: |
250 |
if version: |
| 253 |
return version |
251 |
return version |
| 254 |
# Note that this should only ever be called on windows, so this should always work. |
252 |
# Note that this should only ever be called on windows, so this should always work. |