diff --git a/cpl-workspace.json b/cpl-workspace.json new file mode 100644 index 0000000..cf21a2c --- /dev/null +++ b/cpl-workspace.json @@ -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": {} + } +} \ No newline at end of file diff --git a/src/gismo/__init__.py b/src/gismo/__init__.py new file mode 100644 index 0000000..ad5eca3 --- /dev/null +++ b/src/gismo/__init__.py @@ -0,0 +1 @@ +# imports: diff --git a/src/gismo/application.py b/src/gismo/application.py new file mode 100644 index 0000000..b2df025 --- /dev/null +++ b/src/gismo/application.py @@ -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') diff --git a/src/gismo/appsettings.json b/src/gismo/appsettings.json new file mode 100644 index 0000000..629e6eb --- /dev/null +++ b/src/gismo/appsettings.json @@ -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" + } +} diff --git a/src/gismo/gismo.json b/src/gismo/gismo.json new file mode 100644 index 0000000..a3a8bb0 --- /dev/null +++ b/src/gismo/gismo.json @@ -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": [] + } +} \ No newline at end of file diff --git a/src/gismo/main.py b/src/gismo/main.py new file mode 100644 index 0000000..4311d0e --- /dev/null +++ b/src/gismo/main.py @@ -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()) diff --git a/src/gismo/startup.py b/src/gismo/startup.py new file mode 100644 index 0000000..dadaee3 --- /dev/null +++ b/src/gismo/startup.py @@ -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() diff --git a/src/gismo_cli/__init__.py b/src/gismo_cli/__init__.py new file mode 100644 index 0000000..ad5eca3 --- /dev/null +++ b/src/gismo_cli/__init__.py @@ -0,0 +1 @@ +# imports: diff --git a/src/gismo_cli/application.py b/src/gismo_cli/application.py new file mode 100644 index 0000000..b2df025 --- /dev/null +++ b/src/gismo_cli/application.py @@ -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') diff --git a/src/gismo_cli/appsettings.json b/src/gismo_cli/appsettings.json new file mode 100644 index 0000000..629e6eb --- /dev/null +++ b/src/gismo_cli/appsettings.json @@ -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" + } +} diff --git a/src/gismo_cli/gismo-cli.json b/src/gismo_cli/gismo-cli.json new file mode 100644 index 0000000..37fc9ce --- /dev/null +++ b/src/gismo_cli/gismo-cli.json @@ -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": [] + } +} \ No newline at end of file diff --git a/src/gismo_cli/main.py b/src/gismo_cli/main.py new file mode 100644 index 0000000..e16a50d --- /dev/null +++ b/src/gismo_cli/main.py @@ -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()) diff --git a/src/gismo_cli/startup.py b/src/gismo_cli/startup.py new file mode 100644 index 0000000..dadaee3 --- /dev/null +++ b/src/gismo_cli/startup.py @@ -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() diff --git a/src/gismo_core/__init__.py b/src/gismo_core/__init__.py new file mode 100644 index 0000000..ad5eca3 --- /dev/null +++ b/src/gismo_core/__init__.py @@ -0,0 +1 @@ +# imports: diff --git a/src/gismo_core/gismo-core.json b/src/gismo_core/gismo-core.json new file mode 100644 index 0000000..6623647 --- /dev/null +++ b/src/gismo_core/gismo-core.json @@ -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": [] + } +} \ No newline at end of file diff --git a/src/modules_core/LICENSE b/src/modules_core/LICENSE new file mode 100644 index 0000000..e69de29 diff --git a/src/modules_core/README.md b/src/modules_core/README.md new file mode 100644 index 0000000..e69de29 diff --git a/src/modules_core/__init__.py b/src/modules_core/__init__.py new file mode 100644 index 0000000..ad5eca3 --- /dev/null +++ b/src/modules_core/__init__.py @@ -0,0 +1 @@ +# imports: diff --git a/src/modules_core/appsettings.json b/src/modules_core/appsettings.json new file mode 100644 index 0000000..629e6eb --- /dev/null +++ b/src/modules_core/appsettings.json @@ -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" + } +} diff --git a/src/modules_core/main.py b/src/modules_core/main.py new file mode 100644 index 0000000..db8266c --- /dev/null +++ b/src/modules_core/main.py @@ -0,0 +1,9 @@ +from cpl_core.console import Console + + +def main(): + Console.write_line('Hello World') + + +if __name__ == '__main__': + main() diff --git a/src/modules_core/modules_core.json b/src/modules_core/modules_core.json new file mode 100644 index 0000000..1e2da9c --- /dev/null +++ b/src/modules_core/modules_core.json @@ -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": [] + } +} \ No newline at end of file