[webkitpy] PlatformInfo should have default argument for casual use
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Jan 2018 19:14:32 +0000 (19:14 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Jan 2018 19:14:32 +0000 (19:14 +0000)
commit00c018935a7f3a015fa89be841395f9db1d459c5
tree4ae60611b97e5995bbd9f19021fe622aca4a93e6
parent6ce591f7db7d63faabe15d156b7f83b9964c53f2
[webkitpy] PlatformInfo should have default argument for casual use
https://bugs.webkit.org/show_bug.cgi?id=180827

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-01-09
Reviewed by David Kilzer.

PlatformInfo should be the only way to check platform specific thing instead
of sys.platform or other various checks. If there is something you want to check,
it should be placed in PlatformInfo.

Currently to instantiate PlatformInfo, it requires arguments, which is usually
sys, platform and Executive(). They are straight forward and should be handled
by default arguments. Then we can instantiate PlatformInfo more casual.

* Scripts/webkitpy/common/system/platforminfo.py:
(PlatformInfo): Use relative module path import
(PlatformInfo.__init__):
(PlatformInfo.executive): Lazy instantiation of Executive()
(PlatformInfo.total_bytes_memory): Accessing via above property
(PlatformInfo.xcode_sdk_version): Ditto
(PlatformInfo.xcode_simctl_list): Ditto
(PlatformInfo.xcode_version): Ditto
(PlatformInfo._win_version_str): Ditto
* Scripts/webkitpy/common/system/systemhost.py:
(SystemHost.__init__):
* Scripts/webkitpy/common/system/user.py:
(User.__init__):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/Scripts/webkitpy/common/system/platforminfo.py
Tools/Scripts/webkitpy/common/system/systemhost.py
Tools/Scripts/webkitpy/common/system/user.py