aboutsummaryrefslogtreecommitdiff
path: root/scripts/build/option_handler.py
diff options
context:
space:
mode:
author CptAlanSmith <123112708+CptAlanSmith@users.noreply.github.com>2023-09-24 12:05:36 +0200
committer GitHub <noreply@github.com>2023-09-24 12:05:36 +0200
commita579fa30b9faced48499028f32e3ae53d7eeb142 (patch)
treed1e99c1e2ea0765d7c721851b89b8c9ef0c90af8 /scripts/build/option_handler.py
parent0b4c30aa02c3ec1dacfc3ac190af4733531753ea (diff)
parentcc3ced120cdb83b144f9c19d338cb354d15442e8 (diff)
Merge pull request #158 from Spartan322/outsource/extras
Move actions and scripts to separate reusable repos
Diffstat (limited to 'scripts/build/option_handler.py')
-rw-r--r--scripts/build/option_handler.py39
1 files changed, 0 insertions, 39 deletions
diff --git a/scripts/build/option_handler.py b/scripts/build/option_handler.py
deleted file mode 100644
index 3cebc1a..0000000
--- a/scripts/build/option_handler.py
+++ /dev/null
@@ -1,39 +0,0 @@
-from typing import Tuple, Iterable
-from SCons.Variables import Variables
-
-class OptionsClass:
- def __init__(self, args):
- self.opts = None
- self.opt_list = []
- self.args = args
- self.saved_args = args.copy()
-
- def Add(self, variableOrKey, *argv, **kwarg):
-
- self.opt_list.append([variableOrKey, argv, kwarg])
- # Neccessary to have our own build options without errors
- if isinstance(variableOrKey, str):
- self.args.pop(variableOrKey, True)
- else:
- self.args.pop(variableOrKey[0], True)
-
- def Make(self, customs : Iterable[str]):
- self.args = self.saved_args
- profile = self.args.get("profile", "")
- if profile:
- if os.path.isfile(profile):
- customs.append(profile)
- elif os.path.isfile(profile + ".py"):
- customs.append(profile + ".py")
- self.opts = Variables(customs, self.args)
- for opt in self.opt_list:
- if opt[1] == None and opt[2] == None:
- self.opts.Add(opt[0])
- else:
- self.opts.Add(opt[0], *opt[1], **opt[2])
-
- def Finalize(self, env):
- self.opts.Update(env)
-
- def GenerateHelpText(self, env):
- return self.opts.GenerateHelpText(env)