2021.4.1 #11
@ -23,7 +23,7 @@ from collections import namedtuple
|
|||||||
from .configuration import Configuration
|
from .configuration import Configuration
|
||||||
from .configuration_abc import ConfigurationABC
|
from .configuration_abc import ConfigurationABC
|
||||||
from .configuration_model_abc import ConfigurationModelABC
|
from .configuration_model_abc import ConfigurationModelABC
|
||||||
from .configuration_variable_name import ConfigurationVariableName
|
from .configuration_variable_name_enum import ConfigurationVariableNameEnum
|
||||||
from .console_argument import ConsoleArgument
|
from .console_argument import ConsoleArgument
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
|
@ -6,13 +6,13 @@ from typing import Union, Type, Optional
|
|||||||
|
|
||||||
from cpl.configuration.configuration_abc import ConfigurationABC
|
from cpl.configuration.configuration_abc import ConfigurationABC
|
||||||
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
|
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
|
||||||
from cpl.configuration.configuration_variable_name import ConfigurationVariableName
|
from cpl.configuration.configuration_variable_name_enum import ConfigurationVariableNameEnum
|
||||||
from cpl.configuration.console_argument import ConsoleArgument
|
from cpl.configuration.console_argument import ConsoleArgument
|
||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl.environment.hosting_environment import HostingEnvironment
|
from cpl.environment.hosting_environment import HostingEnvironment
|
||||||
from cpl.environment.environment_abc import EnvironmentABC
|
from cpl.environment.environment_abc import EnvironmentABC
|
||||||
from cpl.environment.environment_name import EnvironmentName
|
from cpl.environment.environment_name_enum import EnvironmentName
|
||||||
|
|
||||||
|
|
||||||
class Configuration(ConfigurationABC):
|
class Configuration(ConfigurationABC):
|
||||||
@ -69,13 +69,13 @@ class Configuration(ConfigurationABC):
|
|||||||
Console.set_foreground_color(ForegroundColor.default)
|
Console.set_foreground_color(ForegroundColor.default)
|
||||||
|
|
||||||
def _set_variable(self, name: str, value: str):
|
def _set_variable(self, name: str, value: str):
|
||||||
if name == ConfigurationVariableName.environment.value:
|
if name == ConfigurationVariableNameEnum.environment.value:
|
||||||
self._hosting_environment.environment_name = EnvironmentName(value)
|
self._hosting_environment.environment_name = EnvironmentName(value)
|
||||||
|
|
||||||
elif name == ConfigurationVariableName.name.value:
|
elif name == ConfigurationVariableNameEnum.name.value:
|
||||||
self._hosting_environment.application_name = value
|
self._hosting_environment.application_name = value
|
||||||
|
|
||||||
elif name == ConfigurationVariableName.customer.value:
|
elif name == ConfigurationVariableNameEnum.customer.value:
|
||||||
self._hosting_environment.customer = value
|
self._hosting_environment.customer = value
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@ -155,7 +155,7 @@ class Configuration(ConfigurationABC):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
def add_environment_variables(self, prefix: str):
|
def add_environment_variables(self, prefix: str):
|
||||||
for variable in ConfigurationVariableName.to_list():
|
for variable in ConfigurationVariableNameEnum.to_list():
|
||||||
var_name = f'{prefix}{variable}'
|
var_name = f'{prefix}{variable}'
|
||||||
if var_name in [key.upper() for key in os.environ.keys()]:
|
if var_name in [key.upper() for key in os.environ.keys()]:
|
||||||
self._set_variable(variable, os.environ[var_name])
|
self._set_variable(variable, os.environ[var_name])
|
||||||
@ -164,7 +164,7 @@ class Configuration(ConfigurationABC):
|
|||||||
self._argument_types.append(argument)
|
self._argument_types.append(argument)
|
||||||
|
|
||||||
def add_console_arguments(self):
|
def add_console_arguments(self):
|
||||||
for arg_name in ConfigurationVariableName.to_list():
|
for arg_name in ConfigurationVariableNameEnum.to_list():
|
||||||
self.add_console_argument(ConsoleArgument('--', str(arg_name).upper(), [str(arg_name).lower()], '='))
|
self.add_console_argument(ConsoleArgument('--', str(arg_name).upper(), [str(arg_name).lower()], '='))
|
||||||
|
|
||||||
arg_list = sys.argv[1:]
|
arg_list = sys.argv[1:]
|
||||||
@ -243,13 +243,13 @@ class Configuration(ConfigurationABC):
|
|||||||
|
|
||||||
def get_configuration(self, search_type: Union[str, Type[ConfigurationModelABC]]) -> Union[str, Callable[ConfigurationModelABC]]:
|
def get_configuration(self, search_type: Union[str, Type[ConfigurationModelABC]]) -> Union[str, Callable[ConfigurationModelABC]]:
|
||||||
if type(search_type) is str:
|
if type(search_type) is str:
|
||||||
if search_type == ConfigurationVariableName.environment.value:
|
if search_type == ConfigurationVariableNameEnum.environment.value:
|
||||||
return self._hosting_environment.environment_name
|
return self._hosting_environment.environment_name
|
||||||
|
|
||||||
elif search_type == ConfigurationVariableName.name.value:
|
elif search_type == ConfigurationVariableNameEnum.name.value:
|
||||||
return self._hosting_environment.application_name
|
return self._hosting_environment.application_name
|
||||||
|
|
||||||
elif search_type == ConfigurationVariableName.customer.value:
|
elif search_type == ConfigurationVariableNameEnum.customer.value:
|
||||||
return self._hosting_environment.customer
|
return self._hosting_environment.customer
|
||||||
|
|
||||||
if search_type not in self._config:
|
if search_type not in self._config:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
class ConfigurationVariableName(Enum):
|
class ConfigurationVariableNameEnum(Enum):
|
||||||
|
|
||||||
environment = 'ENVIRONMENT'
|
environment = 'ENVIRONMENT'
|
||||||
name = 'NAME'
|
name = 'NAME'
|
||||||
@ -9,4 +9,4 @@ class ConfigurationVariableName(Enum):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def to_list():
|
def to_list():
|
||||||
return [var.value for var in ConfigurationVariableName]
|
return [var.value for var in ConfigurationVariableNameEnum]
|
@ -1,6 +1,7 @@
|
|||||||
class ConsoleArgument:
|
class ConsoleArgument:
|
||||||
|
|
||||||
def __init__(self, token: str, name: str, aliases: list[str], value_token: str, console_arguments: list['ConsoleArgument'] = None):
|
def __init__(self, token: str, name: str, aliases: list[str], value_token: str, console_arguments: list[
|
||||||
|
'ConsoleArgument'] = None):
|
||||||
self._token = token
|
self._token = token
|
||||||
self._name = name
|
self._name = name
|
||||||
self._aliases = aliases
|
self._aliases = aliases
|
||||||
|
@ -20,10 +20,10 @@ __version__ = '2021.4.1'
|
|||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .background_color import BackgroundColor
|
from .background_color_enum import BackgroundColorEnum
|
||||||
from .console import Console
|
from .console import Console
|
||||||
from .console_call import ConsoleCall
|
from .console_call import ConsoleCall
|
||||||
from .foreground_color import ForegroundColor
|
from .foreground_color_enum import ForegroundColor
|
||||||
from .spinner_thread import SpinnerThread
|
from .spinner_thread import SpinnerThread
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
class BackgroundColor(Enum):
|
class BackgroundColorEnum(Enum):
|
||||||
|
|
||||||
default = 'on_default'
|
default = 'on_default'
|
||||||
grey = 'on_grey'
|
grey = 'on_grey'
|
@ -6,16 +6,16 @@ import pyfiglet
|
|||||||
from tabulate import tabulate
|
from tabulate import tabulate
|
||||||
from termcolor import colored
|
from termcolor import colored
|
||||||
|
|
||||||
from cpl.console.background_color import BackgroundColor
|
from cpl.console.background_color_enum import BackgroundColorEnum
|
||||||
from cpl.console.console_call import ConsoleCall
|
from cpl.console.console_call import ConsoleCall
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl.console.spinner_thread import SpinnerThread
|
from cpl.console.spinner_thread import SpinnerThread
|
||||||
|
|
||||||
|
|
||||||
class Console:
|
class Console:
|
||||||
_is_first_write = True
|
_is_first_write = True
|
||||||
|
|
||||||
_background_color: BackgroundColor = BackgroundColor.default
|
_background_color: BackgroundColorEnum = BackgroundColorEnum.default
|
||||||
_foreground_color: ForegroundColor = ForegroundColor.default
|
_foreground_color: ForegroundColor = ForegroundColor.default
|
||||||
_x: Optional[int] = None
|
_x: Optional[int] = None
|
||||||
_y: Optional[int] = None
|
_y: Optional[int] = None
|
||||||
@ -47,9 +47,9 @@ class Console:
|
|||||||
cls._hold_back = value
|
cls._hold_back = value
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def set_background_color(cls, color: Union[BackgroundColor, str]):
|
def set_background_color(cls, color: Union[BackgroundColorEnum, str]):
|
||||||
if type(color) is str:
|
if type(color) is str:
|
||||||
cls._background_color = BackgroundColor[color]
|
cls._background_color = BackgroundColorEnum[color]
|
||||||
else:
|
else:
|
||||||
cls._background_color = color
|
cls._background_color = color
|
||||||
|
|
||||||
@ -88,11 +88,11 @@ class Console:
|
|||||||
args.append(f'\033[{cls._y};{cls._x}H')
|
args.append(f'\033[{cls._y};{cls._x}H')
|
||||||
|
|
||||||
colored_args.append(string)
|
colored_args.append(string)
|
||||||
if cls._foreground_color != ForegroundColor.default and cls._background_color == BackgroundColor.default:
|
if cls._foreground_color != ForegroundColor.default and cls._background_color == BackgroundColorEnum.default:
|
||||||
colored_args.append(cls._foreground_color.value)
|
colored_args.append(cls._foreground_color.value)
|
||||||
elif cls._foreground_color == ForegroundColor.default and cls._background_color != BackgroundColor.default:
|
elif cls._foreground_color == ForegroundColor.default and cls._background_color != BackgroundColorEnum.default:
|
||||||
colored_args.append(cls._background_color.value)
|
colored_args.append(cls._background_color.value)
|
||||||
elif cls._foreground_color != ForegroundColor.default and cls._background_color != BackgroundColor.default:
|
elif cls._foreground_color != ForegroundColor.default and cls._background_color != BackgroundColorEnum.default:
|
||||||
colored_args.append(cls._foreground_color.value)
|
colored_args.append(cls._foreground_color.value)
|
||||||
colored_args.append(cls._background_color.value)
|
colored_args.append(cls._background_color.value)
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ class Console:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def reset(cls):
|
def reset(cls):
|
||||||
cls._background_color = BackgroundColor.default
|
cls._background_color = BackgroundColorEnum.default
|
||||||
cls._foreground_color = ForegroundColor.default
|
cls._foreground_color = ForegroundColor.default
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -252,7 +252,7 @@ class Console:
|
|||||||
cls._output(string, x, y, end='')
|
cls._output(string, x, y, end='')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def spinner(cls, message: str, call: Callable, *args, text_foreground_color: ForegroundColor = None, spinner_foreground_color: ForegroundColor = None, text_background_color: BackgroundColor = None, spinner_background_color: BackgroundColor = None) -> any:
|
def spinner(cls, message: str, call: Callable, *args, text_foreground_color: ForegroundColor = None, spinner_foreground_color: ForegroundColor = None, text_background_color: BackgroundColorEnum = None, spinner_background_color: BackgroundColorEnum = None) -> any:
|
||||||
if cls._hold_back:
|
if cls._hold_back:
|
||||||
cls._hold_back_calls.append(ConsoleCall(cls.spinner, message, call, *args))
|
cls._hold_back_calls.append(ConsoleCall(cls.spinner, message, call, *args))
|
||||||
return
|
return
|
||||||
@ -272,7 +272,7 @@ class Console:
|
|||||||
cls.set_hold_back(False)
|
cls.set_hold_back(False)
|
||||||
|
|
||||||
cls.set_foreground_color(ForegroundColor.default)
|
cls.set_foreground_color(ForegroundColor.default)
|
||||||
cls.set_background_color(BackgroundColor.default)
|
cls.set_background_color(BackgroundColorEnum.default)
|
||||||
|
|
||||||
for call in cls._hold_back_calls:
|
for call in cls._hold_back_calls:
|
||||||
call.function(*call.args)
|
call.function(*call.args)
|
||||||
|
@ -5,13 +5,13 @@ import time
|
|||||||
|
|
||||||
from termcolor import colored
|
from termcolor import colored
|
||||||
|
|
||||||
from cpl.console.background_color import BackgroundColor
|
from cpl.console.background_color_enum import BackgroundColorEnum
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
|
|
||||||
|
|
||||||
class SpinnerThread(threading.Thread):
|
class SpinnerThread(threading.Thread):
|
||||||
|
|
||||||
def __init__(self, msg_len: int, foreground_color: ForegroundColor, background_color: BackgroundColor):
|
def __init__(self, msg_len: int, foreground_color: ForegroundColor, background_color: BackgroundColorEnum):
|
||||||
threading.Thread.__init__(self)
|
threading.Thread.__init__(self)
|
||||||
|
|
||||||
self._msg_len = msg_len
|
self._msg_len = msg_len
|
||||||
|
@ -22,7 +22,7 @@ from collections import namedtuple
|
|||||||
# imports:
|
# imports:
|
||||||
from .database_model import DatabaseModel
|
from .database_model import DatabaseModel
|
||||||
from .database_settings import DatabaseSettings
|
from .database_settings import DatabaseSettings
|
||||||
from .database_settings_name import DatabaseSettingsName
|
from .database_settings_name_enum import DatabaseSettingsName
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major=2021, minor=4, micro=1)
|
version_info = VersionInfo(major=2021, minor=4, micro=1)
|
||||||
|
@ -4,7 +4,7 @@ from sqlalchemy import engine, create_engine
|
|||||||
from sqlalchemy.orm import Session, sessionmaker
|
from sqlalchemy.orm import Session, sessionmaker
|
||||||
|
|
||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl.database.connection.database_connection_abc import DatabaseConnectionABC
|
from cpl.database.connection.database_connection_abc import DatabaseConnectionABC
|
||||||
from cpl.database.database_settings import DatabaseSettings
|
from cpl.database.database_settings import DatabaseSettings
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ from sqlalchemy import engine, Table
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
|
|
||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl.database.connection.database_connection import DatabaseConnection
|
from cpl.database.connection.database_connection import DatabaseConnection
|
||||||
from cpl.database.connection.database_connection_abc import DatabaseConnectionABC
|
from cpl.database.connection.database_connection_abc import DatabaseConnectionABC
|
||||||
from cpl.database.context.database_context_abc import DatabaseContextABC
|
from cpl.database.context.database_context_abc import DatabaseContextABC
|
||||||
|
@ -3,8 +3,8 @@ from typing import Optional
|
|||||||
|
|
||||||
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
|
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
|
||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl.database.database_settings_name import DatabaseSettingsName
|
from cpl.database.database_settings_name_enum import DatabaseSettingsName
|
||||||
|
|
||||||
|
|
||||||
class DatabaseSettings(ConfigurationModelABC):
|
class DatabaseSettings(ConfigurationModelABC):
|
||||||
|
@ -21,7 +21,7 @@ from collections import namedtuple
|
|||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .environment_abc import EnvironmentABC
|
from .environment_abc import EnvironmentABC
|
||||||
from .environment_name import EnvironmentName
|
from .environment_name_enum import EnvironmentName
|
||||||
from .hosting_environment import HostingEnvironment
|
from .hosting_environment import HostingEnvironment
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
|
@ -2,7 +2,7 @@ from socket import gethostname
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from cpl.environment.environment_abc import EnvironmentABC
|
from cpl.environment.environment_abc import EnvironmentABC
|
||||||
from cpl.environment.environment_name import EnvironmentName
|
from cpl.environment.environment_name_enum import EnvironmentName
|
||||||
|
|
||||||
|
|
||||||
class HostingEnvironment(EnvironmentABC):
|
class HostingEnvironment(EnvironmentABC):
|
||||||
|
@ -20,11 +20,11 @@ __version__ = '2021.4.1'
|
|||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .logger import Logger
|
from .logger_service import Logger
|
||||||
from .logger_abc import LoggerABC
|
from .logger_abc import LoggerABC
|
||||||
from .logging_level import LoggingLevel
|
from .logging_level_enum import LoggingLevel
|
||||||
from .logging_settings import LoggingSettings
|
from .logging_settings import LoggingSettings
|
||||||
from .logging_settings_name import LoggingSettingsName
|
from .logging_settings_name_enum import LoggingSettingsName
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major=2021, minor=4, micro=1)
|
version_info = VersionInfo(major=2021, minor=4, micro=1)
|
||||||
|
@ -5,9 +5,9 @@ from string import Template
|
|||||||
|
|
||||||
from cpl.application.application_runtime_abc import ApplicationRuntimeABC
|
from cpl.application.application_runtime_abc import ApplicationRuntimeABC
|
||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl.logging.logger_abc import LoggerABC
|
from cpl.logging.logger_abc import LoggerABC
|
||||||
from cpl.logging.logging_level import LoggingLevel
|
from cpl.logging.logging_level_enum import LoggingLevel
|
||||||
from cpl.logging.logging_settings import LoggingSettings
|
from cpl.logging.logging_settings import LoggingSettings
|
||||||
from cpl.time.time_format_settings import TimeFormatSettings
|
from cpl.time.time_format_settings import TimeFormatSettings
|
||||||
|
|
@ -3,9 +3,9 @@ from typing import Optional
|
|||||||
|
|
||||||
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
|
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
|
||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl.logging.logging_level import LoggingLevel
|
from cpl.logging.logging_level_enum import LoggingLevel
|
||||||
from cpl.logging.logging_settings_name import LoggingSettingsName
|
from cpl.logging.logging_settings_name_enum import LoggingSettingsName
|
||||||
|
|
||||||
|
|
||||||
class LoggingSettings(ConfigurationModelABC):
|
class LoggingSettings(ConfigurationModelABC):
|
||||||
|
@ -21,10 +21,10 @@ from collections import namedtuple
|
|||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .email import EMail
|
from .email import EMail
|
||||||
from .email_client import EMailClient
|
from .email_client_service import EMailClient
|
||||||
from .email_client_abc import EMailClientABC
|
from .email_client_abc import EMailClientABC
|
||||||
from .email_client_settings import EMailClientSettings
|
from .email_client_settings import EMailClientSettings
|
||||||
from .email_client_settings_name import EMailClientSettingsName
|
from .email_client_settings_name_enum import EMailClientSettingsName
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major=2021, minor=4, micro=1)
|
version_info = VersionInfo(major=2021, minor=4, micro=1)
|
||||||
|
@ -2,7 +2,7 @@ import traceback
|
|||||||
|
|
||||||
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
|
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
|
||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl.mailing.email_client_settings_name import EMailClientSettingsName
|
from cpl.mailing.email_client_settings_name_enum import EMailClientSettingsName
|
||||||
|
|
||||||
|
|
||||||
class EMailClientSettings(ConfigurationModelABC):
|
class EMailClientSettings(ConfigurationModelABC):
|
||||||
|
@ -21,7 +21,7 @@ from collections import namedtuple
|
|||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .time_format_settings import TimeFormatSettings
|
from .time_format_settings import TimeFormatSettings
|
||||||
from .time_format_settings_names import TimeFormatSettingsNames
|
from .time_format_settings_names_enum import TimeFormatSettingsNames
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major=2021, minor=4, micro=1)
|
version_info = VersionInfo(major=2021, minor=4, micro=1)
|
||||||
|
@ -3,8 +3,8 @@ from typing import Optional
|
|||||||
|
|
||||||
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
|
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
|
||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl.time.time_format_settings_names import TimeFormatSettingsNames
|
from cpl.time.time_format_settings_names_enum import TimeFormatSettingsNames
|
||||||
|
|
||||||
|
|
||||||
class TimeFormatSettings(ConfigurationModelABC):
|
class TimeFormatSettings(ConfigurationModelABC):
|
||||||
|
@ -21,6 +21,7 @@ from collections import namedtuple
|
|||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .credential_manager import CredentialManager
|
from .credential_manager import CredentialManager
|
||||||
|
from .string import String
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
version_info = VersionInfo(major=2021, minor=4, micro=1)
|
version_info = VersionInfo(major=2021, minor=4, micro=1)
|
||||||
|
@ -3,7 +3,7 @@ from collections import Callable
|
|||||||
|
|
||||||
from cpl.application.application_abc import ApplicationRuntimeABC
|
from cpl.application.application_abc import ApplicationRuntimeABC
|
||||||
from cpl.configuration.configuration_abc import ConfigurationABC
|
from cpl.configuration.configuration_abc import ConfigurationABC
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl.utils.string import String
|
from cpl.utils.string import String
|
||||||
from cpl_cli.command_abc import CommandABC
|
from cpl_cli.command_abc import CommandABC
|
||||||
@ -26,7 +26,7 @@ class Generate(CommandABC):
|
|||||||
"Template": ABCTemplate
|
"Template": ABCTemplate
|
||||||
},
|
},
|
||||||
"class": {
|
"class": {
|
||||||
"Upper": "Class",
|
"Upper": "",
|
||||||
"Template": ClassTemplate
|
"Template": ClassTemplate
|
||||||
},
|
},
|
||||||
"enum": {
|
"enum": {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl_cli.command_abc import CommandABC
|
from cpl_cli.command_abc import CommandABC
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ from typing import Optional
|
|||||||
|
|
||||||
from cpl.application.application_runtime_abc import ApplicationRuntimeABC
|
from cpl.application.application_runtime_abc import ApplicationRuntimeABC
|
||||||
from cpl.configuration.configuration_abc import ConfigurationABC
|
from cpl.configuration.configuration_abc import ConfigurationABC
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl_cli.command_abc import CommandABC
|
from cpl_cli.command_abc import CommandABC
|
||||||
from cpl_cli.configuration.build_settings import BuildSettings
|
from cpl_cli.configuration.build_settings import BuildSettings
|
||||||
|
@ -7,7 +7,7 @@ import pkg_resources
|
|||||||
import cpl
|
import cpl
|
||||||
import cpl_cli
|
import cpl_cli
|
||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl_cli.command_abc import CommandABC
|
from cpl_cli.command_abc import CommandABC
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ from typing import Optional
|
|||||||
|
|
||||||
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
|
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
|
||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl_cli.configuration.build_settings_name import BuildSettingsName
|
from cpl_cli.configuration.build_settings_name import BuildSettingsName
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ from typing import Optional
|
|||||||
|
|
||||||
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
|
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
|
||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl_cli.configuration.version import Version
|
from cpl_cli.configuration.version import Version
|
||||||
from cpl_cli.configuration.project_settings_name import ProjectSettingsName
|
from cpl_cli.configuration.project_settings_name import ProjectSettingsName
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import setuptools
|
|||||||
from setuptools import sandbox
|
from setuptools import sandbox
|
||||||
|
|
||||||
from cpl.application.application_runtime_abc import ApplicationRuntimeABC
|
from cpl.application.application_runtime_abc import ApplicationRuntimeABC
|
||||||
from cpl.console.foreground_color import ForegroundColor
|
from cpl.console.foreground_color_enum import ForegroundColor
|
||||||
from cpl.console.console import Console
|
from cpl.console.console import Console
|
||||||
from cpl_cli.configuration.build_settings import BuildSettings
|
from cpl_cli.configuration.build_settings import BuildSettings
|
||||||
from cpl_cli.configuration.project_settings import ProjectSettings
|
from cpl_cli.configuration.project_settings import ProjectSettings
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
"""
|
||||||
|
sh_cpl sh-edraft Common Python library
|
||||||
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
sh-edraft Common Python library
|
||||||
|
|
||||||
|
:copyright: (c) 2020 - 2021 sh-edraft.de
|
||||||
|
:license: MIT, see LICENSE for more details.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
__title__ = 'cpl_cli.templates.generate'
|
||||||
|
__author__ = 'Sven Heidemann'
|
||||||
|
__license__ = 'MIT'
|
||||||
|
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||||
|
__version__ = '2021.4.1'
|
||||||
|
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
|
# imports:
|
||||||
|
|
||||||
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
|
version_info = VersionInfo(major=2021, minor=4, micro=1)
|
@ -10,8 +10,8 @@ class ClassTemplate(TemplateFileABC):
|
|||||||
def __init__(self, name: str, schematic: str, schematic_upper: str, path: str):
|
def __init__(self, name: str, schematic: str, schematic_upper: str, path: str):
|
||||||
TemplateFileABC.__init__(self)
|
TemplateFileABC.__init__(self)
|
||||||
|
|
||||||
self._name = f'{String.convert_to_snake_case(name)}_{schematic}.py'
|
self._name = f'{String.convert_to_snake_case(name)}.py'
|
||||||
self._class_name = f'{String.first_to_upper(name)}{schematic_upper}'
|
self._class_name = f'{String.first_to_upper(name)}'
|
||||||
self._path = path
|
self._path = path
|
||||||
self._value = textwrap.dedent("""\
|
self._value = textwrap.dedent("""\
|
||||||
class $Name:
|
class $Name:
|
||||||
|
@ -7,9 +7,9 @@ from cpl.configuration.configuration_abc import ConfigurationABC
|
|||||||
from cpl.database.context.database_context import DatabaseContext
|
from cpl.database.context.database_context import DatabaseContext
|
||||||
from cpl.database.database_settings import DatabaseSettings
|
from cpl.database.database_settings import DatabaseSettings
|
||||||
from cpl.dependency_injection.service_provider_abc import ServiceProviderABC
|
from cpl.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||||
from cpl.logging.logger import Logger
|
from cpl.logging.logger_service import Logger
|
||||||
from cpl.logging.logger_abc import LoggerABC
|
from cpl.logging.logger_abc import LoggerABC
|
||||||
from cpl.mailing.email_client import EMailClient
|
from cpl.mailing.email_client_service import EMailClient
|
||||||
from cpl.mailing.email_client_abc import EMailClientABC
|
from cpl.mailing.email_client_abc import EMailClientABC
|
||||||
from cpl.utils.credential_manager import CredentialManager
|
from cpl.utils.credential_manager import CredentialManager
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user