diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..b77e5868 --- /dev/null +++ b/.flake8 @@ -0,0 +1,6 @@ +[flake8] +ignore = E501, W503, F403, C901, B904, B902 +max-line-length = 119 +max-complexity = 18 +select = B,C,E,F,W,T4,B9 +exclude = .git,*migrations*,.tox, .venv diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..8372b8d4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,54 @@ +fail_fast: true +repos: + - repo: https://github.com/adamchainz/djade-pre-commit + rev: "1.3.2" # Replace with the latest tag on GitHub + hooks: + - id: djade + args: [ --target-version, "4.2" ] # Replace with Django version + - repo: https://github.com/pycqa/bandit + rev: 1.8.2 + hooks: + - id: bandit + args: [ "-iii", "-ll" ] + - repo: https://github.com/psf/black + rev: 24.10.0 + hooks: + - id: black + language_version: python3.9 + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-merge-conflict + - id: detect-private-key + - id: check-symlinks + - id: check-toml + - id: check-xml + - id: check-yaml + - id: forbid-new-submodules + - id: mixed-line-ending + - id: trailing-whitespace + language: python + - repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.10.0 # Use the ref you want to point at + hooks: + - id: python-no-eval + - id: python-no-log-warn + - id: python-use-type-annotations + - repo: https://github.com/asottile/pyupgrade + rev: v3.19.1 + hooks: + - id: pyupgrade + args: [ --py311-plus ] + - repo: https://github.com/PyCQA/flake8 + rev: 7.1.1 + hooks: + - id: flake8 + additional_dependencies: [ + 'flake8-blind-except', + 'flake8-docstrings', + 'flake8-bugbear', + 'flake8-comprehensions', + 'flake8-docstrings', + 'flake8-implicit-str-concat', + 'pydocstyle>=5.0.0', + ] diff --git a/action_script/syndication-collector.py b/action_script/syndication-collector.py index bc5555be..6b1955c9 100644 --- a/action_script/syndication-collector.py +++ b/action_script/syndication-collector.py @@ -2,10 +2,16 @@ import feedparser from pathlib import Path import os import json +import hashlib + +domain = "https://fundor333.com" +rss_url_mastodon = "https://mastodon.social/@fundor333.rss" -domain = 'https://fundor333.com' -rss_url_mastodon = 'https://mastodon.social/@fundor333.rss' +def clean_slug(slug: str): + return hashlib.md5( + (slug.split("?")[0]).encode("utf-8"), usedforsecurity=False + ).hexdigest() class MastodonFinder: @@ -21,9 +27,10 @@ class MastodonFinder: feed = feedparser.parse(rss_url) if feed.status == 200: for entry in feed.entries: - link = entry.get('link') - for e in self.find_urls(entry.get('description')): + link = entry.get("link") + for e in self.find_urls(entry.get("description")): if domain in e: + e = clean_slug(e) if output.get(e, False): output[e].append(link) else: @@ -44,18 +51,13 @@ class WriterSyndication: def write(self): for key in self.output.keys(): - original_path = key.split(self.domain)[1] - path_list = original_path.split('/') - path_list = [x for x in path_list if x.strip()] - filename = path_list.pop() - - path_folder = os.path.join('data', "syndication", *path_list) + path_folder = os.path.join("data", "syndication") Path(path_folder).mkdir(parents=True, exist_ok=True) - path_file = os.path.join(path_folder, filename + ".json") + path_file = os.path.join(path_folder, key) - with open(path_file, 'w') as fp: + with open(path_file + ".json", "w") as fp: json.dump({"syndication": self.output[key]}, fp) def run(self): diff --git a/action_script/webmention.py b/action_script/webmention.py index 38962474..b27f6d97 100644 --- a/action_script/webmention.py +++ b/action_script/webmention.py @@ -7,7 +7,7 @@ from pathlib import Path http_domain = "https://fundor333.com" domain = "fundor333.com" -token = os.getenv('WEBMENTIONS_TOKEN') +token = os.getenv("WEBMENTIONS_TOKEN") since_days = 30 @@ -21,16 +21,14 @@ def clean_slug(slug: str): r = requests.get(url) - data = r.json() - output = {} for webmention in data["children"]: - with open('temp.json', 'w') as fp: + with open("temp.json", "w") as fp: - label = clean_slug(webmention['wm-target']) + label = clean_slug(webmention["wm-target"]) if output.get(label, False): output[label].append(webmention) @@ -39,16 +37,16 @@ for webmention in data["children"]: for key in output.keys(): original_path = key - path_list = original_path.split('/') + path_list = original_path.split("/") path_list = [x for x in path_list if x.strip()] if path_list != []: filename = path_list.pop() - path_folder = os.path.join('data', "webmentions", *path_list) + path_folder = os.path.join("data", "webmentions", *path_list) Path(path_folder).mkdir(parents=True, exist_ok=True) path_file = os.path.join(path_folder, filename + ".json") - with open(path_file, 'w') as fp: + with open(path_file, "w") as fp: json.dump(output[key], fp) diff --git a/data/syndication/micro/2025/10/reworking-of-the-site.json b/data/syndication/3a557bcb598aca7db31183f7d38af03a.json similarity index 100% rename from data/syndication/micro/2025/10/reworking-of-the-site.json rename to data/syndication/3a557bcb598aca7db31183f7d38af03a.json diff --git a/data/syndication/photos/2025/square-square-square-and-square.json b/data/syndication/6ba02a68744476c5f716ce4b31cf2486.json similarity index 100% rename from data/syndication/photos/2025/square-square-square-and-square.json rename to data/syndication/6ba02a68744476c5f716ce4b31cf2486.json diff --git a/data/syndication/micro/2025/10/scraping-the-web-for-the-syndication-link.json b/data/syndication/b0928a709a21ad14f4208bf432ec4da3.json similarity index 100% rename from data/syndication/micro/2025/10/scraping-the-web-for-the-syndication-link.json rename to data/syndication/b0928a709a21ad14f4208bf432ec4da3.json diff --git a/data/syndication/micro/2025/10/this-is-why-you-need-a-domain.json b/data/syndication/b84affb99f8173b482f1760ec8cc9756.json similarity index 100% rename from data/syndication/micro/2025/10/this-is-why-you-need-a-domain.json rename to data/syndication/b84affb99f8173b482f1760ec8cc9756.json diff --git a/data/syndication/micro/2025/10/testing-the-hashtags.json b/data/syndication/e0d08bec318fd88cf4b1d8ee080b3aa9.json similarity index 100% rename from data/syndication/micro/2025/10/testing-the-hashtags.json rename to data/syndication/e0d08bec318fd88cf4b1d8ee080b3aa9.json diff --git a/data/syndication/post/2025/my-zsh-command-history.json b/data/syndication/e17c9a6d4800b07eef1ae8844f26ec6c.json similarity index 100% rename from data/syndication/post/2025/my-zsh-command-history.json rename to data/syndication/e17c9a6d4800b07eef1ae8844f26ec6c.json diff --git a/data/syndication/micro/2025/10/the-little-thing.json b/data/syndication/e27e929dea17d2d392d28376ed3bc87e.json similarity index 100% rename from data/syndication/micro/2025/10/the-little-thing.json rename to data/syndication/e27e929dea17d2d392d28376ed3bc87e.json diff --git a/data/syndication/photos/2025/square-tile.json b/data/syndication/f34a45a9944d9aa8679b789a8348b733.json similarity index 100% rename from data/syndication/photos/2025/square-tile.json rename to data/syndication/f34a45a9944d9aa8679b789a8348b733.json diff --git a/data/syndication/micro/2025/10/and-another-blog-is-powered-by-webmention.json b/data/syndication/f60fa429587a342d58545ddcaba90029.json similarity index 100% rename from data/syndication/micro/2025/10/and-another-blog-is-powered-by-webmention.json rename to data/syndication/f60fa429587a342d58545ddcaba90029.json diff --git a/data/webmentions/micro/2025/10/this-is-why-you-need-a-domain.json b/data/webmentions/micro/2025/10/this-is-why-you-need-a-domain.json index 635e4128..2ebab403 100644 --- a/data/webmentions/micro/2025/10/this-is-why-you-need-a-domain.json +++ b/data/webmentions/micro/2025/10/this-is-why-you-need-a-domain.json @@ -1 +1,40 @@ -[{"type": "entry", "author": {"type": "card", "name": "LaemenPang", "photo": "https://webmention.io/avatar/files.mastodon.social/f05260061d91af3ebaa31c17256d6b75b697c03d670e1e295704ec78ca10502e.jpg", "url": "https://mastodon.social/@focusedontheberry"}, "url": "https://mastodon.social/@fundor333/113856768273797658#favorited-by-112349892458455305", "published": null, "wm-received": "2025-01-20T20:03:08Z", "wm-id": 1877825, "wm-source": "https://brid.gy/like/mastodon/@fundor333@mastodon.social/113856768273797658/112349892458455305", "wm-target": "https://fundor333.com/micro/2025/10/this-is-why-you-need-a-domain/", "wm-protocol": "webmention", "like-of": "https://fundor333.com/micro/2025/10/this-is-why-you-need-a-domain/", "wm-property": "like-of", "wm-private": false}, {"type": "entry", "author": {"type": "card", "name": "LaemenPang", "photo": "https://webmention.io/avatar/files.mastodon.social/f05260061d91af3ebaa31c17256d6b75b697c03d670e1e295704ec78ca10502e.jpg", "url": "https://mastodon.social/@focusedontheberry"}, "url": "https://mastodon.social/@fundor333/113856768273797658#reblogged-by-112349892458455305", "published": null, "wm-received": "2025-01-20T19:52:47Z", "wm-id": 1877823, "wm-source": "https://brid.gy/repost/mastodon/@fundor333@mastodon.social/113856768273797658/112349892458455305", "wm-target": "https://fundor333.com/micro/2025/10/this-is-why-you-need-a-domain/", "wm-protocol": "webmention", "repost-of": "https://fundor333.com/micro/2025/10/this-is-why-you-need-a-domain/", "wm-property": "repost-of", "wm-private": false}] \ No newline at end of file +[ + { + "author": { + "name": "LaemenPang", + "photo": "https://webmention.io/avatar/files.mastodon.social/f05260061d91af3ebaa31c17256d6b75b697c03d670e1e295704ec78ca10502e.jpg", + "type": "card", + "url": "https://mastodon.social/@focusedontheberry" + }, + "like-of": "https://fundor333.com/micro/2025/10/this-is-why-you-need-a-domain/", + "published": null, + "type": "entry", + "url": "https://mastodon.social/@fundor333/113856768273797658#favorited-by-112349892458455305", + "wm-id": 1877825, + "wm-private": false, + "wm-property": "like-of", + "wm-protocol": "webmention", + "wm-received": "2025-01-20T20:03:08Z", + "wm-source": "https://brid.gy/like/mastodon/@fundor333@mastodon.social/113856768273797658/112349892458455305", + "wm-target": "https://fundor333.com/micro/2025/10/this-is-why-you-need-a-domain/" + }, + { + "author": { + "name": "LaemenPang", + "photo": "https://webmention.io/avatar/files.mastodon.social/f05260061d91af3ebaa31c17256d6b75b697c03d670e1e295704ec78ca10502e.jpg", + "type": "card", + "url": "https://mastodon.social/@focusedontheberry" + }, + "published": null, + "repost-of": "https://fundor333.com/micro/2025/10/this-is-why-you-need-a-domain/", + "type": "entry", + "url": "https://mastodon.social/@fundor333/113856768273797658#reblogged-by-112349892458455305", + "wm-id": 1877823, + "wm-private": false, + "wm-property": "repost-of", + "wm-protocol": "webmention", + "wm-received": "2025-01-20T19:52:47Z", + "wm-source": "https://brid.gy/repost/mastodon/@fundor333@mastodon.social/113856768273797658/112349892458455305", + "wm-target": "https://fundor333.com/micro/2025/10/this-is-why-you-need-a-domain/" + } +] diff --git a/layouts/_default/single.html b/layouts/_default/single.html index a79f00df..594994d8 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -5,6 +5,9 @@

