(self)
| 13 | |
| 14 | class CreateInit: |
| 15 | def create(self): |
| 16 | __all__ = [] |
| 17 | |
| 18 | import os |
| 19 | |
| 20 | path = os.getcwd() |
| 21 | for file in os.listdir(path): |
| 22 | if file.endswith(".py") and not file.startswith("__init__"): |
| 23 | model = file.split(".")[0] |
| 24 | __all__.append(model) |
| 25 | |
| 26 | del os |
| 27 | |
| 28 | with open("__init__.py", "w", encoding="utf-8") as file: |
| 29 | text = "__all__ = %s" % dumps_json(__all__) |
| 30 | file.write(text) |
nothing calls this directly
no test coverage detected