PSL : A simple python script launcher with global params overridance.
- It happens you need to run some scripts in a row
- It happens as well you need to run a script with different params contexts
- PSL allows to launch scripts and externally override global params
- In a script,
lib.PSLUpdateGlobalsFromEncodedCallArgs()
hooks PSL in (previously defined global params can be potentially overriden) - From a launcher script,
lib.PSLLaunch(scriptFile, scriptArgs, globalParams)
will launch the scriptscriptFile
, with argsscriptArgs
, and will override global params withglobalParams
globalParams
is a dictionnary of global params :- The keys are the name of a script global params
- If the global param is not defined in the script, no failure
- If the the global param is defined in the script :
- If it is a dictionnary, the dics are merged
- If not, the value is overriden
- The
globalParams
are actually sent to the script as a base64 encoded string as the named arg--updateGlobals
- In PSLed script, the global params are updated with
inspect.currentframe()
scriptLauncher.py
is the launcher scriptscriptX.py
are test launched scriptsparams.json
is defininggroups
ofruns
- A
run
is a python script + its global params overridances - Tests:
- Manual / traditionnal launching :
python script1.py
- PSL lauching on all groups :
python scriptLauncher.py all
- PSL lauching on a specific group :
python scriptLauncher.py smalls
- Manual / traditionnal launching :
- python 3
pip install -r requirements.txt