py5coding / py5generator

Meta-programming project that creates the py5 library code.
https://py5coding.org/
GNU General Public License v3.0
52 stars 13 forks source link

Parameterize blocking in `imported.run_code()` #231

Closed hx2A closed 1 year ago

hx2A commented 1 year ago

Users should be able to call imported.run_code(sketch_code, block=False) to change the default option in that module's _CODE_FRAMEWORK template.

hx2A commented 1 year ago

@villares , this is now fixed. The signature for imported.run_code() is now:

def run_code(sketch_path, *, classpath=None, new_process=False, exit_if_error=False,
             py5_options=None, sketch_args=None, block=True):

The * and the block=True are both new.

I can't test your specific use case but it should be OK. I did test everything else (py5bot, run_sketch util, etc) and everything works as expected.