From ca35c09c4d5524f07d46b474cb6b719411ad5540 Mon Sep 17 00:00:00 2001 From: slashtechno <77907286+slashtechno@users.noreply.github.com> Date: Tue, 1 Aug 2023 00:55:57 -0500 Subject: [PATCH] Changed folder structure --- .gitignore | 3 ++- {src => cloudflare_gateway_adblocking}/__init__.py | 0 src/cmd.py => cloudflare_gateway_adblocking/__main__.py | 4 ++-- {src => cloudflare_gateway_adblocking}/utils/__init__.py | 2 +- .../utils/delete_adblock_zerotrust.py | 0 {src => cloudflare_gateway_adblocking}/utils/upload.py | 0 {src => cloudflare_gateway_adblocking}/utils/utils.py | 0 pyproject.toml | 5 ++++- 8 files changed, 9 insertions(+), 5 deletions(-) rename {src => cloudflare_gateway_adblocking}/__init__.py (100%) rename src/cmd.py => cloudflare_gateway_adblocking/__main__.py (95%) rename {src => cloudflare_gateway_adblocking}/utils/__init__.py (51%) rename src/utils/delete.py => cloudflare_gateway_adblocking/utils/delete_adblock_zerotrust.py (100%) rename {src => cloudflare_gateway_adblocking}/utils/upload.py (100%) rename {src => cloudflare_gateway_adblocking}/utils/utils.py (100%) 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"