| 10 | # `hook_function_argument_map` is only a required argument for adapters that implement |
| 11 | # custom hooks. |
| 12 | def read_from_file(filepath, suffix="", hook_function_argument_map=None): |
| 13 | import opentimelineio as otio |
| 14 | |
| 15 | fake_tl = otio.schema.Timeline(name=filepath + str(suffix)) |
| 16 | fake_tl.tracks.append(otio.schema.Track()) |
| 17 | fake_tl.tracks[0].append(otio.schema.Clip(name=filepath + "_clip")) |
| 18 | |
| 19 | if (hook_function_argument_map and |
| 20 | hook_function_argument_map.get("run_custom_hook", False)): |
| 21 | return otio.hooks.run(hook="custom_adapter_hook", tl=fake_tl, |
| 22 | extra_args=hook_function_argument_map) |
| 23 | |
| 24 | return fake_tl |
| 25 | |
| 26 | |
| 27 | # `hook_function_argument_map` is only a required argument for adapters that implement |