From fdd8ef1fc3741ac9472b3f9f6e46cf65827566aa Mon Sep 17 00:00:00 2001 From: abc <98614666+xtekky@users.noreply.github.com> Date: Fri, 6 Oct 2023 19:51:36 +0100 Subject: ~ | new folder inluding `./tool`and `./testing` --- tool/provider_init.py | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 tool/provider_init.py (limited to 'tool/provider_init.py') diff --git a/tool/provider_init.py b/tool/provider_init.py deleted file mode 100644 index 22f21d4d..00000000 --- a/tool/provider_init.py +++ /dev/null @@ -1,33 +0,0 @@ -from pathlib import Path - - -def main(): - content = create_content() - with open("g4f/provider/__init__.py", "w", encoding="utf-8") as f: - f.write(content) - - -def create_content(): - path = Path() - paths = path.glob("g4f/provider/*.py") - paths = [p for p in paths if p.name not in ["__init__.py", "base_provider.py"]] - classnames = [p.stem for p in paths] - - import_lines = [f"from .{name} import {name}" for name in classnames] - import_content = "\n".join(import_lines) - - classnames.insert(0, "BaseProvider") - all_content = [f' "{name}"' for name in classnames] - all_content = ",\n".join(all_content) - all_content = f"__all__ = [\n{all_content},\n]" - - return f"""from .base_provider import BaseProvider -{import_content} - - -{all_content} -""" - - -if __name__ == "__main__": - main() -- cgit v1.2.3