Added services

This commit is contained in:
Sven Heidemann 2022-01-16 00:18:12 +01:00
parent 7f1abc54ca
commit d4d5b0b9cb
11 changed files with 160 additions and 3 deletions

View File

@ -2,10 +2,11 @@
"WorkspaceSettings": {
"DefaultProject": "py_to_uxf",
"Projects": {
"py_to_uxf": "src/py_to_uxf/py_to_uxf.json"
"py_to_uxf": "src/py_to_uxf/py_to_uxf.json",
"py_to_uxf_core": "src/py_to_uxf_core/py_to_uxf_core.json"
},
"Scripts": {
"build-start": "cpl build; cd dist/py_to_uxf/build/py_to_uxf; echo \"Starting:\"; bash py_to_uxf --path ./",
"build-start": "cpl build; cd dist/py_to_uxf/build/py_to_uxf; echo \"Starting:\"; bash py_to_uxf ./",
"bs": "cpl build-start"
}
}

View File

@ -39,6 +39,8 @@
"*/tests"
],
"PackageData": {},
"ProjectReferences": []
"ProjectReferences": [
"../py_to_uxf_core/py_to_uxf_core.json"
]
}
}

View File

@ -5,6 +5,11 @@ from cpl_core.configuration import ConfigurationABC, ConsoleArgument
from cpl_core.dependency_injection import ServiceProviderABC, ServiceCollectionABC
from cpl_core.environment import ApplicationEnvironment
from py_to_uxf_core.abc.python_parser_abc import PythonParserABC
from py_to_uxf_core.abc.umlet_creator_abc import UmletCreatorABC
from py_to_uxf_core.service.python_parser_service import PythonParserService
from py_to_uxf_core.service.umlet_creator_service import UmletCreatorService
class Startup(StartupABC):
@ -18,4 +23,7 @@ class Startup(StartupABC):
return configuration
def configure_services(self, services: ServiceCollectionABC, environment: ApplicationEnvironment) -> ServiceProviderABC:
services.add_singleton(PythonParserABC, PythonParserService)
services.add_singleton(UmletCreatorABC, UmletCreatorService)
return services.build_service_provider()

View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
"""
py_to_uxf
~~~~~~~~~~~~~~~~~~~
:copyright: (c)
:license:
"""
__title__ = 'py_to_uxf_core'
__author__ = ''
__license__ = ''
__copyright__ = 'Copyright (c) '
__version__ = '0.0.0'
from collections import namedtuple
# imports
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major='0', minor='0', micro='0')

View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
"""
py_to_uxf
~~~~~~~~~~~~~~~~~~~
:copyright: (c)
:license:
"""
__title__ = 'py_to_uxf_core.abc'
__author__ = ''
__license__ = ''
__copyright__ = 'Copyright (c) '
__version__ = '0.0.0'
from collections import namedtuple
# imports
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major='0', minor='0', micro='0')

View File

@ -0,0 +1,7 @@
from abc import ABC, abstractmethod
class PythonParserABC(ABC):
@abstractmethod
def __init__(self): pass

View File

@ -0,0 +1,7 @@
from abc import ABC, abstractmethod
class UmletCreatorABC(ABC):
@abstractmethod
def __init__(self): pass

View File

@ -0,0 +1,43 @@
{
"ProjectSettings": {
"Name": "py_to_uxf_core",
"Version": {
"Major": "0",
"Minor": "0",
"Micro": "0"
},
"Author": "",
"AuthorEmail": "",
"Description": "",
"LongDescription": "",
"URL": "",
"CopyrightDate": "",
"CopyrightName": "",
"LicenseName": "",
"LicenseDescription": "",
"Dependencies": [
"sh_cpl-core>=2021.11.0.post3"
],
"PythonVersion": ">=3.9.2",
"PythonPath": {
"linux": ""
},
"Classifiers": []
},
"BuildSettings": {
"ProjectType": "library",
"SourcePath": "",
"OutputPath": "../../dist",
"Main": "py_to_uxf_core.main",
"EntryPoint": "py_to_uxf_core",
"IncludePackageData": false,
"Included": [],
"Excluded": [
"*/__pycache__",
"*/logs",
"*/tests"
],
"PackageData": {},
"ProjectReferences": []
}
}

View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
"""
py_to_uxf
~~~~~~~~~~~~~~~~~~~
:copyright: (c)
:license:
"""
__title__ = 'py_to_uxf_core.service'
__author__ = ''
__license__ = ''
__copyright__ = 'Copyright (c) '
__version__ = '0.0.0'
from collections import namedtuple
# imports
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major='0', minor='0', micro='0')

View File

@ -0,0 +1,7 @@
from py_to_uxf_core.abc.python_parser_abc import PythonParserABC
class PythonParserService(PythonParserABC):
def __init__(self):
PythonParserABC.__init__(self)

View File

@ -0,0 +1,7 @@
from py_to_uxf_core.abc.umlet_creator_abc import UmletCreatorABC
class UmletCreatorService(UmletCreatorABC):
def __init__(self):
UmletCreatorABC.__init__(self)