(filemask)
| 31 | |
| 32 | |
| 33 | def enable(filemask): |
| 34 | import library.python.import_tracing.lib.import_tracer as import_tracer |
| 35 | import __res |
| 36 | |
| 37 | global INSTANCE |
| 38 | |
| 39 | if INSTANCE is not None: |
| 40 | return INSTANCE |
| 41 | |
| 42 | converter = _get_converter_instance() |
| 43 | import_tracer = import_tracer.ImportTracer() |
| 44 | |
| 45 | def before_import_callback(modname, filename): |
| 46 | import_tracer.start_event(modname, filename) |
| 47 | |
| 48 | def after_import_callback(modname, filename): |
| 49 | import_tracer.finish_event(modname, filename) |
| 50 | |
| 51 | __res.importer.set_callbacks(before_import_callback, after_import_callback) |
| 52 | |
| 53 | filepath = _resolve_filepath(filemask) |
| 54 | |
| 55 | new_instance = _Instance(import_tracer, converter, filepath) |
| 56 | INSTANCE = new_instance |
| 57 | |
| 58 | return new_instance |
| 59 | |
| 60 | |
| 61 | def disable(close_not_finished=False): |
nothing calls this directly
no test coverage detected