A-0.1 - Modularer Aufbau #13
13
cpl-workspace.json
Normal file
13
cpl-workspace.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"WorkspaceSettings": {
|
||||||
|
"DefaultProject": "gismo",
|
||||||
|
"Projects": {
|
||||||
|
"gismo": "src/gismo/gismo.json",
|
||||||
|
"gismo-cli": "src/gismo_cli/gismo-cli.json",
|
||||||
|
"gismo-core": "src/gismo_core/gismo-core.json",
|
||||||
|
"modules_core": "src/modules_core/modules_core.json",
|
||||||
|
"boot-log": "src/modules/boot_log/boot-log.json"
|
||||||
|
},
|
||||||
|
"Scripts": {}
|
||||||
|
}
|
||||||
|
}
|
1
src/gismo/__init__.py
Normal file
1
src/gismo/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
16
src/gismo/application.py
Normal file
16
src/gismo/application.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from cpl_core.application import ApplicationABC
|
||||||
|
from cpl_core.configuration import ConfigurationABC
|
||||||
|
from cpl_core.console import Console
|
||||||
|
from cpl_core.dependency_injection import ServiceProviderABC
|
||||||
|
|
||||||
|
|
||||||
|
class Application(ApplicationABC):
|
||||||
|
|
||||||
|
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||||
|
ApplicationABC.__init__(self, config, services)
|
||||||
|
|
||||||
|
async def configure(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
async def main(self):
|
||||||
|
Console.write_line('Hello World')
|
15
src/gismo/appsettings.json
Normal file
15
src/gismo/appsettings.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"TimeFormatSettings": {
|
||||||
|
"DateFormat": "%Y-%m-%d",
|
||||||
|
"TimeFormat": "%H:%M:%S",
|
||||||
|
"DateTimeFormat": "%Y-%m-%d %H:%M:%S.%f",
|
||||||
|
"DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S"
|
||||||
|
},
|
||||||
|
|
||||||
|
"LoggingSettings": {
|
||||||
|
"Path": "logs/",
|
||||||
|
"Filename": "log_$start_time.log",
|
||||||
|
"ConsoleLogLevel": "ERROR",
|
||||||
|
"FileLogLevel": "WARN"
|
||||||
|
}
|
||||||
|
}
|
48
src/gismo/gismo.json
Normal file
48
src/gismo/gismo.json
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "gismo",
|
||||||
|
"Version": {
|
||||||
|
"Major": "0",
|
||||||
|
"Minor": "1",
|
||||||
|
"Micro": "0"
|
||||||
|
},
|
||||||
|
"Author": "Sven Heidemann",
|
||||||
|
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||||
|
"Description": "sh-edraft Gismo",
|
||||||
|
"LongDescription": "sh-edraft Dicord bot Gismo",
|
||||||
|
"URL": "https://www.sh-edraft.de",
|
||||||
|
"CopyrightDate": "2021 - 2022",
|
||||||
|
"CopyrightName": "sh-edraft.de",
|
||||||
|
"LicenseName": "MIT",
|
||||||
|
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||||
|
"Dependencies": [
|
||||||
|
"sh_cpl-core>=2021.10.2",
|
||||||
|
"sh_cpl-query>=2021.10.2"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.9.2",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": "../../venv/bin/python"
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "console",
|
||||||
|
"SourcePath": "",
|
||||||
|
"OutputPath": "../../dist",
|
||||||
|
"Main": "gismo.main",
|
||||||
|
"EntryPoint": "gismo",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {
|
||||||
|
"cpl_cli": [
|
||||||
|
"*.json"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ProjectReferences": []
|
||||||
|
}
|
||||||
|
}
|
18
src/gismo/main.py
Normal file
18
src/gismo/main.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import asyncio
|
||||||
|
|
||||||
|
from cpl_core.application import ApplicationBuilder
|
||||||
|
|
||||||
|
from gismo.application import Application
|
||||||
|
from gismo.startup import Startup
|
||||||
|
|
||||||
|
|
||||||
|
async def main():
|
||||||
|
app_builder = ApplicationBuilder(Application)
|
||||||
|
app_builder.use_startup(Startup)
|
||||||
|
app: Application = await app_builder.build_async()
|
||||||
|
await app.run_async()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
ml = asyncio.get_event_loop()
|
||||||
|
ml.run_until_complete(main())
|
16
src/gismo/startup.py
Normal file
16
src/gismo/startup.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from cpl_core.application import StartupABC
|
||||||
|
from cpl_core.configuration import ConfigurationABC
|
||||||
|
from cpl_core.dependency_injection import ServiceProviderABC, ServiceCollectionABC
|
||||||
|
from cpl_core.environment import ApplicationEnvironment
|
||||||
|
|
||||||
|
|
||||||
|
class Startup(StartupABC):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
StartupABC.__init__(self)
|
||||||
|
|
||||||
|
async def configure_configuration(self, configuration: ConfigurationABC, environment: ApplicationEnvironment) -> ConfigurationABC:
|
||||||
|
return configuration
|
||||||
|
|
||||||
|
async def configure_services(self, services: ServiceCollectionABC, environment: ApplicationEnvironment) -> ServiceProviderABC:
|
||||||
|
return services.build_service_provider()
|
1
src/gismo_cli/__init__.py
Normal file
1
src/gismo_cli/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
16
src/gismo_cli/application.py
Normal file
16
src/gismo_cli/application.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from cpl_core.application import ApplicationABC
|
||||||
|
from cpl_core.configuration import ConfigurationABC
|
||||||
|
from cpl_core.console import Console
|
||||||
|
from cpl_core.dependency_injection import ServiceProviderABC
|
||||||
|
|
||||||
|
|
||||||
|
class Application(ApplicationABC):
|
||||||
|
|
||||||
|
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||||
|
ApplicationABC.__init__(self, config, services)
|
||||||
|
|
||||||
|
async def configure(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
async def main(self):
|
||||||
|
Console.write_line('Hello World')
|
15
src/gismo_cli/appsettings.json
Normal file
15
src/gismo_cli/appsettings.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"TimeFormatSettings": {
|
||||||
|
"DateFormat": "%Y-%m-%d",
|
||||||
|
"TimeFormat": "%H:%M:%S",
|
||||||
|
"DateTimeFormat": "%Y-%m-%d %H:%M:%S.%f",
|
||||||
|
"DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S"
|
||||||
|
},
|
||||||
|
|
||||||
|
"LoggingSettings": {
|
||||||
|
"Path": "logs/",
|
||||||
|
"Filename": "log_$start_time.log",
|
||||||
|
"ConsoleLogLevel": "ERROR",
|
||||||
|
"FileLogLevel": "WARN"
|
||||||
|
}
|
||||||
|
}
|
48
src/gismo_cli/gismo-cli.json
Normal file
48
src/gismo_cli/gismo-cli.json
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "gismo-cli",
|
||||||
|
"Version": {
|
||||||
|
"Major": "0",
|
||||||
|
"Minor": "1",
|
||||||
|
"Micro": "0"
|
||||||
|
},
|
||||||
|
"Author": "Sven Heidemann",
|
||||||
|
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||||
|
"Description": "sh-edraft Gismo CLI",
|
||||||
|
"LongDescription": "sh-edraft Dicord bot Gismo CLI",
|
||||||
|
"URL": "https://www.sh-edraft.de",
|
||||||
|
"CopyrightDate": "2021 - 2022",
|
||||||
|
"CopyrightName": "sh-edraft.de",
|
||||||
|
"LicenseName": "MIT",
|
||||||
|
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||||
|
"Dependencies": [
|
||||||
|
"sh_cpl-core>=2021.10.2",
|
||||||
|
"sh_cpl-query>=2021.10.2"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.9.2",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": "../../venv/bin/python"
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "console",
|
||||||
|
"SourcePath": "",
|
||||||
|
"OutputPath": "../../dist",
|
||||||
|
"Main": "gismo.main",
|
||||||
|
"EntryPoint": "gismo",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {
|
||||||
|
"cpl_cli": [
|
||||||
|
"*.json"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ProjectReferences": []
|
||||||
|
}
|
||||||
|
}
|
18
src/gismo_cli/main.py
Normal file
18
src/gismo_cli/main.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import asyncio
|
||||||
|
|
||||||
|
from cpl_core.application import ApplicationBuilder
|
||||||
|
|
||||||
|
from gismo_cli.application import Application
|
||||||
|
from gismo_cli.startup import Startup
|
||||||
|
|
||||||
|
|
||||||
|
async def main():
|
||||||
|
app_builder = ApplicationBuilder(Application)
|
||||||
|
app_builder.use_startup(Startup)
|
||||||
|
app: Application = await app_builder.build_async()
|
||||||
|
await app.run_async()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
ml = asyncio.get_event_loop()
|
||||||
|
ml.run_until_complete(main())
|
16
src/gismo_cli/startup.py
Normal file
16
src/gismo_cli/startup.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from cpl_core.application import StartupABC
|
||||||
|
from cpl_core.configuration import ConfigurationABC
|
||||||
|
from cpl_core.dependency_injection import ServiceProviderABC, ServiceCollectionABC
|
||||||
|
from cpl_core.environment import ApplicationEnvironment
|
||||||
|
|
||||||
|
|
||||||
|
class Startup(StartupABC):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
StartupABC.__init__(self)
|
||||||
|
|
||||||
|
async def configure_configuration(self, configuration: ConfigurationABC, environment: ApplicationEnvironment) -> ConfigurationABC:
|
||||||
|
return configuration
|
||||||
|
|
||||||
|
async def configure_services(self, services: ServiceCollectionABC, environment: ApplicationEnvironment) -> ServiceProviderABC:
|
||||||
|
return services.build_service_provider()
|
1
src/gismo_core/__init__.py
Normal file
1
src/gismo_core/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
43
src/gismo_core/gismo-core.json
Normal file
43
src/gismo_core/gismo-core.json
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "gismo-core",
|
||||||
|
"Version": {
|
||||||
|
"Major": "0",
|
||||||
|
"Minor": "0",
|
||||||
|
"Micro": "0"
|
||||||
|
},
|
||||||
|
"Author": "",
|
||||||
|
"AuthorEmail": "",
|
||||||
|
"Description": "",
|
||||||
|
"LongDescription": "",
|
||||||
|
"URL": "",
|
||||||
|
"CopyrightDate": "",
|
||||||
|
"CopyrightName": "",
|
||||||
|
"LicenseName": "",
|
||||||
|
"LicenseDescription": "",
|
||||||
|
"Dependencies": [
|
||||||
|
"sh_cpl>=2021.10.2"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.9.2",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": ""
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "library",
|
||||||
|
"SourcePath": "",
|
||||||
|
"OutputPath": "../../dist",
|
||||||
|
"Main": "gismo_core.main",
|
||||||
|
"EntryPoint": "gismo-core",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {},
|
||||||
|
"ProjectReferences": []
|
||||||
|
}
|
||||||
|
}
|
0
src/modules_core/LICENSE
Normal file
0
src/modules_core/LICENSE
Normal file
0
src/modules_core/README.md
Normal file
0
src/modules_core/README.md
Normal file
1
src/modules_core/__init__.py
Normal file
1
src/modules_core/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
15
src/modules_core/appsettings.json
Normal file
15
src/modules_core/appsettings.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"TimeFormatSettings": {
|
||||||
|
"DateFormat": "%Y-%m-%d",
|
||||||
|
"TimeFormat": "%H:%M:%S",
|
||||||
|
"DateTimeFormat": "%Y-%m-%d %H:%M:%S.%f",
|
||||||
|
"DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S"
|
||||||
|
},
|
||||||
|
|
||||||
|
"LoggingSettings": {
|
||||||
|
"Path": "logs/",
|
||||||
|
"Filename": "log_$start_time.log",
|
||||||
|
"ConsoleLogLevel": "ERROR",
|
||||||
|
"FileLogLevel": "WARN"
|
||||||
|
}
|
||||||
|
}
|
9
src/modules_core/main.py
Normal file
9
src/modules_core/main.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
from cpl_core.console import Console
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
Console.write_line('Hello World')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
43
src/modules_core/modules_core.json
Normal file
43
src/modules_core/modules_core.json
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "modules_core",
|
||||||
|
"Version": {
|
||||||
|
"Major": "0",
|
||||||
|
"Minor": "0",
|
||||||
|
"Micro": "0"
|
||||||
|
},
|
||||||
|
"Author": "",
|
||||||
|
"AuthorEmail": "",
|
||||||
|
"Description": "",
|
||||||
|
"LongDescription": "",
|
||||||
|
"URL": "",
|
||||||
|
"CopyrightDate": "",
|
||||||
|
"CopyrightName": "",
|
||||||
|
"LicenseName": "",
|
||||||
|
"LicenseDescription": "",
|
||||||
|
"Dependencies": [
|
||||||
|
"sh_cpl>=2021.10.2"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.9.2",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": ""
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "library",
|
||||||
|
"SourcePath": "",
|
||||||
|
"OutputPath": "../../dist",
|
||||||
|
"Main": "modules_core.main",
|
||||||
|
"EntryPoint": "modules_core",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {},
|
||||||
|
"ProjectReferences": []
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user