Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'build_files/buildbot/codesign/util.py')
-rw-r--r--build_files/buildbot/codesign/util.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/build_files/buildbot/codesign/util.py b/build_files/buildbot/codesign/util.py
index 3c016fe5387..e67292dd049 100644
--- a/build_files/buildbot/codesign/util.py
+++ b/build_files/buildbot/codesign/util.py
@@ -18,9 +18,28 @@
# <pep8 compliant>
+import sys
+
+from enum import Enum
from pathlib import Path
+class Platform(Enum):
+ LINUX = 1
+ MACOS = 2
+ WINDOWS = 3
+
+
+def get_current_platform() -> Platform:
+ if sys.platform == 'linux':
+ return Platform.LINUX
+ elif sys.platform == 'darwin':
+ return Platform.MACOS
+ elif sys.platform == 'win32':
+ return Platform.WINDOWS
+ raise Exception(f'Unknown platform {sys.platform}')
+
+
def ensure_file_does_not_exist_or_die(filepath: Path) -> None:
"""
If the file exists, unlink it.