{{ .Title }}

+ {{ $urlized := .Page.Permalink | md5 }} + {{ $urlized}} +
diff --git a/layouts/partials/syndication.html b/layouts/partials/syndication.html index ac8b5dfd..96dbe999 100644 --- a/layouts/partials/syndication.html +++ b/layouts/partials/syndication.html @@ -1,15 +1,23 @@ -{{ if .Params.syndication_urls }} +{{ $urlized := .Page.Permalink | md5 }} +{{ if index .Site.Data.syndication $urlized }} +


{{ end }} + + + diff --git a/makefile b/makefile index e5b8be2c..4590f1c6 100644 --- a/makefile +++ b/makefile @@ -3,20 +3,23 @@ help: ## Show this help @egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' install: ## Intall - @npm install + @npm install @hugo mod get -u + @poetry install --no-root + @poetry run pre-commit install + @poetry run pre-commit autoupdate send_webmention: ## Send webmention from feed @poetry run python send_webmention.py develop: ## Run the site localy - @hugo server --minify --disableFastRender --renderToMemory + @hugo server --minify --disableFastRender --renderToMemory developfuture: ## Run the site localy with all the future article - @hugo server --minify --disableFastRender --buildFuture --renderToMemory + @hugo server --minify --disableFastRender --buildFuture --renderToMemory developall: ## Run the site localy with all the article, future or drafts - @hugo server --minify --disableFastRender --buildFuture --buildDrafts --renderToMemory + @hugo server --minify --disableFastRender --buildFuture --buildDrafts --renderToMemory .PHONY: gomodule gomodule: ## Update Go Module @@ -37,7 +40,7 @@ cache: ## Clean the cache clean: cache gomodule ## Clean the directory of the project of chache e meta file and other things @find . -type d -empty -delete - + .PHONY: run run: clean ## Build the site cleaning all @hugo --minify @@ -61,6 +64,7 @@ deploy: clean characters ## Ready to deploy @hugo --minify @python mastodon2hugo.py @fundor333@micro.blog @python mastodon2hugo.py @fundor333@mastodon.social + @poetry run pre-commit autoupdate brodcast: clean ## Brodcast the site @@ -70,7 +74,7 @@ deploy_prod: ## Ready to deploy @npm update @poetry export --without-hashes --format=requirements.txt > requirements.txt @hugo mod get -u - @hugo --minify + @hugo --minify .PHONY: submodule diff --git a/package-lock.json b/package-lock.json index 57d1cb80..93ee932b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -196,9 +196,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001692", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001692.tgz", - "integrity": "sha512-A95VKan0kdtrsnMubMKxEKUKImOPSuCpYgxSQBo036P5YYgVIcOYJEgt/txJWqObiRQeISNCfef9nvlQ0vbV7A==", + "version": "1.0.30001695", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001695.tgz", + "integrity": "sha512-vHyLade6wTgI2u1ec3WQBxv+2BrTERV28UXQu9LO6lZ9pYeMk34vjXFLOxo1A4UBA8XTL4njRQZdno/yYaSmWw==", "funding": [ { "type": "opencollective", @@ -287,9 +287,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.83", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.83.tgz", - "integrity": "sha512-LcUDPqSt+V0QmI47XLzZrz5OqILSMGsPFkDYus22rIbgorSvBYEFqq854ltTmUdHkY92FSdAAvsh4jWEULMdfQ==", + "version": "1.5.84", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.84.tgz", + "integrity": "sha512-I+DQ8xgafao9Ha6y0qjHHvpZ9OfyA1qKlkHkjywxzniORU2awxyz7f/iVJcULmrF2yrM3nHQf+iDjJtbbexd/g==", "license": "ISC" }, "node_modules/emoji-regex": { diff --git a/poetry.lock b/poetry.lock index 186208fa..518097f6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -12,6 +12,18 @@ files = [ {file = "certifi-2024.12.14.tar.gz", hash = "sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db"}, ] +[[package]] +name = "cfgv" +version = "3.4.0" +description = "Validate configuration and produce human readable error messages." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9"}, + {file = "cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560"}, +] + [[package]] name = "charset-normalizer" version = "3.4.1" @@ -114,6 +126,18 @@ files = [ {file = "charset_normalizer-3.4.1.tar.gz", hash = "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3"}, ] +[[package]] +name = "distlib" +version = "0.3.9" +description = "Distribution utilities" +optional = false +python-versions = "*" +groups = ["dev"] +files = [ + {file = "distlib-0.3.9-py2.py3-none-any.whl", hash = "sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87"}, + {file = "distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403"}, +] + [[package]] name = "feedparser" version = "6.0.11" @@ -129,6 +153,38 @@ files = [ [package.dependencies] sgmllib3k = "*" +[[package]] +name = "filelock" +version = "3.16.1" +description = "A platform independent file lock." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "filelock-3.16.1-py3-none-any.whl", hash = "sha256:2082e5703d51fbf98ea75855d9d5527e33d8ff23099bec374a134febee6946b0"}, + {file = "filelock-3.16.1.tar.gz", hash = "sha256:c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435"}, +] + +[package.extras] +docs = ["furo (>=2024.8.6)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4.1)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.6.1)", "diff-cover (>=9.2)", "pytest (>=8.3.3)", "pytest-asyncio (>=0.24)", "pytest-cov (>=5)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.26.4)"] +typing = ["typing-extensions (>=4.12.2)"] + +[[package]] +name = "identify" +version = "2.6.6" +description = "File identification library for Python" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "identify-2.6.6-py2.py3-none-any.whl", hash = "sha256:cbd1810bce79f8b671ecb20f53ee0ae8e86ae84b557de31d89709dc2a48ba881"}, + {file = "identify-2.6.6.tar.gz", hash = "sha256:7bec12768ed44ea4761efb47806f0a41f86e7c0a5fdf5950d4648c90eca7e251"}, +] + +[package.extras] +license = ["ukkonen"] + [[package]] name = "idna" version = "3.10" @@ -144,6 +200,54 @@ files = [ [package.extras] all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] +[[package]] +name = "nodeenv" +version = "1.9.1" +description = "Node.js virtual environment builder" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +files = [ + {file = "nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9"}, + {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, +] + +[[package]] +name = "platformdirs" +version = "4.3.6" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, + {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, +] + +[package.extras] +docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"] +type = ["mypy (>=1.11.2)"] + +[[package]] +name = "pre-commit" +version = "4.1.0" +description = "A framework for managing and maintaining multi-language pre-commit hooks." +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "pre_commit-4.1.0-py2.py3-none-any.whl", hash = "sha256:d29e7cb346295bcc1cc75fc3e92e343495e3ea0196c9ec6ba53f49f10ab6ae7b"}, + {file = "pre_commit-4.1.0.tar.gz", hash = "sha256:ae3f018575a588e30dfddfab9a05448bfbd6b73d78709617b5a2b853549716d4"}, +] + +[package.dependencies] +cfgv = ">=2.0.0" +identify = ">=1.0.0" +nodeenv = ">=0.11.1" +pyyaml = ">=5.1" +virtualenv = ">=20.10.0" + [[package]] name = "python-dotenv" version = "1.0.1" @@ -159,6 +263,69 @@ files = [ [package.extras] cli = ["click (>=5.0)"] +[[package]] +name = "pyyaml" +version = "6.0.2" +description = "YAML parser and emitter for Python" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"}, + {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68"}, + {file = "PyYAML-6.0.2-cp310-cp310-win32.whl", hash = "sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99"}, + {file = "PyYAML-6.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e"}, + {file = "PyYAML-6.0.2-cp311-cp311-win32.whl", hash = "sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5"}, + {file = "PyYAML-6.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b"}, + {file = "PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4"}, + {file = "PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652"}, + {file = "PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183"}, + {file = "PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563"}, + {file = "PyYAML-6.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083"}, + {file = "PyYAML-6.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706"}, + {file = "PyYAML-6.0.2-cp38-cp38-win32.whl", hash = "sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a"}, + {file = "PyYAML-6.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725"}, + {file = "PyYAML-6.0.2-cp39-cp39-win32.whl", hash = "sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631"}, + {file = "PyYAML-6.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8"}, + {file = "pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"}, +] + [[package]] name = "requests" version = "2.32.3" @@ -210,7 +377,28 @@ h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] +[[package]] +name = "virtualenv" +version = "20.29.1" +description = "Virtual Python Environment builder" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "virtualenv-20.29.1-py3-none-any.whl", hash = "sha256:4e4cb403c0b0da39e13b46b1b2476e505cb0046b25f242bee80f62bf990b2779"}, + {file = "virtualenv-20.29.1.tar.gz", hash = "sha256:b8b8970138d32fb606192cb97f6cd4bb644fa486be9308fb9b63f81091b5dc35"}, +] + +[package.dependencies] +distlib = ">=0.3.7,<1" +filelock = ">=3.12.2,<4" +platformdirs = ">=3.9.1,<5" + +[package.extras] +docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] +test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] + [metadata] lock-version = "2.1" python-versions = "^3.11" -content-hash = "981837e1dea5b88ac9e03327d457400d21084edaa24e3c92d5d9166a8f1c2850" +content-hash = "dbaf34cb4fd4202adbc46a1ab762fe41bcf0a3b97697e166c04d0c8be757c69b" diff --git a/pyproject.toml b/pyproject.toml index 1a048c45..9f72ee7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,9 @@ requests = "^2.32.3" python-dotenv = "^1.0.1" +[tool.poetry.group.dev.dependencies] +pre-commit = "^4.1.0" + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" diff --git a/requirements.txt b/requirements.txt index 65be7d13..e69de29b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +0,0 @@ -feedparser==6.0.11 -requests -python-dotenv diff --git a/sorting_characters.py b/sorting_characters.py deleted file mode 100644 index f28496d5..00000000 --- a/sorting_characters.py +++ /dev/null @@ -1,20 +0,0 @@ -from os import listdir -from os.path import isfile, join -import random -import os -import shutil - -path_to_sort = "static/Characters" -path_to_origin = "static/Characters/origin" -onlyfiles = os.listdir(path_to_origin) - -random.shuffle(onlyfiles) - -i = 1 -for e in onlyfiles: - num = str(i).rjust(3, "0") - original = f"{path_to_origin}/{e}" - target = f"{path_to_sort}/{num}.png" - shutil.copyfile(original, target) - print(f'"https://fundor333.com/Characters/{num}.png",') - i += 1 diff --git a/temp.json b/temp.json deleted file mode 100644 index e69de29b..00000000