Skip to content

Commit d5b367d

Browse files
committed
platform print
1 parent 3f99f1c commit d5b367d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ select = [
133133
"PLW", # pylint warning
134134
"RUF100", # Checks noqa rules are used
135135
"SIM", # SIMplify
136-
"T20", # prinT present
137136
"W", # Warnings (pycodestyle)
138137
"UP", # pyUPgrade
139138
"YTT", # Year TwentyTwenty (flake8-2020), sys.version checks

zulipterminal/platform_code.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,37 @@
1313
AllPlatforms = Literal[SupportedPlatforms, "unsupported"]
1414

1515
raw_platform = platform.system()
16+
print(raw_platform)
17+
print(platform.release())
1618

1719
PLATFORM: AllPlatforms
1820

1921
if raw_platform == "Linux":
2022
PLATFORM = "WSL" if "microsoft" in platform.release().lower() else "Linux"
23+
# platform.release() seems to give kernel version - hence microsoft for WSL?
24+
# TODO: In future we can use freedesktop_os_release() (python 3.10)
25+
extra = f"kernel {platform.release()}"
2126
elif raw_platform == "Darwin":
2227
PLATFORM = "MacOS"
28+
# platform.release() gives kernel version, but this gives OS & architecture
29+
mac_ver = platform.mac_ver()
30+
extra = f"{mac_ver[0]} on {mac_ver[2]}"
31+
elif raw_platform == "Windows":
32+
PLATFORM = "unsupported"
33+
# platform.win32_ver() gives more information as a tuple
34+
# Note that this includes Windows here, since it is not a supported native platform
35+
extra = f"Windows {platform.release()}"
2336
else:
2437
PLATFORM = "unsupported"
38+
extra = platform.release()
2539

2640

2741
# PLATFORM DEPENDENT HELPERS
2842
MOUSE_SELECTION_KEY = "Fn + Alt" if PLATFORM == "MacOS" else "Shift"
2943

3044

3145
def detected_platform() -> str:
46+
print(f"{PLATFORM} ({extra})")
3247
return PLATFORM
3348

3449

0 commit comments

Comments
 (0)