diff --git a/.gitignore b/.gitignore index 8a01d92..98fa8d5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ tmp.txt blocklists/* !blocklists/.gitkeep tmp.py -.venv \ No newline at end of file +.venv +testtmp \ No newline at end of file diff --git a/src/__init__.py b/cloudflare_gateway_adblocking/__init__.py similarity index 100% rename from src/__init__.py rename to cloudflare_gateway_adblocking/__init__.py diff --git a/src/cmd.py b/cloudflare_gateway_adblocking/__main__.py similarity index 95% rename from src/cmd.py rename to cloudflare_gateway_adblocking/__main__.py index 6fa6879..7471fb8 100644 --- a/src/cmd.py +++ b/cloudflare_gateway_adblocking/__main__.py @@ -112,10 +112,10 @@ def upload_to_cloudflare(args): def delete_from_cloudflare(args): logger.info("Deleting from Cloudflare") rules = utils.utils.get_gateway_rules(ACCOUNT_ID, TOKEN) - utils.delete.delete_adblock_policy(rules, ACCOUNT_ID, TOKEN) + utils.delete_adblock_zerotrust.delete_adblock_policy(rules, ACCOUNT_ID, TOKEN) lists = utils.utils.get_lists(ACCOUNT_ID, TOKEN) lists = utils.utils.filter_adblock_lists(lists) - utils.delete.delete_adblock_list(lists, ACCOUNT_ID, TOKEN) + utils.delete_adblock_zerotrust.delete_adblock_list(lists, ACCOUNT_ID, TOKEN) if __name__ == "__main__": cli() diff --git a/src/utils/__init__.py b/cloudflare_gateway_adblocking/utils/__init__.py similarity index 51% rename from src/utils/__init__.py rename to cloudflare_gateway_adblocking/utils/__init__.py index ed1e77e..5150c17 100644 --- a/src/utils/__init__.py +++ b/cloudflare_gateway_adblocking/utils/__init__.py @@ -1,3 +1,3 @@ from .utils import * from .upload import * -from .delete import * +from .delete_adblock_zerotrust import * diff --git a/src/utils/delete.py b/cloudflare_gateway_adblocking/utils/delete_adblock_zerotrust.py similarity index 100% rename from src/utils/delete.py rename to cloudflare_gateway_adblocking/utils/delete_adblock_zerotrust.py diff --git a/src/utils/upload.py b/cloudflare_gateway_adblocking/utils/upload.py similarity index 100% rename from src/utils/upload.py rename to cloudflare_gateway_adblocking/utils/upload.py diff --git a/src/utils/utils.py b/cloudflare_gateway_adblocking/utils/utils.py similarity index 100% rename from src/utils/utils.py rename to cloudflare_gateway_adblocking/utils/utils.py diff --git a/pyproject.toml b/pyproject.toml index fb7090f..182bb16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,10 @@ description = "Serverless adblocking via Cloudflare Zero Trust Gateway" authors = ["slastechno <77907286+slashtechno@users.noreply.github.com>"] license = "MIT" readme = "README.md" -packages = [{include = "src"}] +packages = [{include = "cloudflare_gateway_adblocking"}] + +[tool.poetry.scripts] +cloudflare-gateway-adblocking = "cloudflare_gateway_adblocking.__main__:cli" [tool.poetry.dependencies] python = "^3.10"