Compare commits
2 commits
6c0c45643a
...
2838efa0c2
| Author | SHA1 | Date | |
|---|---|---|---|
| 2838efa0c2 | |||
| 432533fdad |
12 changed files with 13643 additions and 8858 deletions
|
|
@ -1,50 +1,56 @@
|
||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
// README at: https://github.com/devcontainers/templates/tree/main/src/python
|
// README at: https://github.com/devcontainers/templates/tree/main/src/python
|
||||||
{
|
{
|
||||||
"name": "Advent22 API",
|
"name": "Advent22 API",
|
||||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
|
||||||
"image": "mcr.microsoft.com/vscode/devcontainers/python:1-3.11-bookworm",
|
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
"image": "mcr.microsoft.com/devcontainers/python:3-3.14-trixie",
|
||||||
"features": {
|
|
||||||
"ghcr.io/devcontainers-extra/features/poetry:2": {},
|
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||||
"ghcr.io/devcontainers-extra/features/apt-get-packages:1": {
|
"features": {
|
||||||
"packages": "git-flow, git-lfs"
|
"ghcr.io/devcontainers/features/git-lfs:1": {},
|
||||||
},
|
"ghcr.io/devcontainers-extra/features/poetry:2": {},
|
||||||
"ghcr.io/itsmechlark/features/redis-server:1": {}
|
"ghcr.io/devcontainers-extra/features/apt-get-packages:1": {
|
||||||
},
|
"packages": "git-flow"
|
||||||
"containerEnv": {
|
},
|
||||||
"TZ": "Europe/Berlin"
|
"ghcr.io/itsmechlark/features/redis-server:1": {}
|
||||||
},
|
},
|
||||||
// Configure tool-specific properties.
|
|
||||||
"customizations": {
|
"containerEnv": {
|
||||||
// Configure properties specific to VS Code.
|
"TZ": "Europe/Berlin"
|
||||||
"vscode": {
|
},
|
||||||
// Set *default* container specific settings.json values on container create.
|
|
||||||
"settings": {
|
// Configure tool-specific properties.
|
||||||
"python.defaultInterpreterPath": "/usr/local/bin/python",
|
"customizations": {
|
||||||
"terminal.integrated.defaultProfile.linux": "zsh"
|
// Configure properties specific to VS Code.
|
||||||
},
|
"vscode": {
|
||||||
// Add the IDs of extensions you want installed when the container is created.
|
// Set *default* container specific settings.json values on container create.
|
||||||
"extensions": [
|
"settings": {
|
||||||
"be5invis.toml",
|
"python.defaultInterpreterPath": "/usr/local/bin/python",
|
||||||
"mhutchie.git-graph",
|
"terminal.integrated.defaultProfile.linux": "zsh"
|
||||||
"ms-python.python",
|
},
|
||||||
"ms-python.black-formatter",
|
// Add the IDs of extensions you want installed when the container is created.
|
||||||
"ms-python.flake8",
|
"extensions": [
|
||||||
"ms-python.isort",
|
"be5invis.toml",
|
||||||
"ms-python.vscode-pylance"
|
"mhutchie.git-graph",
|
||||||
]
|
"ms-python.python",
|
||||||
}
|
"ms-python.black-formatter",
|
||||||
},
|
"ms-python.flake8",
|
||||||
"postCreateCommand": "sudo /usr/local/py-utils/bin/poetry self add poetry-plugin-up",
|
"ms-python.isort",
|
||||||
// Use 'postStartCommand' to run commands after the container is started.
|
"ms-python.vscode-pylance"
|
||||||
"postStartCommand": "poetry install"
|
]
|
||||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
}
|
||||||
// "features": {},
|
},
|
||||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
|
||||||
// "forwardPorts": [],
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
// Use 'postCreateCommand' to run commands after the container is created.
|
"postCreateCommand": "sudo /usr/local/py-utils/bin/poetry self add poetry-plugin-up",
|
||||||
// "postCreateCommand": "pip3 install --user -r requirements.txt",
|
|
||||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
// Use 'postStartCommand' to run commands after the container is started.
|
||||||
// "remoteUser": "root"
|
"postStartCommand": "poetry install"
|
||||||
|
|
||||||
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
// "forwardPorts": [],
|
||||||
|
|
||||||
|
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||||
|
// "remoteUser": "root"
|
||||||
}
|
}
|
||||||
35
api/.vscode/settings.json
vendored
35
api/.vscode/settings.json
vendored
|
|
@ -1,20 +1,33 @@
|
||||||
{
|
{
|
||||||
"python.languageServer": "Pylance",
|
|
||||||
"editor.formatOnSave": true,
|
|
||||||
"[python]": {
|
|
||||||
"editor.defaultFormatter": "ms-python.black-formatter"
|
|
||||||
},
|
|
||||||
"editor.codeActionsOnSave": {
|
|
||||||
"source.organizeImports": "explicit"
|
|
||||||
},
|
|
||||||
"git.closeDiffOnOperation": true,
|
"git.closeDiffOnOperation": true,
|
||||||
|
|
||||||
|
"[python]": {
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "ms-python.black-formatter",
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.organizeImports": "explicit",
|
||||||
|
"source.fixAll": "explicit",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
"python.languageServer": "Pylance",
|
||||||
|
"python.analysis.autoImportCompletions": true,
|
||||||
|
"python.analysis.importFormat": "relative",
|
||||||
|
"python.analysis.fixAll": [
|
||||||
|
"source.convertImportFormat",
|
||||||
|
"source.unusedImports",
|
||||||
|
],
|
||||||
"python.analysis.typeCheckingMode": "basic",
|
"python.analysis.typeCheckingMode": "basic",
|
||||||
"python.analysis.diagnosticMode": "workspace",
|
"python.analysis.diagnosticMode": "workspace",
|
||||||
"python.testing.pytestArgs": [
|
|
||||||
"test"
|
|
||||||
],
|
|
||||||
"python.testing.unittestEnabled": false,
|
"python.testing.unittestEnabled": false,
|
||||||
"python.testing.pytestEnabled": true,
|
"python.testing.pytestEnabled": true,
|
||||||
|
"python.testing.pytestArgs": [
|
||||||
|
"--import-mode=importlib",
|
||||||
|
"test",
|
||||||
|
],
|
||||||
|
|
||||||
"black-formatter.importStrategy": "fromEnvironment",
|
"black-formatter.importStrategy": "fromEnvironment",
|
||||||
"flake8.importStrategy": "fromEnvironment",
|
"flake8.importStrategy": "fromEnvironment",
|
||||||
|
"isort.importStrategy": "fromEnvironment",
|
||||||
}
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import colorsys
|
import colorsys
|
||||||
import logging
|
import logging
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Self, TypeAlias, cast
|
from typing import AnyStr, Self, TypeAlias
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from PIL import Image as PILImage
|
from PIL import Image as PILImage
|
||||||
|
|
@ -56,7 +56,7 @@ class AdventImage:
|
||||||
async def get_text_box(
|
async def get_text_box(
|
||||||
self,
|
self,
|
||||||
xy: _XY,
|
xy: _XY,
|
||||||
text: str | bytes,
|
text: AnyStr,
|
||||||
font: FreeTypeFont,
|
font: FreeTypeFont,
|
||||||
anchor: str | None = "mm",
|
anchor: str | None = "mm",
|
||||||
**text_kwargs,
|
**text_kwargs,
|
||||||
|
|
@ -95,12 +95,12 @@ class AdventImage:
|
||||||
pixel_data = np.asarray(self.img.crop(box))
|
pixel_data = np.asarray(self.img.crop(box))
|
||||||
mean_color: np.ndarray = np.mean(pixel_data, axis=(0, 1))
|
mean_color: np.ndarray = np.mean(pixel_data, axis=(0, 1))
|
||||||
|
|
||||||
return cast(_RGB, tuple(mean_color.astype(int)))
|
return _RGB(mean_color.astype(int))
|
||||||
|
|
||||||
async def hide_text(
|
async def hide_text(
|
||||||
self,
|
self,
|
||||||
xy: _XY,
|
xy: _XY,
|
||||||
text: str | bytes,
|
text: AnyStr,
|
||||||
font: FreeTypeFont,
|
font: FreeTypeFont,
|
||||||
anchor: str | None = "mm",
|
anchor: str | None = "mm",
|
||||||
**text_kwargs,
|
**text_kwargs,
|
||||||
|
|
@ -135,14 +135,14 @@ class AdventImage:
|
||||||
tc_v -= 3
|
tc_v -= 3
|
||||||
|
|
||||||
text_color = colorsys.hsv_to_rgb(tc_h, tc_s, tc_v)
|
text_color = colorsys.hsv_to_rgb(tc_h, tc_s, tc_v)
|
||||||
text_color = tuple(int(val) for val in text_color)
|
text_color = _RGB(int(val) for val in text_color)
|
||||||
|
|
||||||
# Buchstaben verstecken
|
# Buchstaben verstecken
|
||||||
ImageDraw.Draw(self.img).text(
|
ImageDraw.Draw(self.img).text(
|
||||||
xy=xy,
|
xy=xy,
|
||||||
text=text,
|
text=text,
|
||||||
font=font,
|
font=font,
|
||||||
fill=cast(_RGB, text_color),
|
fill=text_color,
|
||||||
anchor=anchor,
|
anchor=anchor,
|
||||||
**text_kwargs,
|
**text_kwargs,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,7 @@ from typing import Callable, Hashable
|
||||||
import requests
|
import requests
|
||||||
from cachetools.keys import hashkey
|
from cachetools.keys import hashkey
|
||||||
from CacheToolsUtils import RedisCache as __RedisCache
|
from CacheToolsUtils import RedisCache as __RedisCache
|
||||||
from redis.commands.core import ResponseT
|
from redis.typing import EncodableT, ResponseT
|
||||||
from redis.typing import EncodableT
|
|
||||||
from webdav3.client import Client as __WebDAVclient
|
from webdav3.client import Client as __WebDAVclient
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
2407
api/poetry.lock
generated
2407
api/poetry.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -9,24 +9,24 @@ name = "advent22_api"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
Pillow = "^10.2.0"
|
Pillow = "^12.1.1"
|
||||||
asyncify = "^0.9.2"
|
asyncify = "^0.12.1"
|
||||||
cachetools = "^5.3.3"
|
cachetools = "^7.0.1"
|
||||||
cachetoolsutils = "^8.5"
|
cachetoolsutils = "^11.0"
|
||||||
fastapi = "^0.103.1"
|
fastapi = "^0.129.0"
|
||||||
markdown = "^3.6"
|
markdown = "^3.10.2"
|
||||||
numpy = "^1.26.4"
|
numpy = "^2.4.2"
|
||||||
pydantic-settings = "^2.2.1"
|
pydantic-settings = "^2.13.0"
|
||||||
python = ">=3.11,<3.13"
|
python = ">=3.11,<3.15"
|
||||||
redis = {extras = ["hiredis"], version = "^5.0.3"}
|
redis = {extras = ["hiredis"], version = "^7.1.1"}
|
||||||
tomli-w = "^1.0.0"
|
tomli-w = "^1.2.0"
|
||||||
uvicorn = {extras = ["standard"], version = "^0.23.2"}
|
uvicorn = {extras = ["standard"], version = "^0.40.0"}
|
||||||
webdavclient3 = "^3.14.6"
|
webdavclient3 = "^3.14.7"
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
black = "^24.3.0"
|
black = "^26.1.0"
|
||||||
flake8 = "^7.0.0"
|
flake8 = "^7.3.0"
|
||||||
pytest = "^8.1.1"
|
pytest = "^9.0.2"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
"name": "Advent22 UI",
|
"name": "Advent22 UI",
|
||||||
|
|
||||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||||
"image": "mcr.microsoft.com/devcontainers/javascript-node:4-20-trixie",
|
"image": "mcr.microsoft.com/devcontainers/javascript-node:4-24-trixie",
|
||||||
|
|
||||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||||
"features": {
|
"features": {
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
// "postCreateCommand": "yarn install",
|
// "postCreateCommand": "yarn install",
|
||||||
|
|
||||||
// Use 'postStartCommand' to run commands after the container is started.
|
// Use 'postStartCommand' to run commands after the container is started.
|
||||||
"postStartCommand": "npx --yes update-browserslist-db@latest && yarn install --production false"
|
"postStartCommand": "yarn dlx update-browserslist-db@latest && yarn install"
|
||||||
|
|
||||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
// "forwardPorts": [],
|
// "forwardPorts": [],
|
||||||
|
|
|
||||||
156
ui/.gitignore
vendored
156
ui/.gitignore
vendored
|
|
@ -1,23 +1,149 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
|
||||||
/dist
|
|
||||||
|
|
||||||
|
# https://raw.githubusercontent.com/github/gitignore/refs/heads/main/Node.gitignore
|
||||||
|
|
||||||
# local env files
|
# Logs
|
||||||
.env.local
|
logs
|
||||||
.env.*.local
|
*.log
|
||||||
|
|
||||||
# Log files
|
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
pnpm-debug.log*
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
# Editor directories and files
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
.idea
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
# .vscode
|
|
||||||
*.suo
|
# Runtime data
|
||||||
*.ntvs*
|
pids
|
||||||
*.njsproj
|
*.pid
|
||||||
*.sln
|
*.seed
|
||||||
*.sw?
|
*.pid.lock
|
||||||
|
|
||||||
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
|
lib-cov
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
coverage
|
||||||
|
*.lcov
|
||||||
|
|
||||||
|
# nyc test coverage
|
||||||
|
.nyc_output
|
||||||
|
|
||||||
|
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
# Bower dependency directory (https://bower.io/)
|
||||||
|
bower_components
|
||||||
|
|
||||||
|
# node-waf configuration
|
||||||
|
.lock-wscript
|
||||||
|
|
||||||
|
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||||
|
build/Release
|
||||||
|
|
||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# Snowpack dependency directory (https://snowpack.dev/)
|
||||||
|
web_modules/
|
||||||
|
|
||||||
|
# TypeScript cache
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# Optional npm cache directory
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# Optional eslint cache
|
||||||
|
.eslintcache
|
||||||
|
|
||||||
|
# Optional stylelint cache
|
||||||
|
.stylelintcache
|
||||||
|
|
||||||
|
# Optional REPL history
|
||||||
|
.node_repl_history
|
||||||
|
|
||||||
|
# Output of 'npm pack'
|
||||||
|
*.tgz
|
||||||
|
|
||||||
|
# Yarn Integrity file
|
||||||
|
.yarn-integrity
|
||||||
|
|
||||||
|
# dotenv environment variable files
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
# parcel-bundler cache (https://parceljs.org/)
|
||||||
|
.cache
|
||||||
|
.parcel-cache
|
||||||
|
|
||||||
|
# Next.js build output
|
||||||
|
.next
|
||||||
|
out
|
||||||
|
|
||||||
|
# Nuxt.js build / generate output
|
||||||
|
.nuxt
|
||||||
|
dist
|
||||||
|
.output
|
||||||
|
|
||||||
|
# Gatsby files
|
||||||
|
.cache/
|
||||||
|
# Comment in the public line in if your project uses Gatsby and not Next.js
|
||||||
|
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||||
|
# public
|
||||||
|
|
||||||
|
# vuepress build output
|
||||||
|
.vuepress/dist
|
||||||
|
|
||||||
|
# vuepress v2.x temp and cache directory
|
||||||
|
.temp
|
||||||
|
.cache
|
||||||
|
|
||||||
|
# Sveltekit cache directory
|
||||||
|
.svelte-kit/
|
||||||
|
|
||||||
|
# vitepress build output
|
||||||
|
**/.vitepress/dist
|
||||||
|
|
||||||
|
# vitepress cache directory
|
||||||
|
**/.vitepress/cache
|
||||||
|
|
||||||
|
# Docusaurus cache and generated files
|
||||||
|
.docusaurus
|
||||||
|
|
||||||
|
# Serverless directories
|
||||||
|
.serverless/
|
||||||
|
|
||||||
|
# FuseBox cache
|
||||||
|
.fusebox/
|
||||||
|
|
||||||
|
# DynamoDB Local files
|
||||||
|
.dynamodb/
|
||||||
|
|
||||||
|
# Firebase cache directory
|
||||||
|
.firebase/
|
||||||
|
|
||||||
|
# TernJS port file
|
||||||
|
.tern-port
|
||||||
|
|
||||||
|
# Stores VSCode versions used for testing VSCode extensions
|
||||||
|
.vscode-test
|
||||||
|
|
||||||
|
# pnpm
|
||||||
|
.pnpm-store
|
||||||
|
|
||||||
|
# yarn v3
|
||||||
|
.pnp.*
|
||||||
|
.yarn/*
|
||||||
|
!.yarn/patches
|
||||||
|
!.yarn/plugins
|
||||||
|
!.yarn/releases
|
||||||
|
!.yarn/sdks
|
||||||
|
!.yarn/versions
|
||||||
|
|
||||||
|
# Vite files
|
||||||
|
vite.config.js.timestamp-*
|
||||||
|
vite.config.ts.timestamp-*
|
||||||
|
.vite/
|
||||||
|
|
|
||||||
942
ui/.yarn/releases/yarn-4.12.0.cjs
vendored
Executable file
942
ui/.yarn/releases/yarn-4.12.0.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
2
ui/.yarnrc.yml
Normal file
2
ui/.yarnrc.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
nodeLinker: node-modules
|
||||||
|
yarnPath: .yarn/releases/yarn-4.12.0.cjs
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
"name": "advent22_ui",
|
"name": "advent22_ui",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"packageManager": "yarn@4.12.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
"build": "vue-cli-service build",
|
"build": "vue-cli-service build",
|
||||||
|
|
|
||||||
18807
ui/yarn.lock
18807
ui/yarn.lock
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue