Compare commits
29 Commits
2022.6.0
...
2022.10.rc
Author | SHA1 | Date | |
---|---|---|---|
b2ce8a6924 | |||
71efbd1b42 | |||
e36939a108 | |||
721461fc1b | |||
72ee59b2b4 | |||
95159da0fc | |||
330d702347 | |||
cbf669d3bd | |||
7498fe3255 | |||
880998e8ca | |||
ecc9657eaa | |||
125f65cf1b | |||
1cd9c7d669 | |||
5165f31066 | |||
10d33e5d1d | |||
fb35e8b8b2 | |||
4402bcce73 | |||
8839b26f00 | |||
a79358725c | |||
2ab1576230 | |||
c0be380f69 | |||
c0ae0c8389 | |||
4a766e8284 | |||
2772ea8df2 | |||
a604f0e821 | |||
6995b25518 | |||
e4f843829f | |||
39b6ca790c | |||
4c8d7a8031 |
307
.vscode/launch.json
vendored
307
.vscode/launch.json
vendored
@@ -1,307 +0,0 @@
|
|||||||
{
|
|
||||||
// Use IntelliSense to learn about possible attributes.
|
|
||||||
// Hover to view descriptions of existing attributes.
|
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "Python: Aktuelle Datei",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"program": "${file}",
|
|
||||||
"console": "integratedTerminal"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CPL: main test",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}/cpl_core/src/tests/custom/general/src/general",
|
|
||||||
"program": "main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"--customer=sh-edraft.de"
|
|
||||||
],
|
|
||||||
"env": {
|
|
||||||
"CPL_NAME": "CPL_Dev_Test",
|
|
||||||
"PYTHON_ENVIRONMENT": "development"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CPL: console test",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}/src/tests/custom/console",
|
|
||||||
"program": "main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CPL: database test",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}/src/tests/custom/database/src",
|
|
||||||
"program": "main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"env": {
|
|
||||||
"PYTHON_ENVIRONMENT": "development",
|
|
||||||
"PYTHONPATH": "${workspaceFolder}/src/:$PYTHONPATH"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}/",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: add",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}/src/tests/custom/general",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"add",
|
|
||||||
"testing",
|
|
||||||
"general",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: remove",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}/src/tests/custom/general",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"remove",
|
|
||||||
"testing",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: build",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"build"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: generate abc",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"generate",
|
|
||||||
"a",
|
|
||||||
"testName"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: generate class",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"generate",
|
|
||||||
"c",
|
|
||||||
"src/hfs/fsnfiu/fiush/fisbf/testName"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: generate enum",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"generate",
|
|
||||||
"e",
|
|
||||||
"testName"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: generate service",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"generate",
|
|
||||||
"s",
|
|
||||||
"testName"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: generate settings",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"generate",
|
|
||||||
"st",
|
|
||||||
"testName"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: generate thread",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"generate",
|
|
||||||
"t",
|
|
||||||
"testName"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: hello-world",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"hello-world",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: help",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"help",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: install discord.py",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}/src/tests/custom/general",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"install",
|
|
||||||
"discord.py",
|
|
||||||
],
|
|
||||||
"env": {
|
|
||||||
"GISMO_ENVIRONMENT": "development",
|
|
||||||
"PYTHONPATH": "${workspaceFolder}/src/:$PYTHONPATH"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: install local",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}/src/tests/custom/general",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"install",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: new console",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"new",
|
|
||||||
"console",
|
|
||||||
"HelloWorld"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: new library",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"new",
|
|
||||||
"library",
|
|
||||||
"HelloWorldLib"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: publish",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"publish",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: start",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"start",
|
|
||||||
],
|
|
||||||
"env": {
|
|
||||||
"PYTHONPATH": "${workspaceFolder}/src/:${workspaceFolder}/src/cpl_cli/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: uninstall discord.py",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}/src/tests/custom/general",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"uninstall",
|
|
||||||
"discord.py",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: start",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}/src/tests/custom/general",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"update",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CLI: version",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": "${workspaceFolder}/src/cpl_cli/main.py",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"args": [
|
|
||||||
"version",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
23
.vscode/settings.json
vendored
23
.vscode/settings.json
vendored
@@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"workbench.colorCustomizations": {
|
|
||||||
"activityBar.activeBackground": "#93e6fc",
|
|
||||||
"activityBar.activeBorder": "#fa45d4",
|
|
||||||
"activityBar.background": "#93e6fc",
|
|
||||||
"activityBar.foreground": "#15202b",
|
|
||||||
"activityBar.inactiveForeground": "#15202b99",
|
|
||||||
"activityBarBadge.background": "#fa45d4",
|
|
||||||
"activityBarBadge.foreground": "#15202b",
|
|
||||||
"sash.hoverBorder": "#93e6fc",
|
|
||||||
"statusBar.background": "#61dafb",
|
|
||||||
"statusBar.foreground": "#15202b",
|
|
||||||
"statusBarItem.hoverBackground": "#2fcefa",
|
|
||||||
"statusBarItem.remoteBackground": "#61dafb",
|
|
||||||
"statusBarItem.remoteForeground": "#15202b",
|
|
||||||
"titleBar.activeBackground": "#61dafb",
|
|
||||||
"titleBar.activeForeground": "#15202b",
|
|
||||||
"titleBar.inactiveBackground": "#61dafb99",
|
|
||||||
"titleBar.inactiveForeground": "#15202b99"
|
|
||||||
},
|
|
||||||
"peacock.color": "#61dafb",
|
|
||||||
"python.pythonPath": "cpl-env/bin/python3.9",
|
|
||||||
}
|
|
@@ -2,16 +2,19 @@
|
|||||||
"WorkspaceSettings": {
|
"WorkspaceSettings": {
|
||||||
"DefaultProject": "cpl-cli",
|
"DefaultProject": "cpl-cli",
|
||||||
"Projects": {
|
"Projects": {
|
||||||
"cpl-core": "src/cpl_core/cpl-core.json",
|
|
||||||
"cpl-cli": "src/cpl_cli/cpl-cli.json",
|
"cpl-cli": "src/cpl_cli/cpl-cli.json",
|
||||||
|
"cpl-core": "src/cpl_core/cpl-core.json",
|
||||||
|
"cpl-discord": "src/cpl_discord/cpl-discord.json",
|
||||||
"cpl-query": "src/cpl_query/cpl-query.json",
|
"cpl-query": "src/cpl_query/cpl-query.json",
|
||||||
|
"cpl-translation": "src/cpl_translation/cpl-translation.json",
|
||||||
"set-version": "tools/set_version/set-version.json",
|
"set-version": "tools/set_version/set-version.json",
|
||||||
"set-pip-urls": "tools/set_pip_urls/set-pip-urls.json",
|
"set-pip-urls": "tools/set_pip_urls/set-pip-urls.json",
|
||||||
"unittests": "unittests/unittests/unittests.json",
|
"unittests": "unittests/unittests/unittests.json",
|
||||||
"unittests_cli": "unittests/unittests_cli/unittests_cli.json",
|
"unittests_cli": "unittests/unittests_cli/unittests_cli.json",
|
||||||
"unittests_core": "unittests/unittests_core/unittests_core.json",
|
"unittests_core": "unittests/unittests_core/unittests_core.json",
|
||||||
"unittests_query": "unittests/unittests_query/unittests_query.json",
|
"unittests_query": "unittests/unittests_query/unittests_query.json",
|
||||||
"unittests_shared": "unittests/unittests_shared/unittests_shared.json"
|
"unittests_shared": "unittests/unittests_shared/unittests_shared.json",
|
||||||
|
"unittests_translation": "unittests/unittests_translation/unittests_translation.json"
|
||||||
},
|
},
|
||||||
"Scripts": {
|
"Scripts": {
|
||||||
"hello-world": "echo 'Hello World'",
|
"hello-world": "echo 'Hello World'",
|
||||||
@@ -24,72 +27,111 @@
|
|||||||
|
|
||||||
"docs-build": "echo 'Build Documentation'; cd docs/; sphinx-apidoc -o source/ ../src/cpl_core; sphinx-apidoc -o source/ ../src/cpl_query; make clean; make html; rm source/cpl_query.tests.rst;",
|
"docs-build": "echo 'Build Documentation'; cd docs/; sphinx-apidoc -o source/ ../src/cpl_core; sphinx-apidoc -o source/ ../src/cpl_query; make clean; make html; rm source/cpl_query.tests.rst;",
|
||||||
"db": "cpl docs-build",
|
"db": "cpl docs-build",
|
||||||
|
|
||||||
"docs-open": "xdg-open $PWD/docs/build/html/index.html &",
|
"docs-open": "xdg-open $PWD/docs/build/html/index.html &",
|
||||||
"do": "cpl docs-open",
|
"do": "cpl docs-open",
|
||||||
|
|
||||||
"test": "cpl run unittests",
|
"test": "cpl run unittests",
|
||||||
|
|
||||||
"pre-build-all": "cpl sv $ARGS; cpl spu $ARGS;",
|
"pre-build-all": "cpl sv $ARGS; cpl spu $ARGS;",
|
||||||
"build-all": "cpl build-cli; cpl build-core; cpl build-query; cpl build-set-pip-urls; cpl build-set-version",
|
"build-all": "cpl build-cli; cpl build-core; cpl build-discord; cpl build-query; cpl build-translation; cpl build-set-pip-urls; cpl build-set-version",
|
||||||
"ba": "cpl build-all $ARGS",
|
"ba": "cpl build-all $ARGS",
|
||||||
"build-cli": "echo 'Build cpl-cli'; cd ./src/cpl_cli; cpl build; cd ../../;",
|
"build-cli": "echo 'Build cpl-cli'; cd ./src/cpl_cli; cpl build; cd ../../;",
|
||||||
"build-core": "echo 'Build cpl-core'; cd ./src/cpl_core; cpl build; cd ../../;",
|
"build-core": "echo 'Build cpl-core'; cd ./src/cpl_core; cpl build; cd ../../;",
|
||||||
|
"build-discord": "echo 'Build cpl-discord'; cd ./src/cpl_discord; cpl build; cd ../../;",
|
||||||
"build-query": "echo 'Build cpl-query'; cd ./src/cpl_query; cpl build; cd ../../;",
|
"build-query": "echo 'Build cpl-query'; cd ./src/cpl_query; cpl build; cd ../../;",
|
||||||
|
"build-translation": "echo 'Build cpl-translation'; cd ./src/cpl_translation; cpl build; cd ../../;",
|
||||||
"build-set-pip-urls": "echo 'Build set-pip-urls'; cd ./tools/set_pip_urls; cpl build; cd ../../;",
|
"build-set-pip-urls": "echo 'Build set-pip-urls'; cd ./tools/set_pip_urls; cpl build; cd ../../;",
|
||||||
"build-set-version": "echo 'Build set-version'; cd ./tools/set_version; cpl build; cd ../../;",
|
"build-set-version": "echo 'Build set-version'; cd ./tools/set_version; cpl build; cd ../../;",
|
||||||
|
|
||||||
"pre-publish-all": "cpl sv $ARGS; cpl spu $ARGS;",
|
"pre-publish-all": "cpl sv $ARGS; cpl spu $ARGS;",
|
||||||
"publish-all": "cpl publish-cli; cpl publish-core; cpl publish-query;",
|
"publish-all": "cpl publish-cli; cpl publish-core; cpl publish-discord; cpl publish-query; cpl publish-translation;",
|
||||||
"pa": "cpl build-all $ARGS",
|
"pa": "cpl build-all $ARGS",
|
||||||
"publish-cli": "echo 'Publish cpl-cli'; cd ./src/cpl_cli; cpl publish; cd ../../;",
|
"publish-cli": "echo 'Publish cpl-cli'; cd ./src/cpl_cli; cpl publish; cd ../../;",
|
||||||
"publish-core": "echo 'Publish cpl-core'; cd ./src/cpl_core; cpl publish; cd ../../;",
|
"publish-core": "echo 'Publish cpl-core'; cd ./src/cpl_core; cpl publish; cd ../../;",
|
||||||
"publish-query": "echo 'Publish cpl_query'; cd ./src/cpl_query; cpl publish; cd ../../;",
|
"publish-discord": "echo 'Publish cpl-discord'; cd ./src/cpl_discord; cpl publish; cd ../../;",
|
||||||
|
"publish-query": "echo 'Publish cpl-query'; cd ./src/cpl_query; cpl publish; cd ../../;",
|
||||||
|
"publish-translation": "echo 'Publish cpl-translation'; cd ./src/cpl_translation; cpl publish; cd ../../;",
|
||||||
|
|
||||||
"upload-prod-cli": "echo 'PROD Upload cpl-cli'; cpl upl-prod-cli;",
|
"upload-prod-cli": "echo 'PROD Upload cpl-cli'; cpl upl-prod-cli;",
|
||||||
"upl-prod-cli": "twine upload -r pip.sh-edraft.de dist/cpl-cli/publish/setup/*",
|
"upl-prod-cli": "twine upload -r pip.sh-edraft.de dist/cpl-cli/publish/setup/*",
|
||||||
|
|
||||||
"upload-prod-core": "echo 'PROD Upload cpl-core'; cpl upl-prod-core;",
|
"upload-prod-core": "echo 'PROD Upload cpl-core'; cpl upl-prod-core;",
|
||||||
"upl-prod-core": "twine upload -r pip.sh-edraft.de dist/cpl-core/publish/setup/*",
|
"upl-prod-core": "twine upload -r pip.sh-edraft.de dist/cpl-core/publish/setup/*",
|
||||||
"upload-prod-query": "echo 'PROD Upload cpl_query'; cpl upl-prod-query;",
|
|
||||||
|
"upload-prod-discord": "echo 'PROD Upload cpl-discord'; cpl upl-prod-discord;",
|
||||||
|
"upl-prod-discord": "twine upload -r pip.sh-edraft.de dist/cpl-discord/publish/setup/*",
|
||||||
|
|
||||||
|
"upload-prod-query": "echo 'PROD Upload cpl-query'; cpl upl-prod-query;",
|
||||||
"upl-prod-query": "twine upload -r pip.sh-edraft.de dist/cpl-query/publish/setup/*",
|
"upl-prod-query": "twine upload -r pip.sh-edraft.de dist/cpl-query/publish/setup/*",
|
||||||
|
|
||||||
|
"upload-prod-translation": "echo 'PROD Upload cpl-translation'; cpl upl-prod-translation;",
|
||||||
|
"upl-prod-translation": "twine upload -r pip.sh-edraft.de dist/cpl-translation/publish/setup/*",
|
||||||
|
|
||||||
"upload-exp-cli": "echo 'EXP Upload cpl-cli'; cpl upl-exp-cli;",
|
"upload-exp-cli": "echo 'EXP Upload cpl-cli'; cpl upl-exp-cli;",
|
||||||
"upl-exp-cli": "twine upload -r pip-exp.sh-edraft.de dist/cpl-cli/publish/setup/*",
|
"upl-exp-cli": "twine upload -r pip-exp.sh-edraft.de dist/cpl-cli/publish/setup/*",
|
||||||
|
|
||||||
"upload-exp-core": "echo 'EXP Upload cpl-core'; cpl upl-exp-core;",
|
"upload-exp-core": "echo 'EXP Upload cpl-core'; cpl upl-exp-core;",
|
||||||
"upl-exp-core": "twine upload -r pip-exp.sh-edraft.de dist/cpl-core/publish/setup/*",
|
"upl-exp-core": "twine upload -r pip-exp.sh-edraft.de dist/cpl-core/publish/setup/*",
|
||||||
"upload-exp-query": "echo 'EXP Upload cpl_query'; cpl upl-exp-query;",
|
|
||||||
|
"upload-exp-discord": "echo 'EXP Upload cpl-discord'; cpl upl-exp-discord;",
|
||||||
|
"upl-exp-discord": "twine upload -r pip-exp.sh-edraft.de dist/cpl-discord/publish/setup/*",
|
||||||
|
|
||||||
|
"upload-exp-query": "echo 'EXP Upload cpl-query'; cpl upl-exp-query;",
|
||||||
"upl-exp-query": "twine upload -r pip-exp.sh-edraft.de dist/cpl-query/publish/setup/*",
|
"upl-exp-query": "twine upload -r pip-exp.sh-edraft.de dist/cpl-query/publish/setup/*",
|
||||||
|
|
||||||
|
"upload-exp-translation": "echo 'EXP Upload cpl-translation'; cpl upl-exp-translation;",
|
||||||
|
"upl-exp-translation": "twine upload -r pip-exp.sh-edraft.de dist/cpl-translation/publish/setup/*",
|
||||||
|
|
||||||
"upload-dev-cli": "echo 'DEV Upload cpl-cli'; cpl upl-dev-cli;",
|
"upload-dev-cli": "echo 'DEV Upload cpl-cli'; cpl upl-dev-cli;",
|
||||||
"upl-dev-cli": "twine upload -r pip-dev.sh-edraft.de dist/cpl-cli/publish/setup/*",
|
"upl-dev-cli": "twine upload -r pip-dev.sh-edraft.de dist/cpl-cli/publish/setup/*",
|
||||||
|
|
||||||
"upload-dev-core": "echo 'DEV Upload cpl-core'; cpl upl-dev-core;",
|
"upload-dev-core": "echo 'DEV Upload cpl-core'; cpl upl-dev-core;",
|
||||||
"upl-dev-core": "twine upload -r pip-dev.sh-edraft.de dist/cpl-core/publish/setup/*",
|
"upl-dev-core": "twine upload -r pip-dev.sh-edraft.de dist/cpl-core/publish/setup/*",
|
||||||
"upload-dev-query": "echo 'DEV Upload cpl_query'; cpl upl-dev-query;",
|
|
||||||
|
"upload-dev-discord": "echo 'DEV Upload cpl-discord'; cpl upl-dev-discord;",
|
||||||
|
"upl-dev-discord": "twine upload -r pip-dev.sh-edraft.de dist/cpl-discord/publish/setup/*",
|
||||||
|
|
||||||
|
"upload-dev-query": "echo 'DEV Upload cpl-query'; cpl upl-dev-query;",
|
||||||
"upl-dev-query": "twine upload -r pip-dev.sh-edraft.de dist/cpl-query/publish/setup/*",
|
"upl-dev-query": "twine upload -r pip-dev.sh-edraft.de dist/cpl-query/publish/setup/*",
|
||||||
|
|
||||||
|
"upload-dev-translation": "echo 'DEV Upload cpl-translation'; cpl upl-dev-translation;",
|
||||||
|
"upl-dev-translation": "twine upload -r pip-dev.sh-edraft.de dist/cpl-translation/publish/setup/*",
|
||||||
|
|
||||||
"pre-deploy-prod": "cpl sv $ARGS; cpl spu --environment=production;",
|
"pre-deploy-prod": "cpl sv $ARGS; cpl spu --environment=production;",
|
||||||
"deploy-prod": "cpl deploy-prod-cli; cpl deploy-prod-core; cpl deploy-prod-query;",
|
"deploy-prod": "cpl deploy-prod-cli; cpl deploy-prod-core; cpl deploy-prod-discord; cpl deploy-prod-query; cpl deploy-prod-translation;",
|
||||||
"dp": "cpl deploy-prod $ARGS",
|
"dp": "cpl deploy-prod $ARGS",
|
||||||
"deploy-prod-cli": "cpl publish-cli; cpl upload-prod-cli",
|
"deploy-prod-cli": "cpl publish-cli; cpl upload-prod-cli",
|
||||||
"deploy-prod-core": "cpl publish-core; cpl upload-prod-core",
|
"deploy-prod-core": "cpl publish-core; cpl upload-prod-core",
|
||||||
"deploy-prod-query": "cpl publish-query; cpl upload-prod-query",
|
"deploy-prod-query": "cpl publish-query; cpl upload-prod-query",
|
||||||
|
"deploy-prod-discord": "cpl publish-discord; cpl upload-prod-discord",
|
||||||
|
"deploy-prod-translation": "cpl publish-translation; cpl upload-prod-translation",
|
||||||
|
|
||||||
"pre-deploy-exp": "cpl sv $ARGS; cpl spu --environment=staging;",
|
"pre-deploy-exp": "cpl sv $ARGS; cpl spu --environment=staging;",
|
||||||
"deploy-exp": "cpl deploy-exp-cli; cpl deploy-exp-core; cpl deploy-exp-query;",
|
"deploy-exp": "cpl deploy-exp-cli; cpl deploy-exp-core; cpl deploy-exp-discord; cpl deploy-exp-query; cpl deploy-exp-translation;",
|
||||||
"de": "cpl deploy-exp $ARGS",
|
"de": "cpl deploy-exp $ARGS",
|
||||||
"deploy-exp-cli": "cpl publish-cli; cpl upload-exp-cli",
|
"deploy-exp-cli": "cpl publish-cli; cpl upload-exp-cli",
|
||||||
"deploy-exp-core": "cpl publish-core; cpl upload-exp-core",
|
"deploy-exp-core": "cpl publish-core; cpl upload-exp-core",
|
||||||
|
"deploy-exp-discord": "cpl publish-discord; cpl upload-exp-discord",
|
||||||
"deploy-exp-query": "cpl publish-query; cpl upload-exp-query",
|
"deploy-exp-query": "cpl publish-query; cpl upload-exp-query",
|
||||||
|
"deploy-exp-translation": "cpl publish-translation; cpl upload-exp-translation",
|
||||||
|
|
||||||
"pre-deploy-dev": "cpl sv $ARGS; cpl spu --environment=development;",
|
"pre-deploy-dev": "cpl sv $ARGS; cpl spu --environment=development;",
|
||||||
"deploy-dev": "cpl deploy-dev-cli; cpl deploy-dev-core; cpl deploy-dev-query;",
|
"deploy-dev": "cpl deploy-dev-cli; cpl deploy-dev-core; cpl deploy-dev-discord; cpl deploy-dev-query; cpl deploy-dev-translation;",
|
||||||
"dd": "cpl deploy-dev $ARGS",
|
"dd": "cpl deploy-dev $ARGS",
|
||||||
"deploy-dev-cli": "cpl publish-cli; cpl upload-dev-cli",
|
"deploy-dev-cli": "cpl publish-cli; cpl upload-dev-cli",
|
||||||
"deploy-dev-core": "cpl publish-core; cpl upload-dev-core",
|
"deploy-dev-core": "cpl publish-core; cpl upload-dev-core",
|
||||||
|
"deploy-dev-discord": "cpl publish-discord; cpl upload-dev-discord",
|
||||||
"deploy-dev-query": "cpl publish-query; cpl upload-dev-query",
|
"deploy-dev-query": "cpl publish-query; cpl upload-dev-query",
|
||||||
|
"deploy-dev-translation": "cpl publish-query; cpl upload-dev-translation",
|
||||||
|
|
||||||
"dev-install": "cpl di-core; cpl di-cli; cpl di-query;",
|
"dev-install": "cpl di-core; cpl di-cli; cpl di-query; cpl di-translation;",
|
||||||
"di": "cpl dev-install",
|
"di": "cpl dev-install",
|
||||||
"di-core": "pip install cpl-core --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de",
|
"di-core": "pip install cpl-core --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de",
|
||||||
"di-cli": "pip install cpl-cli --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de",
|
"di-cli": "pip install cpl-cli --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de",
|
||||||
"di-query": "pip install cpl-query --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de"
|
"di-discord": "pip install cpl-discord --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de",
|
||||||
|
"di-query": "pip install cpl-query --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de",
|
||||||
|
"di-translation": "pip install cpl-translation --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -15,10 +15,11 @@ __title__ = 'cpl_cli'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .cli import CLI
|
from .cli import CLI
|
||||||
from .command_abc import CommandABC
|
from .command_abc import CommandABC
|
||||||
@@ -27,4 +28,4 @@ from .main import main
|
|||||||
from .startup import Startup
|
from .startup import Startup
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.build'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -27,6 +27,7 @@ class InitTemplate:
|
|||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
$Imports
|
$Imports
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.generate'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -35,7 +35,7 @@ class ConfigModelTemplate(TemplateFileABC):
|
|||||||
try:
|
try:
|
||||||
self._atr = settings['atr']
|
self._atr = settings['atr']
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings')
|
Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {type(self).__name__} settings')
|
||||||
Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.new'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.new.console'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.new.console.source'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.new.console.source.name'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -33,8 +33,7 @@ class MainWithApplicationHostAndStartupTemplate(TemplateFileABC):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
ml = asyncio.get_event_loop()
|
asyncio.run(main())
|
||||||
ml.run_until_complete(main())
|
|
||||||
""")
|
""")
|
||||||
else:
|
else:
|
||||||
self._value = textwrap.dedent(f"""\
|
self._value = textwrap.dedent(f"""\
|
||||||
@@ -94,8 +93,7 @@ class MainWithApplicationBaseTemplate(TemplateFileABC):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
ml = asyncio.get_event_loop()
|
asyncio.run(main())
|
||||||
ml.run_until_complete(main())
|
|
||||||
""")
|
""")
|
||||||
else:
|
else:
|
||||||
self._value = textwrap.dedent(f"""\
|
self._value = textwrap.dedent(f"""\
|
||||||
@@ -149,8 +147,7 @@ class MainWithoutApplicationBaseTemplate(TemplateFileABC):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
ml = asyncio.get_event_loop()
|
asyncio.run(main())
|
||||||
ml.run_until_complete(main())
|
|
||||||
""")
|
""")
|
||||||
else:
|
else:
|
||||||
self._value = textwrap.dedent("""\
|
self._value = textwrap.dedent("""\
|
||||||
@@ -215,8 +212,7 @@ class MainWithDependencyInjection(TemplateFileABC):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
ml = asyncio.get_event_loop()
|
asyncio.run(main())
|
||||||
ml.run_until_complete(main())
|
|
||||||
""")
|
""")
|
||||||
else:
|
else:
|
||||||
self._value = textwrap.dedent("""\
|
self._value = textwrap.dedent("""\
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.new.console.source.tests'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.new.library'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.new.library.source'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.new.library.source.name'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -33,8 +33,7 @@ class MainWithApplicationHostAndStartupTemplate(TemplateFileABC):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
ml = asyncio.get_event_loop()
|
asyncio.run(main())
|
||||||
ml.run_until_complete(main())
|
|
||||||
""")
|
""")
|
||||||
else:
|
else:
|
||||||
self._value = textwrap.dedent(f"""\
|
self._value = textwrap.dedent(f"""\
|
||||||
@@ -95,8 +94,7 @@ class MainWithApplicationBaseTemplate(TemplateFileABC):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
ml = asyncio.get_event_loop()
|
asyncio.run(main())
|
||||||
ml.run_until_complete(main())
|
|
||||||
""")
|
""")
|
||||||
else:
|
else:
|
||||||
self._value = textwrap.dedent(f"""\
|
self._value = textwrap.dedent(f"""\
|
||||||
@@ -147,8 +145,7 @@ class MainWithoutApplicationBaseTemplate(TemplateFileABC):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
ml = asyncio.get_event_loop()
|
asyncio.run(main())
|
||||||
ml.run_until_complete(main())
|
|
||||||
""")
|
""")
|
||||||
else:
|
else:
|
||||||
self._value = textwrap.dedent("""\
|
self._value = textwrap.dedent("""\
|
||||||
@@ -210,8 +207,7 @@ class MainWithDependencyInjection(TemplateFileABC):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
ml = asyncio.get_event_loop()
|
asyncio.run(main())
|
||||||
ml.run_until_complete(main())
|
|
||||||
""")
|
""")
|
||||||
else:
|
else:
|
||||||
self._value = textwrap.dedent("""\
|
self._value = textwrap.dedent("""\
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.new.library.source.tests'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.new.unittest'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.new.unittest.source'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.new.unittest.source.name'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -31,8 +31,7 @@ class MainWithApplicationBaseTemplate(TemplateFileABC):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
ml = asyncio.get_event_loop()
|
asyncio.run(main())
|
||||||
ml.run_until_complete(main())
|
|
||||||
""")
|
""")
|
||||||
else:
|
else:
|
||||||
self._value = textwrap.dedent(f"""\
|
self._value = textwrap.dedent(f"""\
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli._templates.publish'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -21,5 +21,5 @@ class CLISettings(ConfigurationModelABC):
|
|||||||
try:
|
try:
|
||||||
self._pip_path = settings[CLISettingsNameEnum.pip_path.value]
|
self._pip_path = settings[CLISettingsNameEnum.pip_path.value]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings')
|
Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {type(self).__name__} settings')
|
||||||
Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
||||||
|
@@ -15,10 +15,11 @@ __title__ = 'cpl_cli.command'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .build_service import BuildService
|
from .build_service import BuildService
|
||||||
from .generate_service import GenerateService
|
from .generate_service import GenerateService
|
||||||
@@ -28,4 +29,4 @@ from .publish_service import PublishService
|
|||||||
from .version_service import VersionService
|
from .version_service import VersionService
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -68,6 +68,7 @@ class NewService(CommandABC):
|
|||||||
Types:
|
Types:
|
||||||
console
|
console
|
||||||
library
|
library
|
||||||
|
unittest
|
||||||
""")
|
""")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -82,6 +83,7 @@ class NewService(CommandABC):
|
|||||||
schematics = [
|
schematics = [
|
||||||
'console (c|C) <name>',
|
'console (c|C) <name>',
|
||||||
'library (l|L) <name>',
|
'library (l|L) <name>',
|
||||||
|
'unittest (ut|UT) <name>',
|
||||||
]
|
]
|
||||||
Console.write_line('Available Schematics:')
|
Console.write_line('Available Schematics:')
|
||||||
for name in schematics:
|
for name in schematics:
|
||||||
|
@@ -15,10 +15,11 @@ __title__ = 'cpl_cli.configuration'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .build_settings import BuildSettings
|
from .build_settings import BuildSettings
|
||||||
from .build_settings_name_enum import BuildSettingsNameEnum
|
from .build_settings_name_enum import BuildSettingsNameEnum
|
||||||
@@ -30,4 +31,4 @@ from .workspace_settings import WorkspaceSettings
|
|||||||
from .workspace_settings_name_enum import WorkspaceSettingsNameEnum
|
from .workspace_settings_name_enum import WorkspaceSettingsNameEnum
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -37,5 +37,5 @@ class WorkspaceSettings(ConfigurationModelABC):
|
|||||||
else:
|
else:
|
||||||
self._scripts = {}
|
self._scripts = {}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings')
|
Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {type(self).__name__} settings')
|
||||||
Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
||||||
|
@@ -3,8 +3,8 @@
|
|||||||
"Name": "cpl-cli",
|
"Name": "cpl-cli",
|
||||||
"Version": {
|
"Version": {
|
||||||
"Major": "2022",
|
"Major": "2022",
|
||||||
"Minor": "6",
|
"Minor": "7",
|
||||||
"Micro": "0"
|
"Micro": "0.post2"
|
||||||
},
|
},
|
||||||
"Author": "Sven Heidemann",
|
"Author": "Sven Heidemann",
|
||||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
"LicenseName": "MIT",
|
"LicenseName": "MIT",
|
||||||
"LicenseDescription": "MIT, see LICENSE for more details.",
|
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||||
"Dependencies": [
|
"Dependencies": [
|
||||||
"cpl-core>=2022.6.0"
|
"cpl-core>=2022.7.0.post2"
|
||||||
],
|
],
|
||||||
"DevDependencies": [],
|
"DevDependencies": [],
|
||||||
"PythonVersion": ">=3.10",
|
"PythonVersion": ">=3.10",
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli.live_server'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -15,13 +15,14 @@ __title__ = 'cpl_cli.publish'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .publisher_abc import PublisherABC
|
from .publisher_abc import PublisherABC
|
||||||
from .publisher_service import PublisherService
|
from .publisher_service import PublisherService
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -227,11 +227,19 @@ class PublisherService(PublisherABC):
|
|||||||
imports = '# imports:'
|
imports = '# imports:'
|
||||||
else:
|
else:
|
||||||
is_started = False
|
is_started = False
|
||||||
|
build_ignore = False
|
||||||
for line in module_file_lines:
|
for line in module_file_lines:
|
||||||
if line.__contains__('# imports'):
|
if line.__contains__('# imports'):
|
||||||
is_started = True
|
is_started = True
|
||||||
|
|
||||||
if ((line.__contains__('from') or line.__contains__('import')) and is_started) or line.startswith('__cli_startup_extension__'):
|
if line.__contains__('# build-ignore'):
|
||||||
|
build_ignore = True
|
||||||
|
|
||||||
|
if line.__contains__('# build-ignore-end') and is_started:
|
||||||
|
module_py_lines.append('# build-ignore-end'.replace('\n', ''))
|
||||||
|
build_ignore = False
|
||||||
|
|
||||||
|
if ((line.__contains__('from') or line.__contains__('import')) and is_started) or line.startswith('__cli_startup_extension__') or build_ignore:
|
||||||
module_py_lines.append(line.replace('\n', ''))
|
module_py_lines.append(line.replace('\n', ''))
|
||||||
|
|
||||||
if len(module_py_lines) > 0:
|
if len(module_py_lines) > 0:
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli.source_creator'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_cli.validators'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post2'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post2')
|
||||||
|
@@ -15,11 +15,12 @@ __title__ = 'cpl_core'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post5'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post5')
|
||||||
|
@@ -15,10 +15,11 @@ __title__ = 'cpl_core.application'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post5'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .application_abc import ApplicationABC
|
from .application_abc import ApplicationABC
|
||||||
from .application_builder import ApplicationBuilder
|
from .application_builder import ApplicationBuilder
|
||||||
@@ -28,4 +29,4 @@ from .startup_abc import StartupABC
|
|||||||
from .startup_extension_abc import StartupExtensionABC
|
from .startup_extension_abc import StartupExtensionABC
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post5')
|
||||||
|
@@ -15,10 +15,11 @@ __title__ = 'cpl_core.configuration'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post5'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .argument_abc import ArgumentABC
|
from .argument_abc import ArgumentABC
|
||||||
from .argument_builder import ArgumentBuilder
|
from .argument_builder import ArgumentBuilder
|
||||||
@@ -34,4 +35,4 @@ from .validator_abc import ValidatorABC
|
|||||||
from .variable_argument import VariableArgument
|
from .variable_argument import VariableArgument
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post5')
|
||||||
|
@@ -15,10 +15,11 @@ __title__ = 'cpl_core.console'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post5'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .background_color_enum import BackgroundColorEnum
|
from .background_color_enum import BackgroundColorEnum
|
||||||
from .console import Console
|
from .console import Console
|
||||||
@@ -27,4 +28,4 @@ from .foreground_color_enum import ForegroundColorEnum
|
|||||||
from .spinner_thread import SpinnerThread
|
from .spinner_thread import SpinnerThread
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post5')
|
||||||
|
@@ -6,8 +6,6 @@ from typing import Union, Optional
|
|||||||
|
|
||||||
from art import text2art
|
from art import text2art
|
||||||
import colorama
|
import colorama
|
||||||
from pynput import keyboard
|
|
||||||
from pynput.keyboard import Key
|
|
||||||
from tabulate import tabulate
|
from tabulate import tabulate
|
||||||
from termcolor import colored
|
from termcolor import colored
|
||||||
|
|
||||||
@@ -173,7 +171,7 @@ class Console:
|
|||||||
Console.write_line()
|
Console.write_line()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _select_menu_key_press(cls, key: Key):
|
def _select_menu_key_press(cls, key):
|
||||||
r"""Event function when key press is detected
|
r"""Event function when key press is detected
|
||||||
|
|
||||||
Parameter
|
Parameter
|
||||||
@@ -181,6 +179,7 @@ class Console:
|
|||||||
key: :class:`pynput.keyboard.Key`
|
key: :class:`pynput.keyboard.Key`
|
||||||
Pressed key
|
Pressed key
|
||||||
"""
|
"""
|
||||||
|
from pynput.keyboard import Key
|
||||||
if key == Key.down:
|
if key == Key.down:
|
||||||
if cls._selected_menu_item_index == len(cls._select_menu_items) - 1:
|
if cls._selected_menu_item_index == len(cls._select_menu_items) - 1:
|
||||||
return
|
return
|
||||||
@@ -400,6 +399,7 @@ class Console:
|
|||||||
Console.write_line(message, '\n')
|
Console.write_line(message, '\n')
|
||||||
cls._show_select_menu()
|
cls._show_select_menu()
|
||||||
|
|
||||||
|
from pynput import keyboard
|
||||||
with keyboard.Listener(
|
with keyboard.Listener(
|
||||||
on_press=cls._select_menu_key_press, suppress=False
|
on_press=cls._select_menu_key_press, suppress=False
|
||||||
) as listener:
|
) as listener:
|
||||||
|
@@ -3,8 +3,8 @@
|
|||||||
"Name": "cpl-core",
|
"Name": "cpl-core",
|
||||||
"Version": {
|
"Version": {
|
||||||
"Major": "2022",
|
"Major": "2022",
|
||||||
"Minor": "6",
|
"Minor": "7",
|
||||||
"Micro": "0"
|
"Micro": "0.post5"
|
||||||
},
|
},
|
||||||
"Author": "Sven Heidemann",
|
"Author": "Sven Heidemann",
|
||||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||||
|
@@ -15,14 +15,15 @@ __title__ = 'cpl_core.database'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post5'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .database_settings_name_enum import DatabaseSettingsNameEnum
|
from .database_settings_name_enum import DatabaseSettingsNameEnum
|
||||||
from .database_settings import DatabaseSettings
|
from .database_settings import DatabaseSettings
|
||||||
from .table_abc import TableABC
|
from .table_abc import TableABC
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post5')
|
||||||
|
@@ -15,13 +15,14 @@ __title__ = 'cpl_core.database.connection'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post5'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .database_connection import DatabaseConnection
|
from .database_connection import DatabaseConnection
|
||||||
from .database_connection_abc import DatabaseConnectionABC
|
from .database_connection_abc import DatabaseConnectionABC
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post5')
|
||||||
|
@@ -30,6 +30,7 @@ class DatabaseConnection(DatabaseConnectionABC):
|
|||||||
def connect(self, database_settings: DatabaseSettings):
|
def connect(self, database_settings: DatabaseSettings):
|
||||||
connection = sql.connect(
|
connection = sql.connect(
|
||||||
host=database_settings.host,
|
host=database_settings.host,
|
||||||
|
port=database_settings.port,
|
||||||
user=database_settings.user,
|
user=database_settings.user,
|
||||||
passwd=CredentialManager.decrypt(database_settings.password),
|
passwd=CredentialManager.decrypt(database_settings.password),
|
||||||
charset=database_settings.charset,
|
charset=database_settings.charset,
|
||||||
@@ -41,6 +42,7 @@ class DatabaseConnection(DatabaseConnectionABC):
|
|||||||
f'CREATE DATABASE IF NOT EXISTS `{database_settings.database}`;')
|
f'CREATE DATABASE IF NOT EXISTS `{database_settings.database}`;')
|
||||||
self._database = sql.connect(
|
self._database = sql.connect(
|
||||||
host=database_settings.host,
|
host=database_settings.host,
|
||||||
|
port=database_settings.port,
|
||||||
user=database_settings.user,
|
user=database_settings.user,
|
||||||
passwd=CredentialManager.decrypt(database_settings.password),
|
passwd=CredentialManager.decrypt(database_settings.password),
|
||||||
db=database_settings.database,
|
db=database_settings.database,
|
||||||
|
@@ -15,13 +15,14 @@ __title__ = 'cpl_core.database.context'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post5'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .database_context import DatabaseContext
|
from .database_context import DatabaseContext
|
||||||
from .database_context_abc import DatabaseContextABC
|
from .database_context_abc import DatabaseContextABC
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post5')
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
import mysql
|
||||||
|
|
||||||
from cpl_core.database.connection.database_connection import DatabaseConnection
|
from cpl_core.database.connection.database_connection import DatabaseConnection
|
||||||
from cpl_core.database.connection.database_connection_abc import \
|
from cpl_core.database.connection.database_connection_abc import \
|
||||||
DatabaseConnectionABC
|
DatabaseConnectionABC
|
||||||
@@ -23,12 +25,25 @@ class DatabaseContext(DatabaseContextABC):
|
|||||||
|
|
||||||
self._db: DatabaseConnectionABC = DatabaseConnection()
|
self._db: DatabaseConnectionABC = DatabaseConnection()
|
||||||
self._tables: list[TableABC] = TableABC.__subclasses__()
|
self._tables: list[TableABC] = TableABC.__subclasses__()
|
||||||
|
self._settings: Optional[DatabaseSettings] = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cursor(self) -> MySQLCursorBuffered:
|
def cursor(self) -> MySQLCursorBuffered:
|
||||||
|
self._ping_and_reconnect()
|
||||||
return self._db.cursor
|
return self._db.cursor
|
||||||
|
|
||||||
|
def _ping_and_reconnect(self):
|
||||||
|
try:
|
||||||
|
self._db.server.ping(reconnect=True, attempts=3, delay=5)
|
||||||
|
except mysql.connector.Error as err:
|
||||||
|
# reconnect your cursor as you did in __init__ or wherever
|
||||||
|
if self._settings is None:
|
||||||
|
raise Exception('Call DatabaseContext.connect first')
|
||||||
|
self.connect(self._settings)
|
||||||
|
|
||||||
def connect(self, database_settings: DatabaseSettings):
|
def connect(self, database_settings: DatabaseSettings):
|
||||||
|
if self._settings is None:
|
||||||
|
self._settings = database_settings
|
||||||
self._db.connect(database_settings)
|
self._db.connect(database_settings)
|
||||||
for table in self._tables:
|
for table in self._tables:
|
||||||
self._db.cursor.execute(table.get_create_string())
|
self._db.cursor.execute(table.get_create_string())
|
||||||
@@ -36,8 +51,10 @@ class DatabaseContext(DatabaseContextABC):
|
|||||||
self.save_changes()
|
self.save_changes()
|
||||||
|
|
||||||
def save_changes(self):
|
def save_changes(self):
|
||||||
|
self._ping_and_reconnect()
|
||||||
self._db.server.commit()
|
self._db.server.commit()
|
||||||
|
|
||||||
def select(self, statement: str) -> list[tuple]:
|
def select(self, statement: str) -> list[tuple]:
|
||||||
|
self._ping_and_reconnect()
|
||||||
self._db.cursor.execute(statement)
|
self._db.cursor.execute(statement)
|
||||||
return self._db.cursor.fetchall()
|
return self._db.cursor.fetchall()
|
||||||
|
@@ -12,8 +12,8 @@ class DatabaseContextABC(ABC):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cursor(self) -> MySQLCursorBuffered:
|
@abstractmethod
|
||||||
return self._cursor
|
def cursor(self) -> MySQLCursorBuffered: pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def connect(self, database_settings: DatabaseSettings):
|
def connect(self, database_settings: DatabaseSettings):
|
||||||
|
@@ -14,6 +14,7 @@ class DatabaseSettings(ConfigurationModelABC):
|
|||||||
ConfigurationModelABC.__init__(self)
|
ConfigurationModelABC.__init__(self)
|
||||||
|
|
||||||
self._host: Optional[str] = None
|
self._host: Optional[str] = None
|
||||||
|
self._port: Optional[int] = None
|
||||||
self._user: Optional[str] = None
|
self._user: Optional[str] = None
|
||||||
self._password: Optional[str] = None
|
self._password: Optional[str] = None
|
||||||
self._databse: Optional[str] = None
|
self._databse: Optional[str] = None
|
||||||
@@ -26,6 +27,10 @@ class DatabaseSettings(ConfigurationModelABC):
|
|||||||
def host(self) -> Optional[str]:
|
def host(self) -> Optional[str]:
|
||||||
return self._host
|
return self._host
|
||||||
|
|
||||||
|
@property
|
||||||
|
def port(self) -> Optional[int]:
|
||||||
|
return self._port
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def user(self) -> Optional[str]:
|
def user(self) -> Optional[str]:
|
||||||
return self._user
|
return self._user
|
||||||
@@ -63,6 +68,10 @@ class DatabaseSettings(ConfigurationModelABC):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
self._host = settings[DatabaseSettingsNameEnum.host.value]
|
self._host = settings[DatabaseSettingsNameEnum.host.value]
|
||||||
|
if DatabaseSettingsNameEnum.port.value in settings:
|
||||||
|
self._port = settings[DatabaseSettingsNameEnum.port.value]
|
||||||
|
else:
|
||||||
|
self._port = 3306
|
||||||
self._user = settings[DatabaseSettingsNameEnum.user.value]
|
self._user = settings[DatabaseSettingsNameEnum.user.value]
|
||||||
self._password = settings[DatabaseSettingsNameEnum.password.value]
|
self._password = settings[DatabaseSettingsNameEnum.password.value]
|
||||||
self._databse = settings[DatabaseSettingsNameEnum.database.value]
|
self._databse = settings[DatabaseSettingsNameEnum.database.value]
|
||||||
@@ -80,6 +89,6 @@ class DatabaseSettings(ConfigurationModelABC):
|
|||||||
self._auth_plugin = settings[DatabaseSettingsNameEnum.auth_plugin.value]
|
self._auth_plugin = settings[DatabaseSettingsNameEnum.auth_plugin.value]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Console.set_foreground_color(ForegroundColorEnum.red)
|
Console.set_foreground_color(ForegroundColorEnum.red)
|
||||||
Console.write_line(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings')
|
Console.write_line(f'[ ERROR ] [ {__name__} ]: Reading error in {type(self).__name__} settings')
|
||||||
Console.write_line(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
Console.write_line(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
||||||
Console.set_foreground_color(ForegroundColorEnum.default)
|
Console.set_foreground_color(ForegroundColorEnum.default)
|
||||||
|
@@ -4,6 +4,7 @@ from enum import Enum
|
|||||||
class DatabaseSettingsNameEnum(Enum):
|
class DatabaseSettingsNameEnum(Enum):
|
||||||
|
|
||||||
host = 'Host'
|
host = 'Host'
|
||||||
|
port = 'Port'
|
||||||
user = 'User'
|
user = 'User'
|
||||||
password = 'Password'
|
password = 'Password'
|
||||||
database = 'Database'
|
database = 'Database'
|
||||||
|
@@ -15,10 +15,11 @@ __title__ = 'cpl_core.dependency_injection'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post5'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .scope import Scope
|
from .scope import Scope
|
||||||
from .scope_abc import ScopeABC
|
from .scope_abc import ScopeABC
|
||||||
@@ -30,4 +31,4 @@ from .service_provider import ServiceProvider
|
|||||||
from .service_provider_abc import ServiceProviderABC
|
from .service_provider_abc import ServiceProviderABC
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post5')
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
from typing import Union, Type, Callable, Optional
|
from typing import Union, Type, Callable, Optional
|
||||||
|
|
||||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||||
from cpl_core.console import Console
|
|
||||||
from cpl_core.database.context.database_context_abc import DatabaseContextABC
|
from cpl_core.database.context.database_context_abc import DatabaseContextABC
|
||||||
from cpl_core.database.database_settings import DatabaseSettings
|
from cpl_core.database.database_settings import DatabaseSettings
|
||||||
from cpl_core.dependency_injection.service_collection_abc import ServiceCollectionABC
|
from cpl_core.dependency_injection.service_collection_abc import ServiceCollectionABC
|
||||||
|
@@ -35,6 +35,16 @@ class ServiceCollectionABC(ABC):
|
|||||||
r"""Adds the CPL internal pipes as transient"""
|
r"""Adds the CPL internal pipes as transient"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def add_discord(self):
|
||||||
|
r"""Adds the CPL discord"""
|
||||||
|
raise NotImplementedError('You should install and use the cpl-discord package')
|
||||||
|
pass
|
||||||
|
|
||||||
|
def add_translation(self):
|
||||||
|
r"""Adds the CPL translation"""
|
||||||
|
raise NotImplementedError('You should install and use the cpl-translation package')
|
||||||
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def add_transient(self, service_type: Type, service: Callable = None) -> 'ServiceCollectionABC':
|
def add_transient(self, service_type: Type, service: Callable = None) -> 'ServiceCollectionABC':
|
||||||
r"""Adds a service with transient lifetime
|
r"""Adds a service with transient lifetime
|
||||||
|
@@ -15,14 +15,15 @@ __title__ = 'cpl_core.environment'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post5'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .application_environment_abc import ApplicationEnvironmentABC
|
from .application_environment_abc import ApplicationEnvironmentABC
|
||||||
from .environment_name_enum import EnvironmentNameEnum
|
from .environment_name_enum import EnvironmentNameEnum
|
||||||
from .application_environment import ApplicationEnvironment
|
from .application_environment import ApplicationEnvironment
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post5')
|
||||||
|
@@ -15,10 +15,11 @@ __title__ = 'cpl_core.logging'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post5'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .logger_service import Logger
|
from .logger_service import Logger
|
||||||
from .logger_abc import LoggerABC
|
from .logger_abc import LoggerABC
|
||||||
@@ -27,4 +28,4 @@ from .logging_settings import LoggingSettings
|
|||||||
from .logging_settings_name_enum import LoggingSettingsNameEnum
|
from .logging_settings_name_enum import LoggingSettingsNameEnum
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post5')
|
||||||
|
@@ -58,6 +58,6 @@ class LoggingSettings(ConfigurationModelABC):
|
|||||||
self._level = LoggingLevelEnum[settings[LoggingSettingsNameEnum.file_level.value]]
|
self._level = LoggingLevelEnum[settings[LoggingSettingsNameEnum.file_level.value]]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Console.set_foreground_color(ForegroundColorEnum.red)
|
Console.set_foreground_color(ForegroundColorEnum.red)
|
||||||
Console.write_line(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings')
|
Console.write_line(f'[ ERROR ] [ {__name__} ]: Reading error in {type(self).__name__} settings')
|
||||||
Console.write_line(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
Console.write_line(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
||||||
Console.set_foreground_color(ForegroundColorEnum.default)
|
Console.set_foreground_color(ForegroundColorEnum.default)
|
||||||
|
@@ -15,10 +15,11 @@ __title__ = 'cpl_core.mailing'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post5'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .email import EMail
|
from .email import EMail
|
||||||
from .email_client_service import EMailClient
|
from .email_client_service import EMailClient
|
||||||
@@ -27,4 +28,4 @@ from .email_client_settings import EMailClientSettings
|
|||||||
from .email_client_settings_name_enum import EMailClientSettingsNameEnum
|
from .email_client_settings_name_enum import EMailClientSettingsNameEnum
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post5')
|
||||||
|
@@ -55,6 +55,6 @@ class EMailClientSettings(ConfigurationModelABC):
|
|||||||
self._user_name = settings[EMailClientSettingsNameEnum.user_name.value]
|
self._user_name = settings[EMailClientSettingsNameEnum.user_name.value]
|
||||||
self._credentials = settings[EMailClientSettingsNameEnum.credentials.value]
|
self._credentials = settings[EMailClientSettingsNameEnum.credentials.value]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings')
|
Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {type(self).__name__} settings')
|
||||||
Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
||||||
|
|
||||||
|
@@ -15,10 +15,11 @@ __title__ = 'cpl_core.pipes'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post5'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .bool_pipe import BoolPipe
|
from .bool_pipe import BoolPipe
|
||||||
from .first_char_to_lower_pipe import FirstCharToLowerPipe
|
from .first_char_to_lower_pipe import FirstCharToLowerPipe
|
||||||
@@ -29,4 +30,4 @@ from .to_camel_case_pipe import ToCamelCasePipe
|
|||||||
from .to_snake_case_pipe import ToSnakeCasePipe
|
from .to_snake_case_pipe import ToSnakeCasePipe
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post5')
|
||||||
|
@@ -15,13 +15,14 @@ __title__ = 'cpl_core.time'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post5'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .time_format_settings import TimeFormatSettings
|
from .time_format_settings import TimeFormatSettings
|
||||||
from .time_format_settings_names_enum import TimeFormatSettingsNamesEnum
|
from .time_format_settings_names_enum import TimeFormatSettingsNamesEnum
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post5')
|
||||||
|
@@ -57,6 +57,6 @@ class TimeFormatSettings(ConfigurationModelABC):
|
|||||||
self._date_time_log_format = settings[TimeFormatSettingsNamesEnum.date_time_log_format.value]
|
self._date_time_log_format = settings[TimeFormatSettingsNamesEnum.date_time_log_format.value]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Console.set_foreground_color(ForegroundColorEnum.red)
|
Console.set_foreground_color(ForegroundColorEnum.red)
|
||||||
Console.write_line(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings')
|
Console.write_line(f'[ ERROR ] [ {__name__} ]: Reading error in {type(self).__name__} settings')
|
||||||
Console.write_line(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
Console.write_line(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
||||||
Console.set_foreground_color(ForegroundColorEnum.default)
|
Console.set_foreground_color(ForegroundColorEnum.default)
|
||||||
|
@@ -15,14 +15,15 @@ __title__ = 'cpl_core.utils'
|
|||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||||
__version__ = '2022.6.0'
|
__version__ = '2022.7.0.post5'
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .credential_manager import CredentialManager
|
from .credential_manager import CredentialManager
|
||||||
from .string import String
|
from .string import String
|
||||||
from .pip import Pip
|
from .pip import Pip
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major='2022', minor='6', micro='0')
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post5')
|
||||||
|
@@ -121,11 +121,11 @@ class Pip:
|
|||||||
for arg in args:
|
for arg in args:
|
||||||
pip_args.append(arg)
|
pip_args.append(arg)
|
||||||
|
|
||||||
|
pip_args.append(package)
|
||||||
|
|
||||||
if source is not None:
|
if source is not None:
|
||||||
pip_args.append(f'--extra-index-url')
|
pip_args.append(f'--extra-index-url')
|
||||||
pip_args.append(source)
|
pip_args.append(source)
|
||||||
|
|
||||||
pip_args.append(package)
|
|
||||||
subprocess.run(pip_args, stdout=stdout, stderr=stderr, env=cls._env)
|
subprocess.run(pip_args, stdout=stdout, stderr=stderr, env=cls._env)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
58
src/cpl_discord/__init__.py
Normal file
58
src/cpl_discord/__init__.py
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
"""
|
||||||
|
cpl-discord sh-edraft Common Python library Discord
|
||||||
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
sh-edraft Common Python library link between discord.py and CPL
|
||||||
|
|
||||||
|
:copyright: (c) 2021 - 2022 sh-edraft.de
|
||||||
|
:license: MIT, see LICENSE for more details.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
__title__ = 'cpl_discord'
|
||||||
|
__author__ = 'Sven Heidemann'
|
||||||
|
__license__ = 'MIT'
|
||||||
|
__copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de'
|
||||||
|
__version__ = '2022.7.0.post4'
|
||||||
|
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
|
# imports
|
||||||
|
# build-ignore
|
||||||
|
|
||||||
|
|
||||||
|
def add_discord(self):
|
||||||
|
from cpl_core.console import Console
|
||||||
|
from cpl_discord.service.discord_bot_service_abc import DiscordBotServiceABC
|
||||||
|
from cpl_discord.service.discord_bot_service import DiscordBotService
|
||||||
|
from cpl_discord.service.discord_service_abc import DiscordServiceABC
|
||||||
|
from cpl_discord.service.discord_service import DiscordService
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.add_singleton(DiscordServiceABC, DiscordService)
|
||||||
|
self.add_singleton(DiscordBotServiceABC, DiscordBotService)
|
||||||
|
except ImportError as e:
|
||||||
|
Console.error('cpl-discord is not installed', str(e))
|
||||||
|
|
||||||
|
|
||||||
|
def init():
|
||||||
|
from cpl_core.dependency_injection import ServiceCollection
|
||||||
|
ServiceCollection.add_discord = add_discord
|
||||||
|
|
||||||
|
|
||||||
|
init()
|
||||||
|
|
||||||
|
|
||||||
|
def get_discord_collection(services: 'ServiceCollectionABC') -> 'DiscordCollectionABC':
|
||||||
|
from cpl_discord.service.discord_collection import DiscordCollection
|
||||||
|
from cpl_discord.service.discord_collection_abc import DiscordCollectionABC
|
||||||
|
collection = DiscordCollection(services)
|
||||||
|
services.add_singleton(DiscordCollectionABC, collection)
|
||||||
|
return collection
|
||||||
|
# build-ignore-end
|
||||||
|
|
||||||
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post4')
|
27
src/cpl_discord/application/__init__.py
Normal file
27
src/cpl_discord/application/__init__.py
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
"""
|
||||||
|
cpl-discord sh-edraft Common Python library Discord
|
||||||
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
sh-edraft Common Python library link between discord.py and CPL
|
||||||
|
|
||||||
|
:copyright: (c) 2021 - 2022 sh-edraft.de
|
||||||
|
:license: MIT, see LICENSE for more details.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
__title__ = 'cpl_discord.application'
|
||||||
|
__author__ = 'Sven Heidemann'
|
||||||
|
__license__ = 'MIT'
|
||||||
|
__copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de'
|
||||||
|
__version__ = '2022.7.0.post4'
|
||||||
|
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
|
# imports
|
||||||
|
from .discord_bot_application_abc import DiscordBotApplicationABC
|
||||||
|
|
||||||
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post4')
|
14
src/cpl_discord/application/discord_bot_application_abc.py
Normal file
14
src/cpl_discord/application/discord_bot_application_abc.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
from abc import abstractmethod
|
||||||
|
|
||||||
|
from cpl_core.application import ApplicationABC
|
||||||
|
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||||
|
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||||
|
|
||||||
|
|
||||||
|
class DiscordBotApplicationABC(ApplicationABC):
|
||||||
|
|
||||||
|
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||||
|
ApplicationABC.__init__(self, config, services)
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def stop_async(self): pass
|
28
src/cpl_discord/command/__init__.py
Normal file
28
src/cpl_discord/command/__init__.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
"""
|
||||||
|
cpl-discord sh-edraft Common Python library Discord
|
||||||
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
sh-edraft Common Python library link between discord.py and CPL
|
||||||
|
|
||||||
|
:copyright: (c) 2021 - 2022 sh-edraft.de
|
||||||
|
:license: MIT, see LICENSE for more details.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
__title__ = 'cpl_discord.command'
|
||||||
|
__author__ = 'Sven Heidemann'
|
||||||
|
__license__ = 'MIT'
|
||||||
|
__copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de'
|
||||||
|
__version__ = '2022.7.0.post4'
|
||||||
|
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
|
# imports:
|
||||||
|
from .discord_command_abc import DiscordCommandABC
|
||||||
|
from .discord_commands_meta import DiscordCogMeta
|
||||||
|
|
||||||
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post4')
|
11
src/cpl_discord/command/discord_command_abc.py
Normal file
11
src/cpl_discord/command/discord_command_abc.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
|
from discord.ext import commands
|
||||||
|
|
||||||
|
from cpl_discord.command.discord_commands_meta import DiscordCogMeta
|
||||||
|
|
||||||
|
|
||||||
|
class DiscordCommandABC(ABC, commands.Cog, metaclass=DiscordCogMeta):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
5
src/cpl_discord/command/discord_commands_meta.py
Normal file
5
src/cpl_discord/command/discord_commands_meta.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
from abc import ABCMeta
|
||||||
|
from discord.ext import commands
|
||||||
|
|
||||||
|
|
||||||
|
class DiscordCogMeta(ABCMeta, commands.CogMeta): pass
|
27
src/cpl_discord/configuration/__init__.py
Normal file
27
src/cpl_discord/configuration/__init__.py
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
"""
|
||||||
|
cpl-discord sh-edraft Common Python library Discord
|
||||||
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
sh-edraft Common Python library link between discord.py and CPL
|
||||||
|
|
||||||
|
:copyright: (c) 2021 - 2022 sh-edraft.de
|
||||||
|
:license: MIT, see LICENSE for more details.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
__title__ = 'cpl_discord.configuration'
|
||||||
|
__author__ = 'Sven Heidemann'
|
||||||
|
__license__ = 'MIT'
|
||||||
|
__copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de'
|
||||||
|
__version__ = '2022.7.0.post4'
|
||||||
|
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
|
# imports
|
||||||
|
from .discord_bot_settings import DiscordBotSettings
|
||||||
|
|
||||||
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post4')
|
29
src/cpl_discord/configuration/discord_bot_settings.py
Normal file
29
src/cpl_discord/configuration/discord_bot_settings.py
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import traceback
|
||||||
|
|
||||||
|
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||||
|
from cpl_core.console import Console
|
||||||
|
|
||||||
|
|
||||||
|
class DiscordBotSettings(ConfigurationModelABC):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
ConfigurationModelABC.__init__(self)
|
||||||
|
|
||||||
|
self._token = ''
|
||||||
|
self._prefix = ''
|
||||||
|
|
||||||
|
@property
|
||||||
|
def token(self) -> str:
|
||||||
|
return self._token
|
||||||
|
|
||||||
|
@property
|
||||||
|
def prefix(self) -> str:
|
||||||
|
return self._prefix
|
||||||
|
|
||||||
|
def from_dict(self, settings: dict):
|
||||||
|
try:
|
||||||
|
self._token = settings['Token']
|
||||||
|
self._prefix = settings['Prefix']
|
||||||
|
except Exception as e:
|
||||||
|
Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {__name__} settings')
|
||||||
|
Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
48
src/cpl_discord/cpl-discord.json
Normal file
48
src/cpl_discord/cpl-discord.json
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "cpl-discord",
|
||||||
|
"Version": {
|
||||||
|
"Major": "2022",
|
||||||
|
"Minor": "7",
|
||||||
|
"Micro": "0.post4"
|
||||||
|
},
|
||||||
|
"Author": "Sven Heidemann",
|
||||||
|
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||||
|
"Description": "sh-edraft Common Python library Discord",
|
||||||
|
"LongDescription": "sh-edraft Common Python library link between discord.py and CPL",
|
||||||
|
"URL": "https://www.sh-edraft.de",
|
||||||
|
"CopyrightDate": "2021 - 2022",
|
||||||
|
"CopyrightName": "sh-edraft.de",
|
||||||
|
"LicenseName": "MIT",
|
||||||
|
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||||
|
"Dependencies": [
|
||||||
|
"cpl-core>=2022.7.0.post2",
|
||||||
|
"discord.py==1.7.3",
|
||||||
|
"cpl-query==2022.7.0"
|
||||||
|
],
|
||||||
|
"DevDependencies": [
|
||||||
|
"cpl-cli>=2022.7.0.post2"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.10.4",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": ""
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "library",
|
||||||
|
"SourcePath": "",
|
||||||
|
"OutputPath": "../../dist",
|
||||||
|
"Main": "",
|
||||||
|
"EntryPoint": "",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {},
|
||||||
|
"ProjectReferences": []
|
||||||
|
}
|
||||||
|
}
|
105
src/cpl_discord/discord_event_types_enum.py
Normal file
105
src/cpl_discord/discord_event_types_enum.py
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
from enum import Enum
|
||||||
|
|
||||||
|
from cpl_discord.events.on_bulk_message_delete_abc import OnBulkMessageDeleteABC
|
||||||
|
from cpl_discord.events.on_command_abc import OnCommandABC
|
||||||
|
from cpl_discord.events.on_command_completion_abc import OnCommandCompletionABC
|
||||||
|
from cpl_discord.events.on_command_error_abc import OnCommandErrorABC
|
||||||
|
from cpl_discord.events.on_connect_abc import OnConnectABC
|
||||||
|
from cpl_discord.events.on_disconnect_abc import OnDisconnectABC
|
||||||
|
from cpl_discord.events.on_error_abc import OnErrorABC
|
||||||
|
from cpl_discord.events.on_group_join_abc import OnGroupJoinABC
|
||||||
|
from cpl_discord.events.on_group_remove_abc import OnGroupRemoveABC
|
||||||
|
from cpl_discord.events.on_guild_available_abc import OnGuildAvailableABC
|
||||||
|
from cpl_discord.events.on_guild_channel_create_abc import OnGuildChannelCreateABC
|
||||||
|
from cpl_discord.events.on_guild_channel_delete_abc import OnGuildChannelDeleteABC
|
||||||
|
from cpl_discord.events.on_guild_channel_pins_update_abc import OnGuildChannelPinsUpdateABC
|
||||||
|
from cpl_discord.events.on_guild_channel_update_abc import OnGuildChannelUpdateABC
|
||||||
|
from cpl_discord.events.on_guild_emojis_update_abc import OnGuildEmojisUpdateABC
|
||||||
|
from cpl_discord.events.on_guild_integrations_update_abc import OnGuildIntegrationsUpdateABC
|
||||||
|
from cpl_discord.events.on_guild_join_abc import OnGuildJoinABC
|
||||||
|
from cpl_discord.events.on_guild_remove_abc import OnGuildRemoveABC
|
||||||
|
from cpl_discord.events.on_guild_role_create_abc import OnGuildRoleCreateABC
|
||||||
|
from cpl_discord.events.on_guild_role_delete_abc import OnGuildRoleDeleteABC
|
||||||
|
from cpl_discord.events.on_guild_role_update_abc import OnGuildRoleUpdateABC
|
||||||
|
from cpl_discord.events.on_guild_unavailable_abc import OnGuildUnavailableABC
|
||||||
|
from cpl_discord.events.on_guild_update_abc import OnGuildUpdateABC
|
||||||
|
from cpl_discord.events.on_invite_create_abc import OnInviteCreateABC
|
||||||
|
from cpl_discord.events.on_invite_delete_abc import OnInviteDeleteABC
|
||||||
|
from cpl_discord.events.on_member_ban_abc import OnMemberBanABC
|
||||||
|
from cpl_discord.events.on_member_join_abc import OnMemberJoinABC
|
||||||
|
from cpl_discord.events.on_member_remove_abc import OnMemberRemoveABC
|
||||||
|
from cpl_discord.events.on_member_unban_abc import OnMemberUnbanABC
|
||||||
|
from cpl_discord.events.on_member_update_abc import OnMemberUpdateABC
|
||||||
|
from cpl_discord.events.on_message_abc import OnMessageABC
|
||||||
|
from cpl_discord.events.on_message_delete_abc import OnMessageDeleteABC
|
||||||
|
from cpl_discord.events.on_message_edit_abc import OnMessageEditABC
|
||||||
|
from cpl_discord.events.on_private_channel_create_abc import OnPrivateChannelCreateABC
|
||||||
|
from cpl_discord.events.on_private_channel_delete_abc import OnPrivateChannelDeleteABC
|
||||||
|
from cpl_discord.events.on_private_channel_pins_update_abc import OnPrivateChannelPinsUpdateABC
|
||||||
|
from cpl_discord.events.on_private_channel_update_abc import OnPrivateChannelUpdateABC
|
||||||
|
from cpl_discord.events.on_reaction_add_abc import OnReactionAddABC
|
||||||
|
from cpl_discord.events.on_reaction_clear_abc import OnReactionClearABC
|
||||||
|
from cpl_discord.events.on_reaction_clear_emoji_abc import OnReactionClearEmojiABC
|
||||||
|
from cpl_discord.events.on_reaction_remove_abc import OnReactionRemoveABC
|
||||||
|
from cpl_discord.events.on_ready_abc import OnReadyABC
|
||||||
|
from cpl_discord.events.on_relationship_add_abc import OnRelationshipAddABC
|
||||||
|
from cpl_discord.events.on_relationship_remove_abc import OnRelationshipRemoveABC
|
||||||
|
from cpl_discord.events.on_relationship_update_abc import OnRelationshipUpdateABC
|
||||||
|
from cpl_discord.events.on_resume_abc import OnResumeABC
|
||||||
|
from cpl_discord.events.on_typing_abc import OnTypingABC
|
||||||
|
from cpl_discord.events.on_user_update_abc import OnUserUpdateABC
|
||||||
|
from cpl_discord.events.on_voice_state_update_abc import OnVoiceStateUpdateABC
|
||||||
|
from cpl_discord.events.on_webhooks_update_abc import OnWebhooksUpdateABC
|
||||||
|
|
||||||
|
|
||||||
|
class DiscordEventTypesEnum(Enum):
|
||||||
|
on_bulk_message_delete = OnBulkMessageDeleteABC
|
||||||
|
on_command = OnCommandABC
|
||||||
|
on_command_error = OnCommandErrorABC
|
||||||
|
on_command_completion = OnCommandCompletionABC
|
||||||
|
on_connect = OnConnectABC
|
||||||
|
on_disconnect = OnDisconnectABC
|
||||||
|
on_error = OnErrorABC
|
||||||
|
on_group_join = OnGroupJoinABC
|
||||||
|
on_group_remove = OnGroupRemoveABC
|
||||||
|
on_guild_available = OnGuildAvailableABC
|
||||||
|
on_guild_channel_create = OnGuildChannelCreateABC
|
||||||
|
on_guild_channel_delete = OnGuildChannelDeleteABC
|
||||||
|
on_guild_channel_pins_update = OnGuildChannelPinsUpdateABC
|
||||||
|
on_guild_channel_update = OnGuildChannelUpdateABC
|
||||||
|
on_guild_emojis_update = OnGuildEmojisUpdateABC
|
||||||
|
on_guild_integrations_update = OnGuildIntegrationsUpdateABC
|
||||||
|
on_guild_join = OnGuildJoinABC
|
||||||
|
on_guild_remove = OnGuildRemoveABC
|
||||||
|
on_guild_role_create = OnGuildRoleCreateABC
|
||||||
|
on_guild_role_delete = OnGuildRoleDeleteABC
|
||||||
|
on_guild_role_update = OnGuildRoleUpdateABC
|
||||||
|
on_guild_unavailable = OnGuildUnavailableABC
|
||||||
|
on_guild_update = OnGuildUpdateABC
|
||||||
|
on_invite_create = OnInviteCreateABC
|
||||||
|
on_invite_delete = OnInviteDeleteABC
|
||||||
|
on_member_ban = OnMemberBanABC
|
||||||
|
on_member_join = OnMemberJoinABC
|
||||||
|
on_member_remove = OnMemberRemoveABC
|
||||||
|
on_member_unban = OnMemberUnbanABC
|
||||||
|
on_member_update = OnMemberUpdateABC
|
||||||
|
on_message = OnMessageABC
|
||||||
|
on_message_delete = OnMessageDeleteABC
|
||||||
|
on_message_edit = OnMessageEditABC
|
||||||
|
on_private_channel_create = OnPrivateChannelCreateABC
|
||||||
|
on_private_channel_delete = OnPrivateChannelDeleteABC
|
||||||
|
on_private_channel_pins_update = OnPrivateChannelPinsUpdateABC
|
||||||
|
on_private_channel_update = OnPrivateChannelUpdateABC
|
||||||
|
on_reaction_add = OnReactionAddABC
|
||||||
|
on_reaction_clear = OnReactionClearABC
|
||||||
|
on_reaction_clear_emoji = OnReactionClearEmojiABC
|
||||||
|
on_reaction_remove = OnReactionRemoveABC
|
||||||
|
on_ready = OnReadyABC
|
||||||
|
on_relationship_add = OnRelationshipAddABC
|
||||||
|
on_relationship_remove = OnRelationshipRemoveABC
|
||||||
|
on_relationship_update = OnRelationshipUpdateABC
|
||||||
|
on_resume = OnResumeABC
|
||||||
|
on_typing = OnTypingABC
|
||||||
|
on_user_update = OnUserUpdateABC
|
||||||
|
on_voice_state_update = OnVoiceStateUpdateABC
|
||||||
|
on_webhooks_update = OnWebhooksUpdateABC
|
75
src/cpl_discord/events/__init__.py
Normal file
75
src/cpl_discord/events/__init__.py
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
"""
|
||||||
|
cpl-discord sh-edraft Common Python library Discord
|
||||||
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
sh-edraft Common Python library link between discord.py and CPL
|
||||||
|
|
||||||
|
:copyright: (c) 2021 - 2022 sh-edraft.de
|
||||||
|
:license: MIT, see LICENSE for more details.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
__title__ = 'cpl_discord.events'
|
||||||
|
__author__ = 'Sven Heidemann'
|
||||||
|
__license__ = 'MIT'
|
||||||
|
__copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de'
|
||||||
|
__version__ = '2022.7.0.post4'
|
||||||
|
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
|
# imports:
|
||||||
|
from .on_bulk_message_delete_abc import OnBulkMessageDeleteABC
|
||||||
|
from .on_command_abc import OnCommandABC
|
||||||
|
from .on_command_completion_abc import OnCommandCompletionABC
|
||||||
|
from .on_command_error_abc import OnCommandErrorABC
|
||||||
|
from .on_connect_abc import OnConnectABC
|
||||||
|
from .on_disconnect_abc import OnDisconnectABC
|
||||||
|
from .on_group_join_abc import OnGroupJoinABC
|
||||||
|
from .on_group_remove_abc import OnGroupRemoveABC
|
||||||
|
from .on_guild_available_abc import OnGuildAvailableABC
|
||||||
|
from .on_guild_channel_create_abc import OnGuildChannelCreateABC
|
||||||
|
from .on_guild_channel_delete_abc import OnGuildChannelDeleteABC
|
||||||
|
from .on_guild_channel_pins_update_abc import OnGuildChannelPinsUpdateABC
|
||||||
|
from .on_guild_channel_update_abc import OnGuildChannelUpdateABC
|
||||||
|
from .on_guild_emojis_update_abc import OnGuildEmojisUpdateABC
|
||||||
|
from .on_guild_integrations_update_abc import OnGuildIntegrationsUpdateABC
|
||||||
|
from .on_guild_join_abc import OnGuildJoinABC
|
||||||
|
from .on_guild_remove_abc import OnGuildRemoveABC
|
||||||
|
from .on_guild_role_create_abc import OnGuildRoleCreateABC
|
||||||
|
from .on_guild_role_delete_abc import OnGuildRoleDeleteABC
|
||||||
|
from .on_guild_role_update_abc import OnGuildRoleUpdateABC
|
||||||
|
from .on_guild_unavailable_abc import OnGuildUnavailableABC
|
||||||
|
from .on_guild_update_abc import OnGuildUpdateABC
|
||||||
|
from .on_invite_create_abc import OnInviteCreateABC
|
||||||
|
from .on_invite_delete_abc import OnInviteDeleteABC
|
||||||
|
from .on_member_ban_abc import OnMemberBanABC
|
||||||
|
from .on_member_join_abc import OnMemberJoinABC
|
||||||
|
from .on_member_remove_abc import OnMemberRemoveABC
|
||||||
|
from .on_member_unban_abc import OnMemberUnbanABC
|
||||||
|
from .on_member_update_abc import OnMemberUpdateABC
|
||||||
|
from .on_message_abc import OnMessageABC
|
||||||
|
from .on_message_delete_abc import OnMessageDeleteABC
|
||||||
|
from .on_message_edit_abc import OnMessageEditABC
|
||||||
|
from .on_private_channel_create_abc import OnPrivateChannelCreateABC
|
||||||
|
from .on_private_channel_delete_abc import OnPrivateChannelDeleteABC
|
||||||
|
from .on_private_channel_pins_update_abc import OnPrivateChannelPinsUpdateABC
|
||||||
|
from .on_private_channel_update_abc import OnPrivateChannelUpdateABC
|
||||||
|
from .on_reaction_add_abc import OnReactionAddABC
|
||||||
|
from .on_reaction_clear_abc import OnReactionClearABC
|
||||||
|
from .on_reaction_clear_emoji_abc import OnReactionClearEmojiABC
|
||||||
|
from .on_reaction_remove_abc import OnReactionRemoveABC
|
||||||
|
from .on_ready_abc import OnReadyABC
|
||||||
|
from .on_relationship_add_abc import OnRelationshipAddABC
|
||||||
|
from .on_relationship_remove_abc import OnRelationshipRemoveABC
|
||||||
|
from .on_relationship_update_abc import OnRelationshipUpdateABC
|
||||||
|
from .on_resume_abc import OnResumeABC
|
||||||
|
from .on_typing_abc import OnTypingABC
|
||||||
|
from .on_user_update_abc import OnUserUpdateABC
|
||||||
|
from .on_voice_state_update_abc import OnVoiceStateUpdateABC
|
||||||
|
from .on_webhooks_update_abc import OnWebhooksUpdateABC
|
||||||
|
|
||||||
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
|
version_info = VersionInfo(major='2022', minor='7', micro='0.post4')
|
11
src/cpl_discord/events/on_bulk_message_delete_abc.py
Normal file
11
src/cpl_discord/events/on_bulk_message_delete_abc.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnBulkMessageDeleteABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_bulk_message_delete(self, messages: list[discord.Message]): pass
|
12
src/cpl_discord/events/on_command_abc.py
Normal file
12
src/cpl_discord/events/on_command_abc.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
|
from discord.ext.commands import Context
|
||||||
|
|
||||||
|
|
||||||
|
class OnCommandABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_command(self, ctx: Context): pass
|
12
src/cpl_discord/events/on_command_completion_abc.py
Normal file
12
src/cpl_discord/events/on_command_completion_abc.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
|
from discord.ext.commands import Context, CommandError
|
||||||
|
|
||||||
|
|
||||||
|
class OnCommandCompletionABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_command_completion(self, ctx: Context): pass
|
12
src/cpl_discord/events/on_command_error_abc.py
Normal file
12
src/cpl_discord/events/on_command_error_abc.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
|
from discord.ext.commands import Context, CommandError
|
||||||
|
|
||||||
|
|
||||||
|
class OnCommandErrorABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_command_error(self, ctx: Context, error: CommandError): pass
|
10
src/cpl_discord/events/on_connect_abc.py
Normal file
10
src/cpl_discord/events/on_connect_abc.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
|
|
||||||
|
class OnConnectABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_connect(self): pass
|
10
src/cpl_discord/events/on_disconnect_abc.py
Normal file
10
src/cpl_discord/events/on_disconnect_abc.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
|
|
||||||
|
class OnDisconnectABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_disconnect(self): pass
|
10
src/cpl_discord/events/on_error_abc.py
Normal file
10
src/cpl_discord/events/on_error_abc.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
|
|
||||||
|
class OnErrorABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_error(self, event: str, *args, **kwargs): pass
|
12
src/cpl_discord/events/on_group_join_abc.py
Normal file
12
src/cpl_discord/events/on_group_join_abc.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGroupJoinABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_group_join(
|
||||||
|
self, chhanel: discord.GroupChannel, user: discord.User): pass
|
11
src/cpl_discord/events/on_group_remove_abc.py
Normal file
11
src/cpl_discord/events/on_group_remove_abc.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
class OnGroupRemoveABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_group_remove(
|
||||||
|
self, chhanel: discord.GroupChannel, user: discord.User): pass
|
11
src/cpl_discord/events/on_guild_available_abc.py
Normal file
11
src/cpl_discord/events/on_guild_available_abc.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGuildAvailableABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_guild_available(self, guild: discord.Guild): pass
|
12
src/cpl_discord/events/on_guild_channel_create_abc.py
Normal file
12
src/cpl_discord/events/on_guild_channel_create_abc.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGuildChannelCreateABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_guild_channel_create(self, channel: discord.abc.GuildChannel): pass
|
||||||
|
|
12
src/cpl_discord/events/on_guild_channel_delete_abc.py
Normal file
12
src/cpl_discord/events/on_guild_channel_delete_abc.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGuildChannelDeleteABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_guild_channel_delete(self, channel: discord.abc.GuildChannel): pass
|
||||||
|
|
14
src/cpl_discord/events/on_guild_channel_pins_update_abc.py
Normal file
14
src/cpl_discord/events/on_guild_channel_pins_update_abc.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
from datetime import datetime
|
||||||
|
from typing import Optional
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGuildChannelPinsUpdateABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_guild_channel_pins_update(self, channel: discord.abc.GuildChannel, list_pin: Optional[datetime]): pass
|
||||||
|
|
11
src/cpl_discord/events/on_guild_channel_update_abc.py
Normal file
11
src/cpl_discord/events/on_guild_channel_update_abc.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGuildChannelUpdateABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_guild_channel_update(self, before: discord.abc.GuildChannel, after: discord.abc.GuildChannel): pass
|
12
src/cpl_discord/events/on_guild_emojis_update_abc.py
Normal file
12
src/cpl_discord/events/on_guild_emojis_update_abc.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
from typing import Sequence
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGuildEmojisUpdateABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_guild_emojis_update(self, guild: discord.Guild, before: Sequence[discord.Emoji], after: Sequence[discord.Emoji]): pass
|
12
src/cpl_discord/events/on_guild_integrations_update_abc.py
Normal file
12
src/cpl_discord/events/on_guild_integrations_update_abc.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGuildIntegrationsUpdateABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_guild_integrations_update(self, guild: discord.Guild): pass
|
||||||
|
|
11
src/cpl_discord/events/on_guild_join_abc.py
Normal file
11
src/cpl_discord/events/on_guild_join_abc.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGuildJoinABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_guild_join(self, guild: discord.Guild): pass
|
10
src/cpl_discord/events/on_guild_remove_abc.py
Normal file
10
src/cpl_discord/events/on_guild_remove_abc.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGuildRemoveABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
@abstractmethod
|
||||||
|
async def on_guild_remove(self, guild: discord.Guild): pass
|
11
src/cpl_discord/events/on_guild_role_create_abc.py
Normal file
11
src/cpl_discord/events/on_guild_role_create_abc.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGuildRoleCreateABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_guild_role_create(self, role: discord.Role): pass
|
11
src/cpl_discord/events/on_guild_role_delete_abc.py
Normal file
11
src/cpl_discord/events/on_guild_role_delete_abc.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGuildRoleDeleteABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_guild_role_delete(self, role: discord.Role): pass
|
11
src/cpl_discord/events/on_guild_role_update_abc.py
Normal file
11
src/cpl_discord/events/on_guild_role_update_abc.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGuildRoleUpdateABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_guild_role_update(self, before: discord.Role, after: discord.Role): pass
|
11
src/cpl_discord/events/on_guild_unavailable_abc.py
Normal file
11
src/cpl_discord/events/on_guild_unavailable_abc.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGuildUnavailableABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_guild_unavailable(self, guild: discord.Guild): pass
|
11
src/cpl_discord/events/on_guild_update_abc.py
Normal file
11
src/cpl_discord/events/on_guild_update_abc.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnGuildUpdateABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_guild_update(self, before: discord.Guild, after: discord.Guild): pass
|
12
src/cpl_discord/events/on_invite_create_abc.py
Normal file
12
src/cpl_discord/events/on_invite_create_abc.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnInviteCreateABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_invite_create(self, invite: discord.Invite): pass
|
||||||
|
|
11
src/cpl_discord/events/on_invite_delete_abc.py
Normal file
11
src/cpl_discord/events/on_invite_delete_abc.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnInviteDeleteABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_invite_delete(self, invite: discord.Invite): pass
|
11
src/cpl_discord/events/on_member_ban_abc.py
Normal file
11
src/cpl_discord/events/on_member_ban_abc.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
import discord
|
||||||
|
|
||||||
|
|
||||||
|
class OnMemberBanABC(ABC):
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def __init__(self): pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def on_member_ban(self, guild: discord.Guild, user: discord.User): pass
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user