Skip to content

Commit c3d4749

Browse files
committed
platform print
1 parent 3f99f1c commit c3d4749

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,39 @@
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+
if PLATFORM == "Linux":
24+
pass # python 3.10 print(platform.freedesktop_os_release())
25+
else:
26+
pass # python 3.10 print(platform.freedesktop_os_release())
27+
# platform.release() seems to give kernel version - hence microsoft for WSL?
28+
extra = platform.release()
2129
elif raw_platform == "Darwin":
2230
PLATFORM = "MacOS"
31+
# platform.release() gives kernel version, but this can give OS & architecture
32+
mac_ver = platform.mac_ver()
33+
extra = f"{mac_ver[0]} on {mac_ver[2]}"
34+
elif raw_platform == "Windows":
35+
PLATFORM = "unsupported"
36+
# platform.win32_ver() gives more information as a tuple
37+
extra = platform.release()
2338
else:
2439
PLATFORM = "unsupported"
40+
extra = platform.release()
2541

2642

2743
# PLATFORM DEPENDENT HELPERS
2844
MOUSE_SELECTION_KEY = "Fn + Alt" if PLATFORM == "MacOS" else "Shift"
2945

3046

3147
def detected_platform() -> str:
48+
print(extra)
3249
return PLATFORM
3350

3451

0 commit comments

Comments
 (0)