Changed versions
This commit is contained in:
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.2'
|
||||
__version__ = '2021.10.3'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='2')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.build'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.2'
|
||||
__version__ = '2021.10.3'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='2')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.generate'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.2'
|
||||
__version__ = '2021.10.3'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='2')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.2'
|
||||
__version__ = '2021.10.3'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='2')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.2'
|
||||
__version__ = '2021.10.3'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='2')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.2'
|
||||
__version__ = '2021.10.3'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='2')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.name'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.2'
|
||||
__version__ = '2021.10.3'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='2')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3')
|
||||
|
@@ -12,12 +12,13 @@ class MainWithApplicationHostAndStartupTemplate(TemplateFileABC):
|
||||
name = String.convert_to_snake_case(name)
|
||||
self._name = 'main.py'
|
||||
self._path = path
|
||||
self._use_async = use_async
|
||||
|
||||
import_pkg = f'{name}.'
|
||||
|
||||
if use_async:
|
||||
self._value = textwrap.dedent(f"""\
|
||||
import asyncio
|
||||
|
||||
from cpl_core.application import ApplicationBuilder
|
||||
|
||||
from {import_pkg}application import Application
|
||||
@@ -28,7 +29,7 @@ class MainWithApplicationHostAndStartupTemplate(TemplateFileABC):
|
||||
app_builder = ApplicationBuilder(Application)
|
||||
app_builder.use_startup(Startup)
|
||||
app: Application = await app_builder.build_async()
|
||||
await app.run()
|
||||
await app.run_async()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
@@ -74,12 +75,13 @@ class MainWithApplicationBaseTemplate(TemplateFileABC):
|
||||
name = String.convert_to_snake_case(name)
|
||||
self._name = 'main.py'
|
||||
self._path = path
|
||||
self._use_async = use_async
|
||||
|
||||
import_pkg = f'{name}.'
|
||||
|
||||
if use_async:
|
||||
self._value = textwrap.dedent(f"""\
|
||||
import asyncio
|
||||
|
||||
from cpl_core.application import ApplicationBuilder
|
||||
|
||||
from {import_pkg}application import Application
|
||||
@@ -88,7 +90,7 @@ class MainWithApplicationBaseTemplate(TemplateFileABC):
|
||||
async def main():
|
||||
app_builder = ApplicationBuilder(Application)
|
||||
app: Application = await app_builder.build_async()
|
||||
await app.run()
|
||||
await app.run_async()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
@@ -132,12 +134,13 @@ class MainWithoutApplicationBaseTemplate(TemplateFileABC):
|
||||
name = String.convert_to_snake_case(name)
|
||||
self._name = 'main.py'
|
||||
self._path = path
|
||||
self._use_async = use_async
|
||||
|
||||
import_pkg = f'{name}.'
|
||||
|
||||
if use_async:
|
||||
self._value = textwrap.dedent("""\
|
||||
import asyncio
|
||||
|
||||
from cpl_core.console import Console
|
||||
|
||||
|
||||
@@ -183,12 +186,13 @@ class MainWithDependencyInjection(TemplateFileABC):
|
||||
name = String.convert_to_snake_case(name)
|
||||
self._name = 'main.py'
|
||||
self._path = path
|
||||
self._use_async = use_async
|
||||
|
||||
import_pkg = f'{name}.'
|
||||
|
||||
if use_async:
|
||||
self._value = textwrap.dedent("""\
|
||||
import asyncio
|
||||
|
||||
from cpl_core.configuration import Configuration, ConfigurationABC
|
||||
from cpl_core.console import Console
|
||||
from cpl_core.dependency_injection import ServiceCollection, ServiceProviderABC
|
||||
@@ -205,8 +209,8 @@ class MainWithDependencyInjection(TemplateFileABC):
|
||||
|
||||
|
||||
async def main():
|
||||
await config = configure_configuration()
|
||||
await provider = configure_services(config)
|
||||
config = await configure_configuration()
|
||||
provider = await configure_services(config)
|
||||
Console.write_line('Hello World')
|
||||
|
||||
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.tests'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.2'
|
||||
__version__ = '2021.10.3'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='2')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.2'
|
||||
__version__ = '2021.10.3'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='2')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.2'
|
||||
__version__ = '2021.10.3'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='2')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.name'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.2'
|
||||
__version__ = '2021.10.3'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='2')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3')
|
||||
|
@@ -5,29 +5,50 @@ from cpl_cli._templates.template_file_abc import TemplateFileABC
|
||||
|
||||
class ApplicationTemplate(TemplateFileABC):
|
||||
|
||||
def __init__(self, name: str, path: str):
|
||||
def __init__(self, name: str, path: str, use_async: bool):
|
||||
TemplateFileABC.__init__(self)
|
||||
|
||||
self._name = 'application.py'
|
||||
self._path = path
|
||||
self._value = textwrap.dedent("""\
|
||||
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
|
||||
|
||||
if use_async:
|
||||
self._value = textwrap.dedent("""\
|
||||
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)
|
||||
|
||||
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')
|
||||
""")
|
||||
async def configure(self):
|
||||
pass
|
||||
|
||||
async def main(self):
|
||||
Console.write_line('Hello World')
|
||||
""")
|
||||
else:
|
||||
self._value = textwrap.dedent("""\
|
||||
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')
|
||||
""")
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
|
@@ -5,7 +5,7 @@ from cpl_cli._templates.template_file_abc import TemplateFileABC
|
||||
|
||||
class MainWithApplicationHostAndStartupTemplate(TemplateFileABC):
|
||||
|
||||
def __init__(self, name: str, path: str):
|
||||
def __init__(self, name: str, path: str, use_async: bool):
|
||||
TemplateFileABC.__init__(self)
|
||||
|
||||
self._name = 'main.py'
|
||||
@@ -15,22 +15,44 @@ class MainWithApplicationHostAndStartupTemplate(TemplateFileABC):
|
||||
if name == '':
|
||||
import_pkg = ''
|
||||
|
||||
self._value = textwrap.dedent(f"""\
|
||||
from cpl_core.application import ApplicationBuilder
|
||||
|
||||
from {import_pkg}application import Application
|
||||
from {import_pkg}startup import Startup
|
||||
|
||||
|
||||
def main():
|
||||
app_builder = ApplicationBuilder(Application)
|
||||
app_builder.use_startup(Startup)
|
||||
app_builder.build().run()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
""")
|
||||
if use_async:
|
||||
self._value = textwrap.dedent(f"""\
|
||||
import asyncio
|
||||
|
||||
from cpl_core.application import ApplicationBuilder
|
||||
|
||||
from {import_pkg}application import Application
|
||||
from {import_pkg}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())
|
||||
""")
|
||||
else:
|
||||
self._value = textwrap.dedent(f"""\
|
||||
from cpl_core.application import ApplicationBuilder
|
||||
|
||||
from {import_pkg}application import Application
|
||||
from {import_pkg}startup import Startup
|
||||
|
||||
|
||||
def main():
|
||||
app_builder = ApplicationBuilder(Application)
|
||||
app_builder.use_startup(Startup)
|
||||
app_builder.build().run()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
""")
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
@@ -47,7 +69,7 @@ class MainWithApplicationHostAndStartupTemplate(TemplateFileABC):
|
||||
|
||||
class MainWithApplicationBaseTemplate(TemplateFileABC):
|
||||
|
||||
def __init__(self, name: str, path: str):
|
||||
def __init__(self, name: str, path: str, use_async: bool):
|
||||
TemplateFileABC.__init__(self)
|
||||
|
||||
self._name = 'main.py'
|
||||
@@ -57,20 +79,40 @@ class MainWithApplicationBaseTemplate(TemplateFileABC):
|
||||
if name == '':
|
||||
import_pkg = ''
|
||||
|
||||
self._value = textwrap.dedent(f"""\
|
||||
from cpl_core.application import ApplicationBuilder
|
||||
|
||||
from {import_pkg}application import Application
|
||||
|
||||
|
||||
def main():
|
||||
app_builder = ApplicationBuilder(Application)
|
||||
app_builder.build().run()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
""")
|
||||
if use_async:
|
||||
self._value = textwrap.dedent(f"""\
|
||||
import asyncio
|
||||
|
||||
from cpl_core.application import ApplicationBuilder
|
||||
|
||||
from {import_pkg}application import Application
|
||||
|
||||
|
||||
async def main():
|
||||
app_builder = ApplicationBuilder(Application)
|
||||
app: Application = await app_builder.build_async()
|
||||
await app.run_async()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
ml = asyncio.get_event_loop()
|
||||
ml.run_until_complete(main())
|
||||
""")
|
||||
else:
|
||||
self._value = textwrap.dedent(f"""\
|
||||
from cpl_core.application import ApplicationBuilder
|
||||
|
||||
from {import_pkg}application import Application
|
||||
|
||||
|
||||
def main():
|
||||
app_builder = ApplicationBuilder(Application)
|
||||
app_builder.build().run()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
""")
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
@@ -87,23 +129,39 @@ class MainWithApplicationBaseTemplate(TemplateFileABC):
|
||||
|
||||
class MainWithoutApplicationBaseTemplate(TemplateFileABC):
|
||||
|
||||
def __init__(self, name: str, path: str):
|
||||
def __init__(self, name: str, path: str, use_async: bool):
|
||||
TemplateFileABC.__init__(self)
|
||||
|
||||
self._name = 'main.py'
|
||||
self._path = path
|
||||
|
||||
self._value = textwrap.dedent("""\
|
||||
from cpl_core.console import Console
|
||||
|
||||
|
||||
def main():
|
||||
Console.write_line('Hello World')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
""")
|
||||
if use_async:
|
||||
self._value = textwrap.dedent("""\
|
||||
import asyncio
|
||||
|
||||
from cpl_core.console import Console
|
||||
|
||||
|
||||
async def main():
|
||||
Console.write_line('Hello World')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
ml = asyncio.get_event_loop()
|
||||
ml.run_until_complete(main())
|
||||
""")
|
||||
else:
|
||||
self._value = textwrap.dedent("""\
|
||||
from cpl_core.console import Console
|
||||
|
||||
|
||||
def main():
|
||||
Console.write_line('Hello World')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
""")
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
@@ -120,37 +178,67 @@ class MainWithoutApplicationBaseTemplate(TemplateFileABC):
|
||||
|
||||
class MainWithDependencyInjection(TemplateFileABC):
|
||||
|
||||
def __init__(self, name: str, path: str):
|
||||
def __init__(self, name: str, path: str, use_async: bool):
|
||||
TemplateFileABC.__init__(self)
|
||||
|
||||
self._name = 'main.py'
|
||||
self._path = path
|
||||
|
||||
self._value = textwrap.dedent("""\
|
||||
from cpl_core.configuration import Configuration, ConfigurationABC
|
||||
from cpl_core.console import Console
|
||||
from cpl_core.dependency_injection import ServiceCollection, ServiceProviderABC
|
||||
|
||||
|
||||
def configure_configuration() -> ConfigurationABC:
|
||||
config = Configuration()
|
||||
return config
|
||||
|
||||
|
||||
def configure_services(config: ConfigurationABC) -> ServiceProviderABC:
|
||||
services = ServiceCollection(config)
|
||||
return services.build_service_provider()
|
||||
|
||||
|
||||
def main():
|
||||
config = configure_configuration()
|
||||
provider = configure_services(config)
|
||||
Console.write_line('Hello World')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
""")
|
||||
|
||||
if use_async:
|
||||
self._value = textwrap.dedent("""\
|
||||
import asyncio
|
||||
|
||||
from cpl_core.configuration import Configuration, ConfigurationABC
|
||||
from cpl_core.console import Console
|
||||
from cpl_core.dependency_injection import ServiceCollection, ServiceProviderABC
|
||||
|
||||
|
||||
async def configure_configuration() -> ConfigurationABC:
|
||||
config = Configuration()
|
||||
return config
|
||||
|
||||
|
||||
async def configure_services(config: ConfigurationABC) -> ServiceProviderABC:
|
||||
services = ServiceCollection(config)
|
||||
return services.build_service_provider()
|
||||
|
||||
|
||||
async def main():
|
||||
config = await configure_configuration()
|
||||
provider = await configure_services(config)
|
||||
Console.write_line('Hello World')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
ml = asyncio.get_event_loop()
|
||||
ml.run_until_complete(main())
|
||||
""")
|
||||
else:
|
||||
self._value = textwrap.dedent("""\
|
||||
from cpl_core.configuration import Configuration, ConfigurationABC
|
||||
from cpl_core.console import Console
|
||||
from cpl_core.dependency_injection import ServiceCollection, ServiceProviderABC
|
||||
|
||||
|
||||
def configure_configuration() -> ConfigurationABC:
|
||||
config = Configuration()
|
||||
return config
|
||||
|
||||
|
||||
def configure_services(config: ConfigurationABC) -> ServiceProviderABC:
|
||||
services = ServiceCollection(config)
|
||||
return services.build_service_provider()
|
||||
|
||||
|
||||
def main():
|
||||
config = configure_configuration()
|
||||
provider = configure_services(config)
|
||||
Console.write_line('Hello World')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
""")
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
|
@@ -5,29 +5,50 @@ from cpl_cli._templates.template_file_abc import TemplateFileABC
|
||||
|
||||
class StartupTemplate(TemplateFileABC):
|
||||
|
||||
def __init__(self, name: str, path: str):
|
||||
def __init__(self, name: str, path: str, use_async: bool):
|
||||
TemplateFileABC.__init__(self)
|
||||
|
||||
self._name = 'startup.py'
|
||||
self._path = path
|
||||
self._value = textwrap.dedent("""\
|
||||
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()
|
||||
""")
|
||||
|
||||
if use_async:
|
||||
self._value = textwrap.dedent("""\
|
||||
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()
|
||||
""")
|
||||
else:
|
||||
self._value = textwrap.dedent("""\
|
||||
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()
|
||||
""")
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.tests'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.2'
|
||||
__version__ = '2021.10.3'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='2')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3')
|
||||
|
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.publish'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.2'
|
||||
__version__ = '2021.10.3'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='2')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3')
|
||||
|
Reference in New Issue
Block a user