From 28505479badafa353b9ddb44a378c19dd39685ec Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 25 May 2022 19:30:11 +0200 Subject: [PATCH] Added new project --- cpl-workspace.json | 3 ++- tools/set_pip_url/__init__.py | 1 + tools/set_pip_url/application.py | 16 +++++++++++ tools/set_pip_url/appsettings.json | 15 +++++++++++ tools/set_pip_url/main.py | 14 ++++++++++ tools/set_pip_url/set-pip-url.json | 43 ++++++++++++++++++++++++++++++ tools/set_pip_url/startup.py | 16 +++++++++++ 7 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 tools/set_pip_url/__init__.py create mode 100644 tools/set_pip_url/application.py create mode 100644 tools/set_pip_url/appsettings.json create mode 100644 tools/set_pip_url/main.py create mode 100644 tools/set_pip_url/set-pip-url.json create mode 100644 tools/set_pip_url/startup.py diff --git a/cpl-workspace.json b/cpl-workspace.json index df257d8b..df26286d 100644 --- a/cpl-workspace.json +++ b/cpl-workspace.json @@ -5,7 +5,8 @@ "cpl-core": "src/cpl_core/cpl-core.json", "cpl-cli": "src/cpl_cli/cpl-cli.json", "cpl-query": "src/cpl_query/cpl-query.json", - "set-version": "tools/set_version/set-version.json" + "set-version": "tools/set_version/set-version.json", + "set-pip-url": "tools/set_pip_url/set-pip-url.json" }, "Scripts": { "hello-world": "echo 'Hello World'", diff --git a/tools/set_pip_url/__init__.py b/tools/set_pip_url/__init__.py new file mode 100644 index 00000000..ad5eca30 --- /dev/null +++ b/tools/set_pip_url/__init__.py @@ -0,0 +1 @@ +# imports: diff --git a/tools/set_pip_url/application.py b/tools/set_pip_url/application.py new file mode 100644 index 00000000..34a68c80 --- /dev/null +++ b/tools/set_pip_url/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) + + def configure(self): + pass + + def main(self): + Console.write_line('Hello World') diff --git a/tools/set_pip_url/appsettings.json b/tools/set_pip_url/appsettings.json new file mode 100644 index 00000000..629e6ebd --- /dev/null +++ b/tools/set_pip_url/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/tools/set_pip_url/main.py b/tools/set_pip_url/main.py new file mode 100644 index 00000000..542a9d6d --- /dev/null +++ b/tools/set_pip_url/main.py @@ -0,0 +1,14 @@ +from cpl_core.application import ApplicationBuilder + +from set_pip_url.application import Application +from set_pip_url.startup import Startup + + +def main(): + app_builder = ApplicationBuilder(Application) + app_builder.use_startup(Startup) + app_builder.build().run() + + +if __name__ == '__main__': + main() diff --git a/tools/set_pip_url/set-pip-url.json b/tools/set_pip_url/set-pip-url.json new file mode 100644 index 00000000..227fcf72 --- /dev/null +++ b/tools/set_pip_url/set-pip-url.json @@ -0,0 +1,43 @@ +{ + "ProjectSettings": { + "Name": "set-pip-url", + "Version": { + "Major": "0", + "Minor": "0", + "Micro": "0" + }, + "Author": "", + "AuthorEmail": "", + "Description": "", + "LongDescription": "", + "URL": "", + "CopyrightDate": "", + "CopyrightName": "", + "LicenseName": "", + "LicenseDescription": "", + "Dependencies": [ + "cpl-core>=2022.6.15.dev6" + ], + "PythonVersion": ">=3.10.4", + "PythonPath": { + "linux": "" + }, + "Classifiers": [] + }, + "BuildSettings": { + "ProjectType": "console", + "SourcePath": "", + "OutputPath": "../../dist", + "Main": "set_pip_url.main", + "EntryPoint": "set-pip-url", + "IncludePackageData": false, + "Included": [], + "Excluded": [ + "*/__pycache__", + "*/logs", + "*/tests" + ], + "PackageData": {}, + "ProjectReferences": [] + } +} \ No newline at end of file diff --git a/tools/set_pip_url/startup.py b/tools/set_pip_url/startup.py new file mode 100644 index 00000000..359c03d2 --- /dev/null +++ b/tools/set_pip_url/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) + + def configure_configuration(self, configuration: ConfigurationABC, environment: ApplicationEnvironment) -> ConfigurationABC: + return configuration + + def configure_services(self, services: ServiceCollectionABC, environment: ApplicationEnvironment) -> ServiceProviderABC: + return services.build_service_provider()