MCPcopy Index your code
hub / github.com/flet-dev/flet / get_platform

Function get_platform

sdk/python/packages/flet/src/flet/utils/platform_utils.py:147–166  ·  view source on GitHub ↗

Returns the normalized platform identifier used by Flet. Returns: One of: `windows`, `linux`, or `darwin`. Raises: :class:`~flet.FletUnsupportedPlatformException`: If the current platform is unsupported.

()

Source from the content-addressed store, hash-verified

145
146
147def get_platform():
148 """
149 Returns the normalized platform identifier used by Flet.
150
151 Returns:
152 One of: `windows`, `linux`, or `darwin`.
153
154 Raises:
155 :class:`~flet.FletUnsupportedPlatformException`: If the current platform is
156 unsupported.
157 """
158 p = platform.system() if not is_mobile() else ""
159 if is_windows():
160 return "windows"
161 elif p == "Linux":
162 return "linux"
163 elif p == "Darwin":
164 return "darwin"
165 else:
166 raise FletUnsupportedPlatformException(f"Unsupported platform: {p}")
167
168
169def get_arch():

Callers

nothing calls this directly

Calls 3

is_mobileFunction · 0.85
is_windowsFunction · 0.85

Tested by

no test coverage detected