Create the content of the dummy files.
(backend_specific_objects=None)
| 113 | |
| 114 | |
| 115 | def create_dummy_files(backend_specific_objects=None): |
| 116 | """Create the content of the dummy files.""" |
| 117 | if backend_specific_objects is None: |
| 118 | backend_specific_objects = read_init() |
| 119 | # For special correspondence backend to module name as used in the function requires_modulename |
| 120 | dummy_files = {} |
| 121 | |
| 122 | for backend, objects in backend_specific_objects.items(): |
| 123 | backend_name = "[" + ", ".join(f'"{b}"' for b in backend.split("_and_")) + "]" |
| 124 | dummy_file = "# This file is autogenerated by the command `make fix-copies`, do not edit.\n" |
| 125 | dummy_file += "from ..utils import DummyObject, requires_backends\n\n" |
| 126 | dummy_file += "\n".join([create_dummy_object(o, backend_name) for o in objects]) |
| 127 | dummy_files[backend] = dummy_file |
| 128 | |
| 129 | return dummy_files |
| 130 | |
| 131 | |
| 132 | def check_dummies(overwrite=False): |
searching dependent graphs…