Load .tox from Python with args [Recommended way]

Hello! I’m looking for the optimal way (i know there is never a right way of doing things) of loading a .tox inside a container from a Python script passing custom arguments. I have come up with multiple ways of doing so, but found nothing on the forum that discusses potential benefits of doing things one way instead of another. Below, a simple example to explain my issue, with potential solutions.


My tox contains a simple moviefilein and an out. On load, I want the moviefilein to have custom parameters (from the file path, all the way to the play settings). I could:

  1. After having pulsed the tox, fill a table inside of it with all the parameters, and have everything linked to that pre-existing table.
  2. Have the tox itself have some custom parameters, and fill those out on load.
  3. Have a table oustide of my tox, and have an onStart() script go look for these parameters in the level above, and bring them in.

None of these solutions look clean to me, but I might be overthinking it. Having worked quite a bit with extensions lately, I was wondering if there was a more elegant way to pass a bunch of arguments like you would when calling a function / method within Python.

Hi @NiccoG,

my recommendation would be custom parameters on the component.
The benefit here is that the component is functioning and controllable even outside the context of your project making it potentially reusable.

cheers
Markus

Hi @snaut , thanks for the reply.

I am currently testing custom python objects stored within the tox, but if this doesn’t work or is too complex I’ll definitely go down the path you suggested.

Thanks again!