Skip to content

Commit 67d1c63

Browse files
committed
platform_code: Add process_media_tool function.
The process_media_tool function determines and returns the media tool used based on the OS.
1 parent 40d4425 commit 67d1c63

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

zulipterminal/platform_code.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,19 @@ def normalized_file_path(path: str) -> str:
112112
return path.replace("/", "\\")
113113

114114
return path
115+
116+
117+
def process_media_tool() -> str:
118+
"""
119+
Returns the media tool command as per platform.
120+
"""
121+
if PLATFORM == "WSL":
122+
tool = "explorer.exe"
123+
elif PLATFORM == "Linux":
124+
tool = "xdg-open"
125+
elif PLATFORM == "MacOS":
126+
tool = "open"
127+
else:
128+
tool = "invalid"
129+
130+
return tool

0 commit comments

Comments
 (0)