Compare commits

...

7 Commits

5 changed files with 124 additions and 77 deletions

1
.gitignore vendored
View File

@@ -409,4 +409,3 @@ bh_unicode_properties.cache
# Sublime-github package stores a github token in this file # Sublime-github package stores a github token in this file
# https://packagecontrol.io/packages/sublime-github # https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings GitHub.sublime-settings

28
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,28 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-aws-credentials
- id: detect-private-key
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py311-plus]

150
pdm.lock generated
View File

@@ -3,9 +3,8 @@
[metadata] [metadata]
groups = ["default", "dev"] groups = ["default", "dev"]
cross_platform = true strategy = ["cross_platform"]
static_urls = false lock_version = "4.4"
lock_version = "4.3"
content_hash = "sha256:4ef4ee6db10ba2c406d3a01ba1a71f1ea2b2fdced3ed314e0609e5a0351b156b" content_hash = "sha256:4ef4ee6db10ba2c406d3a01ba1a71f1ea2b2fdced3ed314e0609e5a0351b156b"
[[package]] [[package]]
@@ -149,68 +148,68 @@ files = [
[[package]] [[package]]
name = "boto3" name = "boto3"
version = "1.28.57" version = "1.29.3"
requires_python = ">= 3.7" requires_python = ">= 3.7"
summary = "The AWS SDK for Python" summary = "The AWS SDK for Python"
dependencies = [ dependencies = [
"botocore<1.32.0,>=1.31.57", "botocore<1.33.0,>=1.32.3",
"jmespath<2.0.0,>=0.7.1", "jmespath<2.0.0,>=0.7.1",
"s3transfer<0.8.0,>=0.7.0", "s3transfer<0.8.0,>=0.7.0",
] ]
files = [ files = [
{file = "boto3-1.28.57-py3-none-any.whl", hash = "sha256:5ddf24cf52c7fb6aaa332eaa08ae8c2afc8f2d1e8860680728533dd573904e32"}, {file = "boto3-1.29.3-py3-none-any.whl", hash = "sha256:85123ba6ccef12f8230bcd85bf730d3c4218e08e3cc4baaa0b3eae094703e77d"},
{file = "boto3-1.28.57.tar.gz", hash = "sha256:e2d2824ba6459b330d097e94039a9c4f96ae3f4bcdc731d620589ad79dcd16d3"}, {file = "boto3-1.29.3.tar.gz", hash = "sha256:d038b19cbe29d488133351ee6eb36ee11a0934df8bcbc0892bbeb2c544a327a4"},
] ]
[[package]] [[package]]
name = "boto3-stubs" name = "boto3-stubs"
version = "1.28.57" version = "1.29.3"
requires_python = ">=3.7" requires_python = ">=3.7"
summary = "Type annotations for boto3 1.28.57 generated with mypy-boto3-builder 7.19.0" summary = "Type annotations for boto3 1.29.3 generated with mypy-boto3-builder 7.20.3"
dependencies = [ dependencies = [
"botocore-stubs", "botocore-stubs",
"types-s3transfer", "types-s3transfer",
"typing-extensions>=4.1.0; python_version < \"3.12\"", "typing-extensions>=4.1.0; python_version < \"3.12\"",
] ]
files = [ files = [
{file = "boto3-stubs-1.28.57.tar.gz", hash = "sha256:61cd792792c2a16d70801d187ebed705c39962a70e90b5dc0f33d04001fb39ae"}, {file = "boto3-stubs-1.29.3.tar.gz", hash = "sha256:cd963cf5df25c6629e4c4625f08ce0dee003b0e5ecaf9d78f64ad98bb670561f"},
{file = "boto3_stubs-1.28.57-py3-none-any.whl", hash = "sha256:b389a693e33d75ed19d38b4a2ba99d25f4f2045a3136f816d7fec4d27a71ddb4"}, {file = "boto3_stubs-1.29.3-py3-none-any.whl", hash = "sha256:7e89134ef050311b35d97e5a1493eb4fbee7ac0f8bfa7fe1411f4779da856804"},
] ]
[[package]] [[package]]
name = "boto3-stubs" name = "boto3-stubs"
version = "1.28.57" version = "1.29.3"
extras = ["essential"] extras = ["essential"]
requires_python = ">=3.7" requires_python = ">=3.7"
summary = "Type annotations for boto3 1.28.57 generated with mypy-boto3-builder 7.19.0" summary = "Type annotations for boto3 1.29.3 generated with mypy-boto3-builder 7.20.3"
dependencies = [ dependencies = [
"boto3-stubs==1.28.57", "boto3-stubs==1.29.3",
"mypy-boto3-cloudformation<1.29.0,>=1.28.0", "mypy-boto3-cloudformation<1.30.0,>=1.29.0",
"mypy-boto3-dynamodb<1.29.0,>=1.28.0", "mypy-boto3-dynamodb<1.30.0,>=1.29.0",
"mypy-boto3-ec2<1.29.0,>=1.28.0", "mypy-boto3-ec2<1.30.0,>=1.29.0",
"mypy-boto3-lambda<1.29.0,>=1.28.0", "mypy-boto3-lambda<1.30.0,>=1.29.0",
"mypy-boto3-rds<1.29.0,>=1.28.0", "mypy-boto3-rds<1.30.0,>=1.29.0",
"mypy-boto3-s3<1.29.0,>=1.28.0", "mypy-boto3-s3<1.30.0,>=1.29.0",
"mypy-boto3-sqs<1.29.0,>=1.28.0", "mypy-boto3-sqs<1.30.0,>=1.29.0",
] ]
files = [ files = [
{file = "boto3-stubs-1.28.57.tar.gz", hash = "sha256:61cd792792c2a16d70801d187ebed705c39962a70e90b5dc0f33d04001fb39ae"}, {file = "boto3-stubs-1.29.3.tar.gz", hash = "sha256:cd963cf5df25c6629e4c4625f08ce0dee003b0e5ecaf9d78f64ad98bb670561f"},
{file = "boto3_stubs-1.28.57-py3-none-any.whl", hash = "sha256:b389a693e33d75ed19d38b4a2ba99d25f4f2045a3136f816d7fec4d27a71ddb4"}, {file = "boto3_stubs-1.29.3-py3-none-any.whl", hash = "sha256:7e89134ef050311b35d97e5a1493eb4fbee7ac0f8bfa7fe1411f4779da856804"},
] ]
[[package]] [[package]]
name = "botocore" name = "botocore"
version = "1.31.57" version = "1.32.3"
requires_python = ">= 3.7" requires_python = ">= 3.7"
summary = "Low-level, data-driven core of boto 3." summary = "Low-level, data-driven core of boto 3."
dependencies = [ dependencies = [
"jmespath<2.0.0,>=0.7.1", "jmespath<2.0.0,>=0.7.1",
"python-dateutil<3.0.0,>=2.1", "python-dateutil<3.0.0,>=2.1",
"urllib3<1.27,>=1.25.4", "urllib3<2.1,>=1.25.4; python_version >= \"3.10\"",
] ]
files = [ files = [
{file = "botocore-1.31.57-py3-none-any.whl", hash = "sha256:af006248276ff8e19e3ec7214478f6257035eb40aed865e405486500471ae71b"}, {file = "botocore-1.32.3-py3-none-any.whl", hash = "sha256:115adb7edf61ad7083fd582ac749b761fa707758bbca94d42e4e6e92940b5d38"},
{file = "botocore-1.31.57.tar.gz", hash = "sha256:301436174635bec739b225b840fc365ca00e5c1a63e5b2a19ee679d204e01b78"}, {file = "botocore-1.32.3.tar.gz", hash = "sha256:be622915db1dbf1d6d5ed907633471f9ed8f5399dd3cf333f9dc2b955cd3e80d"},
] ]
[[package]] [[package]]
@@ -510,6 +509,15 @@ files = [
{file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"},
] ]
[[package]]
name = "ifaddr"
version = "0.2.0"
summary = "Cross-platform network interface and IP address enumeration library"
files = [
{file = "ifaddr-0.2.0-py3-none-any.whl", hash = "sha256:085e0305cfe6f16ab12d72e2024030f5d52674afad6911bb1eee207177b8a748"},
{file = "ifaddr-0.2.0.tar.gz", hash = "sha256:cc0cbfcaabf765d44595825fb96a99bb12c79716b73b44330ea38ee2b0c4aed4"},
]
[[package]] [[package]]
name = "invoke" name = "invoke"
version = "2.2.0" version = "2.2.0"
@@ -641,98 +649,98 @@ files = [
[[package]] [[package]]
name = "mypy-boto3-cloudformation" name = "mypy-boto3-cloudformation"
version = "1.28.48" version = "1.29.3"
requires_python = ">=3.7" requires_python = ">=3.7"
summary = "Type annotations for boto3.CloudFormation 1.28.48 service generated with mypy-boto3-builder 7.19.0" summary = "Type annotations for boto3.CloudFormation 1.29.3 service generated with mypy-boto3-builder 7.20.3"
dependencies = [ dependencies = [
"typing-extensions>=4.1.0; python_version < \"3.12\"", "typing-extensions>=4.1.0; python_version < \"3.12\"",
] ]
files = [ files = [
{file = "mypy-boto3-cloudformation-1.28.48.tar.gz", hash = "sha256:efbe4073397800824287c8d52a65383112862f903b16fd587b5113449652371b"}, {file = "mypy-boto3-cloudformation-1.29.3.tar.gz", hash = "sha256:97de6aa92ce09783e5d58c97f417f5af5de659ef415b7c11ec202cea85c2d6c7"},
{file = "mypy_boto3_cloudformation-1.28.48-py3-none-any.whl", hash = "sha256:653e14414abc9fab8d29d693f138639a1325322fb6ba1b06ca90a6ccb11dfd94"}, {file = "mypy_boto3_cloudformation-1.29.3-py3-none-any.whl", hash = "sha256:919a00c0cce7fd6182bb0c15f3679dc2483fbf4934cbca3756addd1c0292b745"},
] ]
[[package]] [[package]]
name = "mypy-boto3-dynamodb" name = "mypy-boto3-dynamodb"
version = "1.28.36" version = "1.29.0"
requires_python = ">=3.7" requires_python = ">=3.7"
summary = "Type annotations for boto3.DynamoDB 1.28.36 service generated with mypy-boto3-builder 7.18.0" summary = "Type annotations for boto3.DynamoDB 1.29.0 service generated with mypy-boto3-builder 7.20.3"
dependencies = [ dependencies = [
"typing-extensions>=4.1.0; python_version < \"3.12\"", "typing-extensions>=4.1.0; python_version < \"3.12\"",
] ]
files = [ files = [
{file = "mypy-boto3-dynamodb-1.28.36.tar.gz", hash = "sha256:5fe1d336fdc8c58f345c9c1b4e4c1a2d164660531cf3a074d4598975fb2687de"}, {file = "mypy-boto3-dynamodb-1.29.0.tar.gz", hash = "sha256:e9b0f1cf1d66d2cbc5d7177832dcd08d85cfa84983934aa361bfc3ca57e06edc"},
{file = "mypy_boto3_dynamodb-1.28.36-py3-none-any.whl", hash = "sha256:9a3b49385d17e421661ab8639fc09cc64a706198be20287f82d83511289294a3"}, {file = "mypy_boto3_dynamodb-1.29.0-py3-none-any.whl", hash = "sha256:a54d9bf0a9449423fa909586a6003e55ba1d64fc77107c228f4091020f83d134"},
] ]
[[package]] [[package]]
name = "mypy-boto3-ec2" name = "mypy-boto3-ec2"
version = "1.28.51" version = "1.29.3"
requires_python = ">=3.7" requires_python = ">=3.7"
summary = "Type annotations for boto3.EC2 1.28.51 service generated with mypy-boto3-builder 7.19.0" summary = "Type annotations for boto3.EC2 1.29.3 service generated with mypy-boto3-builder 7.20.3"
dependencies = [ dependencies = [
"typing-extensions>=4.1.0; python_version < \"3.12\"", "typing-extensions>=4.1.0; python_version < \"3.12\"",
] ]
files = [ files = [
{file = "mypy-boto3-ec2-1.28.51.tar.gz", hash = "sha256:e62204a712e89a14e0663d3d18813ac8072706684b0e89a1b04a7d01c10f9ebe"}, {file = "mypy-boto3-ec2-1.29.3.tar.gz", hash = "sha256:9c52d4b3669ab81d13ebf3029ce19aff0c966d278b54074573a07a229b9e3e49"},
{file = "mypy_boto3_ec2-1.28.51-py3-none-any.whl", hash = "sha256:f9162f00b144cf2fab5b8b56d7883674b1d4096c79a7226b592918eae17e6235"}, {file = "mypy_boto3_ec2-1.29.3-py3-none-any.whl", hash = "sha256:ded8612e8f250527f39e9ff4fbd7661755e0953597a4461331a678061c214d44"},
] ]
[[package]] [[package]]
name = "mypy-boto3-lambda" name = "mypy-boto3-lambda"
version = "1.28.36" version = "1.29.2"
requires_python = ">=3.7" requires_python = ">=3.7"
summary = "Type annotations for boto3.Lambda 1.28.36 service generated with mypy-boto3-builder 7.18.0" summary = "Type annotations for boto3.Lambda 1.29.2 service generated with mypy-boto3-builder 7.20.3"
dependencies = [ dependencies = [
"typing-extensions>=4.1.0; python_version < \"3.12\"", "typing-extensions>=4.1.0; python_version < \"3.12\"",
] ]
files = [ files = [
{file = "mypy-boto3-lambda-1.28.36.tar.gz", hash = "sha256:70498e6ff6bfd60b758553d27fadf691ba169572faca01c2bd457da0b48b9cff"}, {file = "mypy-boto3-lambda-1.29.2.tar.gz", hash = "sha256:ef91beb5c3b0e46b2d57f95454c940673ed4fd35a56bdaaafdf0ef0b1cfd662d"},
{file = "mypy_boto3_lambda-1.28.36-py3-none-any.whl", hash = "sha256:edb1f49279f7713929a70eaab00cf3d4ba65a10016db636805d022b2eaf14c84"}, {file = "mypy_boto3_lambda-1.29.2-py3-none-any.whl", hash = "sha256:c3c14e03a303d687a0e08c37d601a5586771329f598c3c54eadfd919dbb9de4f"},
] ]
[[package]] [[package]]
name = "mypy-boto3-rds" name = "mypy-boto3-rds"
version = "1.28.41" version = "1.29.3"
requires_python = ">=3.7" requires_python = ">=3.7"
summary = "Type annotations for boto3.RDS 1.28.41 service generated with mypy-boto3-builder 7.18.2" summary = "Type annotations for boto3.RDS 1.29.3 service generated with mypy-boto3-builder 7.20.3"
dependencies = [ dependencies = [
"typing-extensions>=4.1.0; python_version < \"3.12\"", "typing-extensions>=4.1.0; python_version < \"3.12\"",
] ]
files = [ files = [
{file = "mypy-boto3-rds-1.28.41.tar.gz", hash = "sha256:19b7d6a1e3e53ff7d03157052885ceead29861fba2d9cbddf701f6238159cb72"}, {file = "mypy-boto3-rds-1.29.3.tar.gz", hash = "sha256:3ca6d7d35a89db4ba4ecc00bf9b4c2594da11a12591a44429f031fa9cb4e4f8f"},
{file = "mypy_boto3_rds-1.28.41-py3-none-any.whl", hash = "sha256:2935be3736147b726964e3cebcb918d0fc394e4012b9b7d3d0d35c12aa740ddf"}, {file = "mypy_boto3_rds-1.29.3-py3-none-any.whl", hash = "sha256:93c2c17913558b80b12c96850e2d7342ae6b9d946242b831565d8069e7a5bfe5"},
] ]
[[package]] [[package]]
name = "mypy-boto3-s3" name = "mypy-boto3-s3"
version = "1.28.52" version = "1.29.3"
requires_python = ">=3.7" requires_python = ">=3.7"
summary = "Type annotations for boto3.S3 1.28.52 service generated with mypy-boto3-builder 7.19.0" summary = "Type annotations for boto3.S3 1.29.3 service generated with mypy-boto3-builder 7.20.3"
dependencies = [ dependencies = [
"typing-extensions>=4.1.0; python_version < \"3.12\"", "typing-extensions>=4.1.0; python_version < \"3.12\"",
] ]
files = [ files = [
{file = "mypy-boto3-s3-1.28.52.tar.gz", hash = "sha256:179cb7542cc5ef656f1323ad51eb237afcba77d1e5ed07d21a013fe36effb8b2"}, {file = "mypy-boto3-s3-1.29.3.tar.gz", hash = "sha256:683c427ed722cee649443afb1dc65fc00871dac0812caa9d1947d0e3d8a03a37"},
{file = "mypy_boto3_s3-1.28.52-py3-none-any.whl", hash = "sha256:a75cd5ff28f1cb5109dd50db94259436701208fa97c61b5a2cc0689e169b7cba"}, {file = "mypy_boto3_s3-1.29.3-py3-none-any.whl", hash = "sha256:d951dd748d2717de0a9b642231fe5069e503093ad6cfb7fa5976037e8c0e95de"},
] ]
[[package]] [[package]]
name = "mypy-boto3-sqs" name = "mypy-boto3-sqs"
version = "1.28.36" version = "1.29.0"
requires_python = ">=3.7" requires_python = ">=3.7"
summary = "Type annotations for boto3.SQS 1.28.36 service generated with mypy-boto3-builder 7.18.0" summary = "Type annotations for boto3.SQS 1.29.0 service generated with mypy-boto3-builder 7.20.3"
dependencies = [ dependencies = [
"typing-extensions>=4.1.0; python_version < \"3.12\"", "typing-extensions>=4.1.0; python_version < \"3.12\"",
] ]
files = [ files = [
{file = "mypy-boto3-sqs-1.28.36.tar.gz", hash = "sha256:d9c159e020f0ef225a6d5850a3673e8b236327243ba5ffe0d13762ae4fdc0e21"}, {file = "mypy-boto3-sqs-1.29.0.tar.gz", hash = "sha256:0835256e3aabd27b2acf613c1b82a22b9de18412a0b07bd04d6d214c3f063906"},
{file = "mypy_boto3_sqs-1.28.36-py3-none-any.whl", hash = "sha256:8457aa9f2a6da44e8543e547597773f67a04e517f6a398989117cf1fa3f70d6e"}, {file = "mypy_boto3_sqs-1.29.0-py3-none-any.whl", hash = "sha256:db88751bd7765f51c2b1f9061545ddb06639d301c3d981d3b3fa4b367f0ca8ea"},
] ]
[[package]] [[package]]
name = "nicegui" name = "nicegui"
version = "1.3.15" version = "1.4.2"
requires_python = ">=3.8,<4.0" requires_python = ">=3.8,<4.0"
summary = "Create web-based user interfaces with Python. The nice way." summary = "Create web-based user interfaces with Python. The nice way."
dependencies = [ dependencies = [
@@ -740,21 +748,23 @@ dependencies = [
"aiofiles<24.0.0,>=23.1.0", "aiofiles<24.0.0,>=23.1.0",
"aiohttp<4.0.0,>=3.8.5", "aiohttp<4.0.0,>=3.8.5",
"fastapi-socketio<0.0.11,>=0.0.10", "fastapi-socketio<0.0.11,>=0.0.10",
"fastapi<1.0.0,>=0.92", "fastapi<1.0.0,>=0.93",
"httpx<0.25.0,>=0.24.1", "httpx<1.0.0,>=0.24.0",
"ifaddr<0.3.0,>=0.2.0",
"itsdangerous<3.0.0,>=2.1.2", "itsdangerous<3.0.0,>=2.1.2",
"jinja2<4.0.0,>=3.1.2", "jinja2<4.0.0,>=3.1.2",
"markdown2<3.0.0,>=2.4.7", "markdown2<3.0.0,>=2.4.7",
"orjson<4.0.0,>=3.8.6; platform_machine != \"i386\" and platform_machine != \"i686\"", "orjson<4.0.0,>=3.8.6; platform_machine != \"i386\" and platform_machine != \"i686\"",
"python-multipart<0.0.7,>=0.0.6", "python-multipart<0.0.7,>=0.0.6",
"python-socketio>=5.10.0",
"typing-extensions>=3.10.0", "typing-extensions>=3.10.0",
"uvicorn[standard]<0.23.0,>=0.22.0", "uvicorn[standard]<0.23.0,>=0.22.0",
"vbuild>=0.8.2", "vbuild>=0.8.2",
"watchfiles<1.0.0,>=0.18.1", "watchfiles<1.0.0,>=0.18.1",
] ]
files = [ files = [
{file = "nicegui-1.3.15-py3-none-any.whl", hash = "sha256:99416e285c276d443d91106ca155e90fc4ade3709a3954a60ad7dbdf2448574b"}, {file = "nicegui-1.4.2-py3-none-any.whl", hash = "sha256:fc90c115b2553593337febe88afd58c2ef30d17c583dffbac8c24c3724dece26"},
{file = "nicegui-1.3.15.tar.gz", hash = "sha256:551301163cbe0ab2eb3ce977a25c7ca5bbb14259c6582f22e2c3e98fe8daee67"}, {file = "nicegui-1.4.2.tar.gz", hash = "sha256:fad98b26c77ff9323d0b0b654aee37530ffc3deffb1f2a37059ef412d571eb06"},
] ]
[[package]] [[package]]
@@ -959,15 +969,15 @@ files = [
[[package]] [[package]]
name = "python-engineio" name = "python-engineio"
version = "4.7.1" version = "4.8.0"
requires_python = ">=3.6" requires_python = ">=3.6"
summary = "Engine.IO server and client for Python" summary = "Engine.IO server and client for Python"
dependencies = [ dependencies = [
"simple-websocket>=0.10.0", "simple-websocket>=0.10.0",
] ]
files = [ files = [
{file = "python-engineio-4.7.1.tar.gz", hash = "sha256:a8422e345cd9a21451303380b160742ff02197975b1c3a02cef115febe2b1b20"}, {file = "python-engineio-4.8.0.tar.gz", hash = "sha256:2a32585d8fecd0118264fe0c39788670456ca9aa466d7c026d995cfff68af164"},
{file = "python_engineio-4.7.1-py3-none-any.whl", hash = "sha256:52499e8ab94fea1a6525ffe872fe7028d04b575799c5fa8e2cf7880e032de42e"}, {file = "python_engineio-4.8.0-py3-none-any.whl", hash = "sha256:6055ce35b7f32b70641d53846faf76e06f2af0107a714cedb2750595c69ade43"},
] ]
[[package]] [[package]]
@@ -982,16 +992,16 @@ files = [
[[package]] [[package]]
name = "python-socketio" name = "python-socketio"
version = "5.9.0" version = "5.10.0"
requires_python = ">=3.6" requires_python = ">=3.6"
summary = "Socket.IO server and client for Python" summary = "Socket.IO server and client for Python"
dependencies = [ dependencies = [
"bidict>=0.21.0", "bidict>=0.21.0",
"python-engineio>=4.7.0", "python-engineio>=4.8.0",
] ]
files = [ files = [
{file = "python-socketio-5.9.0.tar.gz", hash = "sha256:dc42735f65534187f381fde291ebf620216a4960001370f32de940229b2e7f8f"}, {file = "python-socketio-5.10.0.tar.gz", hash = "sha256:01c616946fa9f67ed5cc3d1568e1c4940acfc64aeeb9ff621a53e80cabeb748a"},
{file = "python_socketio-5.9.0-py3-none-any.whl", hash = "sha256:c20f12e4ed0cba57581af26bbeea9998bc2eeebb3b952fa92493a1e051cfe9dc"}, {file = "python_socketio-5.10.0-py3-none-any.whl", hash = "sha256:fb18d9b84cfb05289dc207b790c3de59cd242310d9b980b1c31e9faf4f79101a"},
] ]
[[package]] [[package]]
@@ -1019,7 +1029,7 @@ files = [
[[package]] [[package]]
name = "rich" name = "rich"
version = "13.6.0" version = "13.7.0"
requires_python = ">=3.7.0" requires_python = ">=3.7.0"
summary = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" summary = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal"
dependencies = [ dependencies = [
@@ -1027,8 +1037,8 @@ dependencies = [
"pygments<3.0.0,>=2.13.0", "pygments<3.0.0,>=2.13.0",
] ]
files = [ files = [
{file = "rich-13.6.0-py3-none-any.whl", hash = "sha256:2b38e2fe9ca72c9a00170a1a2d20c63c790d0e10ef1fe35eba76e1e7b1d7d245"}, {file = "rich-13.7.0-py3-none-any.whl", hash = "sha256:6da14c108c4866ee9520bbffa71f6fe3962e193b7da68720583850cd4548e235"},
{file = "rich-13.6.0.tar.gz", hash = "sha256:5c14d22737e6d5084ef4771b62d5d4363165b403455a30a1c8ca39dc7b644bef"}, {file = "rich-13.7.0.tar.gz", hash = "sha256:5cb5123b5cf9ee70584244246816e9114227e0b98ad9176eede6ad54bf5403fa"},
] ]
[[package]] [[package]]

View File

@@ -3,7 +3,7 @@ from enum import Enum
import boto3 import boto3
from mypy_boto3_ec2 import EC2ServiceResource from mypy_boto3_ec2 import EC2ServiceResource
from nicegui import ui from nicegui import app, ui
from nicegui.element import Element from nicegui.element import Element
from rich.console import Console from rich.console import Console
from rich.logging import RichHandler from rich.logging import RichHandler
@@ -68,6 +68,7 @@ def update_instance_table(
if tag["Key"] == "Name": if tag["Key"] == "Name":
name = tag["Value"] name = tag["Value"]
table.add_rows({"name": name, "status": instance.state["Name"]}) table.add_rows({"name": name, "status": instance.state["Name"]})
log.debug("Table updated")
def nicegui_ui() -> None: def nicegui_ui() -> None:
@@ -79,7 +80,9 @@ def nicegui_ui() -> None:
ui.button( ui.button(
"Stop Foundry AWS Server", "Stop Foundry AWS Server",
on_click=lambda: aws_launch_ec2(ec2_resource, mode=InstanceMode.STOP), on_click=lambda: aws_launch_ec2(ec2_resource, mode=InstanceMode.STOP),
) ),
ui.button("Close Program", on_click=lambda: app.shutdown())
columns = [ columns = [
{"name": "name", "label": "Name", "field": "name", "required": True}, {"name": "name", "label": "Name", "field": "name", "required": True},
{"name": "status", "label": "Status", "field": "status"}, {"name": "status", "label": "Status", "field": "status"},
@@ -87,9 +90,16 @@ def nicegui_ui() -> None:
rows = [] rows = []
with ui.element() as container: with ui.element() as container:
ui.table(columns=columns, rows=rows, pagination=10) ui.table(columns=columns, rows=rows, pagination=10)
ui.timer(15, lambda: update_instance_table(ec2_resource, container, columns)) timer = ui.timer(
15, lambda: update_instance_table(ec2_resource, container, columns)
ui.run() )
label = ui.label()
(
ui.slider(min=5, max=120, step=5, value=15)
.bind_value_to(timer, "interval")
.bind_value_to(label, "text")
)
ui.run(reload=False)
def main() -> None: def main() -> None: