From bb8891401a52aa96eadea616e59b68197e30dc78 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Tue, 24 Feb 2026 10:39:12 +0300 Subject: [PATCH] fix: Usage "typing.Any" instead "any" --- src/abstract/v00/configuration.py | 24 +++--- src/core/bugcheck_error.py | 4 +- src/core/controller_utils.py | 8 +- src/core/handlers.py | 54 ++++++------- src/core/helpers.py | 2 +- src/core/model.py | 4 +- .../add/option_handler_to_add__std.py | 4 +- ...ption_handler_to_get_value__std__simple.py | 4 +- ...n_handler_to_get_value__std__union_list.py | 4 +- ...handler_to_prepare_get_value__std__bool.py | 4 +- ...dler_to_prepare_get_value__std__generic.py | 4 +- ..._handler_to_prepare_get_value__std__int.py | 4 +- ..._handler_to_prepare_get_value__std__str.py | 4 +- ...prepare_get_value__std__unique_str_list.py | 2 +- ...handler_to_prepare_set_value__std__bool.py | 2 +- ...dler_to_prepare_set_value__std__generic.py | 4 +- ..._handler_to_prepare_set_value__std__int.py | 4 +- ..._handler_to_prepare_set_value__std__str.py | 4 +- ...prepare_set_value__std__unique_str_list.py | 2 +- ...ler_to_prepare_set_value_item__std__str.py | 4 +- ...ption_handler_to_set_value__std__simple.py | 4 +- ..._handler_to_set_value_item__std__unique.py | 4 +- src/core/raise_error.py | 6 +- src/implementation/v00/configuration_base.py | 78 +++++++++---------- tests/ErrorMessageBuilder.py | 5 +- tests/TestGlobalCache.py | 6 +- tests/conftest.py | 2 +- ...test_set001__generic_support_of_options.py | 12 +-- .../SetOptionValue/test_set001__common.py | 8 +- .../bool_option/test_set001__common.py | 16 ++-- 30 files changed, 159 insertions(+), 128 deletions(-) diff --git a/src/abstract/v00/configuration.py b/src/abstract/v00/configuration.py index b8ac7fd..6b8452e 100644 --- a/src/abstract/v00/configuration.py +++ b/src/abstract/v00/configuration.py @@ -98,16 +98,16 @@ def get_Name(self) -> str: RaiseError.MethodIsNotImplemented(__class__, "get_Name") # -------------------------------------------------------------------- - def get_Value(self) -> any: + def get_Value(self) -> typing.Any: RaiseError.MethodIsNotImplemented(__class__, "get_Value") # -------------------------------------------------------------------- - def set_Value(self, value: any) -> PostgresConfigurationSetOptionValueResult: + def set_Value(self, value: typing.Any) -> PostgresConfigurationSetOptionValueResult: RaiseError.MethodIsNotImplemented(__class__, "set_Value") # -------------------------------------------------------------------- def set_ValueItem( - self, value_item: any + self, value_item: typing.Any ) -> PostgresConfigurationSetOptionValueResult: assert value_item is not None RaiseError.MethodIsNotImplemented(__class__, "set_ValueItem") @@ -188,7 +188,7 @@ def AddComment( # -------------------------------------------------------------------- def AddOption( - self, name: str, value: any, offset: typing.Optional[int] + self, name: str, value: typing.Any, offset: typing.Optional[int] ) -> PostgresConfigurationOption: assert type(name) is str assert name != "" @@ -275,7 +275,7 @@ def AddComment(self, text: str) -> PostgresConfigurationComment: RaiseError.MethodIsNotImplemented(__class__, "AddComment") # -------------------------------------------------------------------- - def AddOption(self, name: str, value: any) -> PostgresConfigurationOption: + def AddOption(self, name: str, value: typing.Any) -> PostgresConfigurationOption: assert type(name) is str assert name != "" assert value is not None @@ -299,7 +299,7 @@ def AddInclude(self, path: str) -> PostgresConfigurationInclude: # PostgresConfigurationSetOptionValueResult object. # def SetOptionValue( - self, name: str, value: any + self, name: str, value: typing.Any ) -> PostgresConfigurationSetOptionValueResult: assert type(name) is str assert name != "" @@ -313,13 +313,13 @@ def SetOptionValue( # - Value of option. # - None if option is not found in this file. # - def GetOptionValue(self, name: str) -> any: + def GetOptionValue(self, name: str) -> typing.Any: assert type(name) is str RaiseError.MethodIsNotImplemented(__class__, "GetOptionValue") # -------------------------------------------------------------------- def SetOptionValueItem( - self, name: str, value_item: any + self, name: str, value_item: typing.Any ) -> PostgresConfigurationSetOptionValueResult: assert type(name) is str assert name != "" @@ -380,7 +380,7 @@ def AddTopLevelFile(self, path: str) -> PostgresConfigurationFile: RaiseError.MethodIsNotImplemented(__class__, "AddTopLevelFile") # -------------------------------------------------------------------- - def AddOption(self, name: str, value: any) -> PostgresConfigurationOption: + def AddOption(self, name: str, value: typing.Any) -> PostgresConfigurationOption: assert type(name) is str assert name != "" assert value is not None @@ -398,7 +398,7 @@ def AddOption(self, name: str, value: any) -> PostgresConfigurationOption: # PostgresConfigurationSetOptionValueResult object. # def SetOptionValue( - self, name: str, value: any + self, name: str, value: typing.Any ) -> PostgresConfigurationSetOptionValueResult: assert type(name) is str RaiseError.MethodIsNotImplemented(__class__, "SetOptionValue") @@ -411,13 +411,13 @@ def SetOptionValue( # - Value of option. # - None if option is not found. # - def GetOptionValue(self, name: str) -> any: + def GetOptionValue(self, name: str) -> typing.Any: assert type(name) is str RaiseError.MethodIsNotImplemented(__class__, "GetOptionValue") # -------------------------------------------------------------------- def SetOptionValueItem( - self, name: str, value_item: any + self, name: str, value_item: typing.Any ) -> PostgresConfigurationSetOptionValueResult: assert type(name) is str assert value_item is not None diff --git a/src/core/bugcheck_error.py b/src/core/bugcheck_error.py index f18bd20..7b0e9c4 100644 --- a/src/core/bugcheck_error.py +++ b/src/core/bugcheck_error.py @@ -1,6 +1,8 @@ # ////////////////////////////////////////////////////////////////////////////// # Postgres Pro. PostgreSQL Configuration Python Library. +import typing + # ////////////////////////////////////////////////////////////////////////////// # BugCheckError @@ -67,7 +69,7 @@ def UnkFileObjectDataType(fileName: str, fileDataType: type): # -------------------------------------------------------------------- @staticmethod - def UnkFileDataStatus(filePath: str, fileStatus: any): + def UnkFileDataStatus(filePath: str, fileStatus: typing.Any): assert type(filePath) is str assert fileStatus is not None diff --git a/src/core/controller_utils.py b/src/core/controller_utils.py index 9c16687..4ec6a2a 100644 --- a/src/core/controller_utils.py +++ b/src/core/controller_utils.py @@ -28,7 +28,7 @@ class DataControllerUtils: @staticmethod - def Option__set_Value(optionData: PgCfgModel__OptionData, value: any): + def Option__set_Value(optionData: PgCfgModel__OptionData, value: typing.Any): assert type(optionData) is PgCfgModel__OptionData assert value is not None @@ -36,7 +36,7 @@ def Option__set_Value(optionData: PgCfgModel__OptionData, value: any): # -------------------------------------------------------------------- @staticmethod - def Option__add_ValueItem(optionData: PgCfgModel__OptionData, valueItem: any): + def Option__add_ValueItem(optionData: PgCfgModel__OptionData, valueItem: typing.Any): assert type(optionData) is PgCfgModel__OptionData assert type(optionData.m_Value) is list assert valueItem is not None @@ -205,7 +205,7 @@ def FileLine__add_Option( cfgData: PgCfgModel__ConfigurationData, fileLineData: PgCfgModel__FileLineData, optName: str, - optValue: any, + optValue: typing.Any, optOffset: typing.Optional[int], ) -> PgCfgModel__OptionData: assert type(cfgData) is PgCfgModel__ConfigurationData @@ -321,7 +321,7 @@ def File__add_Option( cfgData: PgCfgModel__ConfigurationData, fileData: PgCfgModel__FileData, optName: str, - optValue: any, + optValue: typing.Any, ) -> PgCfgModel__OptionData: assert type(cfgData) is PgCfgModel__ConfigurationData assert type(fileData) is PgCfgModel__FileData diff --git a/src/core/handlers.py b/src/core/handlers.py index cd69d84..61059ad 100644 --- a/src/core/handlers.py +++ b/src/core/handlers.py @@ -23,8 +23,8 @@ def DataHandler__SetOptionValue__Simple( self, targetData: typing.Union[None, FileData, OptionData], optionName: str, - optionValue: any, - ) -> any: + optionValue: typing.Any, + ) -> typing.Any: assert ( targetData is None or type(targetData) is FileData @@ -41,7 +41,7 @@ def DataHandler__GetOptionValue__Simple( self, sourceData: typing.Union[None, FileData, OptionData], optionName: str, - ) -> any: + ) -> typing.Any: assert ( sourceData is None or type(sourceData) is FileData @@ -57,7 +57,7 @@ def DataHandler__GetOptionValue__UnionList( self, sourceData: typing.Union[None, FileLineData, OptionData], optionName: str, - ) -> any: + ) -> typing.Any: assert ( sourceData is None or type(sourceData) is FileData @@ -73,7 +73,7 @@ def DataHandler__ResetOption( self, targetData: typing.Union[None, FileData, OptionData], optionName: str, - ) -> any: + ) -> typing.Any: assert ( targetData is None or type(targetData) is FileData @@ -88,8 +88,8 @@ def DataHandler__AddSimpleOption( target: typing.Union[None, FileData, FileLineData], optionOffset: typing.Optional[int], optionName: str, - optionValue: any, - ) -> any: + optionValue: typing.Any, + ) -> typing.Any: assert ( target is None or type(target) is FileData or type(target) is FileLineData ) @@ -103,8 +103,8 @@ def DataHandler__SetUniqueOptionValueItem( self, targetData: typing.Union[None, FileData, OptionData], optionName: str, - optionValueItem: any, - ) -> any: + optionValueItem: typing.Any, + ) -> typing.Any: assert ( targetData is None or type(targetData) is FileData @@ -134,7 +134,7 @@ class OptionHandlerCtxToSetValue: DataHandler: ConfigurationDataHandler TargetData: typing.Union[None, FileData, OptionData] OptionName: str - OptionValue: any + OptionValue: typing.Any # -------------------------------------------------------------------- def __init__( @@ -142,7 +142,7 @@ def __init__( dataHandler: ConfigurationDataHandler, targetData: typing.Union[None, FileData, OptionData], optionName: str, - optionValue: any, + optionValue: typing.Any, ): assert isinstance(dataHandler, ConfigurationDataHandler) assert ( @@ -167,7 +167,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def SetOptionValue(self, ctx: OptionHandlerCtxToSetValue) -> any: + def SetOptionValue(self, ctx: OptionHandlerCtxToSetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToSetValue assert ctx.OptionName is not None assert ctx.OptionValue is not None @@ -212,7 +212,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def GetOptionValue(self, ctx: OptionHandlerCtxToGetValue) -> any: + def GetOptionValue(self, ctx: OptionHandlerCtxToGetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToGetValue assert ( ctx.SourceData is None @@ -232,7 +232,7 @@ class OptionHandlerCtxToAddOption: Target: typing.Union[None, FileData, FileLineData] OptionOffset: typing.Optional[int] OptionName: str - OptionValue: any + OptionValue: typing.Any # -------------------------------------------------------------------- def __init__( @@ -241,7 +241,7 @@ def __init__( target: typing.Union[None, FileData, FileLineData], optionOffset: typing.Optional[int], optionName: str, - optionValue: any, + optionValue: typing.Any, ): assert isinstance(dataHandler, ConfigurationDataHandler) assert ( @@ -266,7 +266,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def AddOption(self, ctx: OptionHandlerCtxToSetValue) -> any: + def AddOption(self, ctx: OptionHandlerCtxToSetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToSetValue RaiseError.MethodIsNotImplemented(__class__, "AddOption") @@ -279,7 +279,7 @@ class OptionHandlerCtxToSetValueItem: DataHandler: ConfigurationDataHandler TargetData: typing.Union[None, FileData, OptionData] OptionName: str - OptionValueItem: any + OptionValueItem: typing.Any # -------------------------------------------------------------------- def __init__( @@ -287,7 +287,7 @@ def __init__( dataHandler: ConfigurationDataHandler, targetData: typing.Union[None, FileData, OptionData], optionName: str, - optionValueItem: any, + optionValueItem: typing.Any, ): assert isinstance(dataHandler, ConfigurationDataHandler) assert ( @@ -312,7 +312,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def SetOptionValueItem(self, ctx: OptionHandlerCtxToSetValueItem) -> any: + def SetOptionValueItem(self, ctx: OptionHandlerCtxToSetValueItem) -> typing.Any: assert type(ctx) is OptionHandlerCtxToSetValueItem assert ( ctx.TargetData is None @@ -331,14 +331,14 @@ def SetOptionValueItem(self, ctx: OptionHandlerCtxToSetValueItem) -> any: class OptionHandlerCtxToPrepareSetValue: DataHandler: ConfigurationDataHandler OptionName: str - OptionValue: any + OptionValue: typing.Any # -------------------------------------------------------------------- def __init__( self, dataHandler: ConfigurationDataHandler, optionName: str, - optionValue: any, + optionValue: typing.Any, ): assert isinstance(dataHandler, ConfigurationDataHandler) assert type(optionName) is str @@ -370,14 +370,14 @@ def PrepareSetValue(self, ctx: OptionHandlerCtxToPrepareSetValue) -> str: class OptionHandlerCtxToPrepareSetValueItem: DataHandler: ConfigurationDataHandler OptionName: str - OptionValueItem: any + OptionValueItem: typing.Any # -------------------------------------------------------------------- def __init__( self, dataHandler: ConfigurationDataHandler, optionName: str, - optionValueItem: any, + optionValueItem: typing.Any, ): assert isinstance(dataHandler, ConfigurationDataHandler) assert type(optionName) is str @@ -409,14 +409,14 @@ def PrepareSetValueItem(self, ctx: OptionHandlerCtxToPrepareSetValueItem) -> str class OptionHandlerCtxToPrepareGetValue: DataHandler: ConfigurationDataHandler OptionName: str - OptionValue: any + OptionValue: typing.Any # -------------------------------------------------------------------- def __init__( self, dataHandler: ConfigurationDataHandler, optionName: str, - optionValue: any, + optionValue: typing.Any, ): assert isinstance(dataHandler, ConfigurationDataHandler) assert type(optionName) is str @@ -448,14 +448,14 @@ def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> str: class OptionHandlerCtxToWrite: DataHandler: ConfigurationDataHandler OptionName: str - OptionValue: any + OptionValue: typing.Any # -------------------------------------------------------------------- def __init__( self, dataHandler: ConfigurationDataHandler, optionName: str, - optionValue: any, + optionValue: typing.Any, ): assert isinstance(dataHandler, ConfigurationDataHandler) assert type(optionName) is str diff --git a/src/core/helpers.py b/src/core/helpers.py index c5092d8..6f14d8a 100644 --- a/src/core/helpers.py +++ b/src/core/helpers.py @@ -48,7 +48,7 @@ def ExtractFirstOptionFromIndexItem( # -------------------------------------------------------------------- def DoesContainerContainsValue__NotNullAndExact( - container: typing.Iterable, value: any + container: typing.Iterable, value: typing.Any ) -> bool: assert container is not None assert isinstance(container, typing.Iterable) diff --git a/src/core/model.py b/src/core/model.py index 61e009b..1f49ac3 100644 --- a/src/core/model.py +++ b/src/core/model.py @@ -89,11 +89,11 @@ def __init__(self, parent: FileLineData, offset: typing.Optional[int], text: str class OptionData(FileLineElementData): m_Name: str - m_Value: any + m_Value: typing.Any # -------------------------------------------------------------------- def __init__( - self, parent: FileLineData, offset: typing.Optional[int], name: str, value: any + self, parent: FileLineData, offset: typing.Optional[int], name: str, value: typing.Any ): assert type(parent) is FileLineData assert offset is None or type(offset) is int diff --git a/src/core/option/handlers/add/option_handler_to_add__std.py b/src/core/option/handlers/add/option_handler_to_add__std.py index 17ae86e..e0bd710 100644 --- a/src/core/option/handlers/add/option_handler_to_add__std.py +++ b/src/core/option/handlers/add/option_handler_to_add__std.py @@ -9,6 +9,8 @@ from ....handlers import FileData from ....handlers import FileLineData +import typing + # ////////////////////////////////////////////////////////////////////////////// # OptionHandlerToAddOption__Std @@ -18,7 +20,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def AddOption(self, ctx: OptionHandlerCtxToAddOption) -> any: + def AddOption(self, ctx: OptionHandlerCtxToAddOption) -> typing.Any: assert type(ctx) is OptionHandlerCtxToAddOption assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert ( diff --git a/src/core/option/handlers/get_value/option_handler_to_get_value__std__simple.py b/src/core/option/handlers/get_value/option_handler_to_get_value__std__simple.py index 25b81a4..cc32aa5 100644 --- a/src/core/option/handlers/get_value/option_handler_to_get_value__std__simple.py +++ b/src/core/option/handlers/get_value/option_handler_to_get_value__std__simple.py @@ -9,6 +9,8 @@ from ....handlers import FileData from ....handlers import OptionData +import typing + # ////////////////////////////////////////////////////////////////////////////// # OptionHandlerToGetValue__Std__Simple @@ -18,7 +20,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def GetOptionValue(self, ctx: OptionHandlerCtxToGetValue) -> any: + def GetOptionValue(self, ctx: OptionHandlerCtxToGetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToGetValue assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert ( diff --git a/src/core/option/handlers/get_value/option_handler_to_get_value__std__union_list.py b/src/core/option/handlers/get_value/option_handler_to_get_value__std__union_list.py index 93c4013..47a5f95 100644 --- a/src/core/option/handlers/get_value/option_handler_to_get_value__std__union_list.py +++ b/src/core/option/handlers/get_value/option_handler_to_get_value__std__union_list.py @@ -9,6 +9,8 @@ from ....handlers import FileData from ....handlers import OptionData +import typing + # ////////////////////////////////////////////////////////////////////////////// # OptionHandlerToGetValue__Std__UnionList @@ -18,7 +20,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def GetOptionValue(self, ctx: OptionHandlerCtxToGetValue) -> any: + def GetOptionValue(self, ctx: OptionHandlerCtxToGetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToGetValue assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert ( diff --git a/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__bool.py b/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__bool.py index 162e2c1..8cb5e13 100644 --- a/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__bool.py +++ b/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__bool.py @@ -7,6 +7,8 @@ from ....handlers import OptionHandlerCtxToPrepareGetValue from ....handlers import ConfigurationDataHandler +import typing + # ////////////////////////////////////////////////////////////////////////////// # OptionHandlerToPrepareGetValue__Std__Bool @@ -16,7 +18,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> any: + def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToPrepareGetValue assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert type(ctx.OptionName) is str diff --git a/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__generic.py b/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__generic.py index f52b54f..4e95e89 100644 --- a/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__generic.py +++ b/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__generic.py @@ -9,6 +9,8 @@ from ....handlers import OptionHandlerCtxToPrepareGetValue from ....handlers import ConfigurationDataHandler +import typing + # ////////////////////////////////////////////////////////////////////////////// # OptionHandlerToPrepareGetValue__Std__Generic @@ -18,7 +20,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> any: + def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToPrepareGetValue assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert type(ctx.OptionName) is str diff --git a/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__int.py b/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__int.py index 0d6c02d..3aaee18 100644 --- a/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__int.py +++ b/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__int.py @@ -7,6 +7,8 @@ from ....handlers import OptionHandlerCtxToPrepareGetValue from ....handlers import ConfigurationDataHandler +import typing + # ////////////////////////////////////////////////////////////////////////////// # OptionHandlerToPrepareGetValue__Std__Int @@ -16,7 +18,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> any: + def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToPrepareGetValue assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert type(ctx.OptionName) is str diff --git a/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__str.py b/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__str.py index a1a0d50..0a06b32 100644 --- a/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__str.py +++ b/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__str.py @@ -7,6 +7,8 @@ from ....handlers import OptionHandlerCtxToPrepareGetValue from ....handlers import ConfigurationDataHandler +import typing + # ////////////////////////////////////////////////////////////////////////////// # OptionHandlerToPrepareGetValue__Std__Str @@ -16,7 +18,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> any: + def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToPrepareGetValue assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert type(ctx.OptionName) is str diff --git a/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__unique_str_list.py b/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__unique_str_list.py index ae45e92..87e05ce 100644 --- a/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__unique_str_list.py +++ b/src/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__unique_str_list.py @@ -20,7 +20,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> any: + def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToPrepareGetValue assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert type(ctx.OptionName) is str diff --git a/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__bool.py b/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__bool.py index 04606d5..384edb0 100644 --- a/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__bool.py +++ b/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__bool.py @@ -39,7 +39,7 @@ def __init__(self): ) # interface ---------------------------------------------------------- - def PrepareSetValue(self, ctx: OptionHandlerCtxToPrepareSetValue) -> any: + def PrepareSetValue(self, ctx: OptionHandlerCtxToPrepareSetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToPrepareSetValue assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert type(ctx.OptionName) is str diff --git a/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__generic.py b/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__generic.py index 6d81ca1..479d869 100644 --- a/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__generic.py +++ b/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__generic.py @@ -9,6 +9,8 @@ from ....handlers import OptionHandlerCtxToPrepareSetValue from ....handlers import ConfigurationDataHandler +import typing + # ////////////////////////////////////////////////////////////////////////////// # OptionHandlerToPrepareSetValue__Std__Generic @@ -18,7 +20,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def PrepareSetValue(self, ctx: OptionHandlerCtxToPrepareSetValue) -> any: + def PrepareSetValue(self, ctx: OptionHandlerCtxToPrepareSetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToPrepareSetValue assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert type(ctx.OptionName) is str diff --git a/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__int.py b/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__int.py index f33fb4a..f711c44 100644 --- a/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__int.py +++ b/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__int.py @@ -9,6 +9,8 @@ from ....handlers import OptionHandlerCtxToPrepareSetValue from ....handlers import ConfigurationDataHandler +import typing + # ////////////////////////////////////////////////////////////////////////////// # OptionHandlerToPrepareSetValue__Std__Int @@ -18,7 +20,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def PrepareSetValue(self, ctx: OptionHandlerCtxToPrepareSetValue) -> any: + def PrepareSetValue(self, ctx: OptionHandlerCtxToPrepareSetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToPrepareSetValue assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert type(ctx.OptionName) is str diff --git a/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__str.py b/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__str.py index 51ddc44..1dc2cce 100644 --- a/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__str.py +++ b/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__str.py @@ -9,6 +9,8 @@ from ....handlers import OptionHandlerCtxToPrepareSetValue from ....handlers import ConfigurationDataHandler +import typing + # ////////////////////////////////////////////////////////////////////////////// # OptionHandlerToPrepareSetValue__Std__Str @@ -18,7 +20,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def PrepareSetValue(self, ctx: OptionHandlerCtxToPrepareSetValue) -> any: + def PrepareSetValue(self, ctx: OptionHandlerCtxToPrepareSetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToPrepareSetValue assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert type(ctx.OptionName) is str diff --git a/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__unique_str_list.py b/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__unique_str_list.py index 78d1854..b06b7a5 100755 --- a/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__unique_str_list.py +++ b/src/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__unique_str_list.py @@ -24,7 +24,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def PrepareSetValue(self, ctx: OptionHandlerCtxToPrepareSetValue) -> any: + def PrepareSetValue(self, ctx: OptionHandlerCtxToPrepareSetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToPrepareSetValue assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert type(ctx.OptionName) is str diff --git a/src/core/option/handlers/prepare_set_value_item/option_handler_to_prepare_set_value_item__std__str.py b/src/core/option/handlers/prepare_set_value_item/option_handler_to_prepare_set_value_item__std__str.py index bc610fc..9f9fcb9 100644 --- a/src/core/option/handlers/prepare_set_value_item/option_handler_to_prepare_set_value_item__std__str.py +++ b/src/core/option/handlers/prepare_set_value_item/option_handler_to_prepare_set_value_item__std__str.py @@ -9,6 +9,8 @@ from ....handlers import OptionHandlerCtxToPrepareSetValueItem from ....handlers import ConfigurationDataHandler +import typing + # ////////////////////////////////////////////////////////////////////////////// # OptionHandlerToPrepareSetValueItem__Std__Str @@ -18,7 +20,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def PrepareSetValueItem(self, ctx: OptionHandlerCtxToPrepareSetValueItem) -> any: + def PrepareSetValueItem(self, ctx: OptionHandlerCtxToPrepareSetValueItem) -> typing.Any: assert type(ctx) is OptionHandlerCtxToPrepareSetValueItem assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert type(ctx.OptionName) is str diff --git a/src/core/option/handlers/set_value/option_handler_to_set_value__std__simple.py b/src/core/option/handlers/set_value/option_handler_to_set_value__std__simple.py index b12eeeb..1357bca 100644 --- a/src/core/option/handlers/set_value/option_handler_to_set_value__std__simple.py +++ b/src/core/option/handlers/set_value/option_handler_to_set_value__std__simple.py @@ -10,6 +10,8 @@ from ....model import FileData from ....model import OptionData +import typing + # ////////////////////////////////////////////////////////////////////////////// # OptionHandlerToSetValue__Std__Simple @@ -19,7 +21,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def SetOptionValue(self, ctx: OptionHandlerCtxToSetValue) -> any: + def SetOptionValue(self, ctx: OptionHandlerCtxToSetValue) -> typing.Any: assert type(ctx) is OptionHandlerCtxToSetValue assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert ( diff --git a/src/core/option/handlers/set_value_item/option_handler_to_set_value_item__std__unique.py b/src/core/option/handlers/set_value_item/option_handler_to_set_value_item__std__unique.py index 3a49193..71a8dc6 100644 --- a/src/core/option/handlers/set_value_item/option_handler_to_set_value_item__std__unique.py +++ b/src/core/option/handlers/set_value_item/option_handler_to_set_value_item__std__unique.py @@ -10,6 +10,8 @@ from ....model import FileData from ....model import OptionData +import typing + # ////////////////////////////////////////////////////////////////////////////// # OptionHandlerToSetValueItem__Std__Unique @@ -19,7 +21,7 @@ def __init__(self): super().__init__() # interface ---------------------------------------------------------- - def SetOptionValueItem(self, ctx: OptionHandlerCtxToSetValueItem) -> any: + def SetOptionValueItem(self, ctx: OptionHandlerCtxToSetValueItem) -> typing.Any: assert type(ctx) is OptionHandlerCtxToSetValueItem assert isinstance(ctx.DataHandler, ConfigurationDataHandler) assert ( diff --git a/src/core/raise_error.py b/src/core/raise_error.py index e9a5b9d..6dc8396 100644 --- a/src/core/raise_error.py +++ b/src/core/raise_error.py @@ -2,6 +2,8 @@ # Postgres Pro. PostgreSQL Configuration Python Library. import datetime +import typing + # ////////////////////////////////////////////////////////////////////////////// # RaiseError @@ -192,7 +194,7 @@ def OptionIsAlreadyExistInFile(filePath: str, optionName: str): # -------------------------------------------------------------------- @staticmethod - def OptionValueItemIsAlreadyDefined(filePath: str, optName: str, valueItem: any): + def OptionValueItemIsAlreadyDefined(filePath: str, optName: str, valueItem: typing.Any): assert type(filePath) is str assert type(optName) is str @@ -204,7 +206,7 @@ def OptionValueItemIsAlreadyDefined(filePath: str, optName: str, valueItem: any) # -------------------------------------------------------------------- @staticmethod def OptionValueItemIsAlreadyDefinedInAnotherFile( - filePath: str, optName: str, valueItem: any + filePath: str, optName: str, valueItem: typing.Any ): assert type(filePath) is str assert type(optName) is str diff --git a/src/implementation/v00/configuration_base.py b/src/implementation/v00/configuration_base.py index 770de8f..b72f50e 100644 --- a/src/implementation/v00/configuration_base.py +++ b/src/implementation/v00/configuration_base.py @@ -178,7 +178,7 @@ def get_Name(self) -> str: return self.m_OptionData.m_Name # -------------------------------------------------------------------- - def get_Value(self) -> any: + def get_Value(self) -> typing.Any: self.Helper__CheckAlive() configuration = self.m_FileLine.get_Configuration() @@ -194,7 +194,7 @@ def get_Value(self) -> any: return r # -------------------------------------------------------------------- - def set_Value(self, value: any) -> PostgresConfigurationSetOptionValueResult_Base: + def set_Value(self, value: typing.Any) -> PostgresConfigurationSetOptionValueResult_Base: self.Helper__CheckAlive() configuration = self.m_FileLine.get_Configuration() @@ -223,7 +223,7 @@ def set_Value(self, value: any) -> PostgresConfigurationSetOptionValueResult_Bas # -------------------------------------------------------------------- def set_ValueItem( - self, value_item: any + self, value_item: typing.Any ) -> PostgresConfigurationSetOptionValueResult: self.Helper__CheckAlive() @@ -426,7 +426,7 @@ def AddComment( # -------------------------------------------------------------------- def AddOption( - self, name: str, value: any, offset: typing.Optional[int] + self, name: str, value: typing.Any, offset: typing.Optional[int] ) -> PostgresConfigurationOption_Base: DataVerificator.CheckOptionName(name) @@ -789,7 +789,7 @@ def AddComment(self, text: str) -> PostgresConfigurationComment_Base: return fileLineComment # -------------------------------------------------------------------- - def AddOption(self, name: str, value: any) -> PostgresConfigurationOption_Base: + def AddOption(self, name: str, value: typing.Any) -> PostgresConfigurationOption_Base: DataVerificator.CheckOptionName(name) assert name is not None @@ -895,7 +895,7 @@ def AddInclude(self, path: str) -> PostgresConfigurationInclude_Base: # PostgresConfigurationSetOptionValueResult_Base. # def SetOptionValue( - self, name: str, value: any + self, name: str, value: typing.Any ) -> PostgresConfigurationSetOptionValueResult_Base: self.Internal__CheckAlive() @@ -922,7 +922,7 @@ def SetOptionValue( # - Value of option. # - None if option is not found in this file. # - def GetOptionValue(self, name: str) -> any: + def GetOptionValue(self, name: str) -> typing.Any: self.Internal__CheckAlive() DataVerificator.CheckOptionName(name) @@ -935,7 +935,7 @@ def GetOptionValue(self, name: str) -> any: # -------------------------------------------------------------------- def SetOptionValueItem( - self, name: str, value_item: any + self, name: str, value_item: typing.Any ) -> PostgresConfigurationSetOptionValueResult_Base: self.Internal__CheckAlive() @@ -1441,7 +1441,7 @@ def AddTopLevelFile(self, path: str) -> PostgresConfigurationTopLevelFile_Base: return file # -------------------------------------------------------------------- - def AddOption(self, name: str, value: any) -> PostgresConfigurationOption_Base: + def AddOption(self, name: str, value: typing.Any) -> PostgresConfigurationOption_Base: DataVerificator.CheckOptionName(name) assert name is not None @@ -1462,7 +1462,7 @@ def AddOption(self, name: str, value: any) -> PostgresConfigurationOption_Base: # -------------------------------------------------------------------- def SetOptionValue( - self, name: str, value: any + self, name: str, value: typing.Any ) -> PostgresConfigurationSetOptionValueResult_Base: DataVerificator.CheckOptionName(name) @@ -1480,7 +1480,7 @@ def SetOptionValue( return result # -------------------------------------------------------------------- - def GetOptionValue(self, name: str) -> any: + def GetOptionValue(self, name: str) -> typing.Any: DataVerificator.CheckOptionName(name) r = PostgresConfigurationController__Base.GetOptionValue(self, None, name) @@ -1489,7 +1489,7 @@ def GetOptionValue(self, name: str) -> any: # -------------------------------------------------------------------- def SetOptionValueItem( - self, name: str, value_item: any + self, name: str, value_item: typing.Any ) -> PostgresConfigurationSetOptionValueResult_Base: DataVerificator.CheckOptionName(name) @@ -1534,7 +1534,7 @@ def DataHandler__SetOptionValue__Simple( self, targetData: typing.Union[None, PgCfgModel__FileData, PgCfgModel__OptionData], optionName: str, - optionValue: any, + optionValue: typing.Any, ) -> PostgresConfigurationSetOptionValueResult_Base: assert ( targetData is None @@ -1569,7 +1569,7 @@ def DataHandler__GetOptionValue__Simple( self, sourceData: typing.Union[None, PgCfgModel__FileData, PgCfgModel__OptionData], optionName: str, - ) -> any: + ) -> typing.Any: assert ( sourceData is None or type(sourceData) is PgCfgModel__FileData @@ -1635,7 +1635,7 @@ def DataHandler__GetOptionValue__UnionList( None, PgCfgModel__FileLineData, PgCfgModel__OptionData ], optionName: str, - ) -> any: + ) -> typing.Any: assert ( sourceData is None or type(sourceData) is PgCfgModel__FileData @@ -1755,7 +1755,7 @@ def DataHandler__AddSimpleOption( target: typing.Union[None, PgCfgModel__FileData, PgCfgModel__FileLineData], optionOffset: typing.Optional[int], optionName: str, - optionValue: any, + optionValue: typing.Any, ) -> PostgresConfigurationOption_Base: assert ( target is None @@ -1793,7 +1793,7 @@ def DataHandler__SetUniqueOptionValueItem( self, targetData: typing.Union[None, PgCfgModel__FileData, PgCfgModel__OptionData], optionName: str, - optionValueItem: any, + optionValueItem: typing.Any, ) -> PostgresConfigurationSetOptionValueResult_Base: assert ( targetData is None @@ -2099,7 +2099,7 @@ def Helper__FindFile(self, file_name: str) -> PgCfgModel__FileData: BugCheckError.UnkFileObjectDataType(file_name_n, type(data)) # -------------------------------------------------------------------- - def Helper__PrepareGetValue(self, optionName: str, optionValue: any) -> any: + def Helper__PrepareGetValue(self, optionName: str, optionValue: typing.Any) -> typing.Any: assert optionName is not None assert optionValue is not None assert type(optionName) is str @@ -2118,7 +2118,7 @@ def Helper__PrepareGetValue(self, optionName: str, optionValue: any) -> any: def Helper__AddSimpleOption__Common( self, optionName: str, - optionValue: any, + optionValue: typing.Any, ) -> PostgresConfigurationOption_Base: assert type(optionName) is str assert optionValue is not None @@ -2216,7 +2216,7 @@ def Helper__AddSimpleOption__FileLine( fileLineData: PgCfgModel__FileLineData, optionOffset: typing.Optional[int], optionName: str, - optionValue: any, + optionValue: typing.Any, ): assert fileLineData is not None assert type(fileLineData) is PgCfgModel__FileLineData @@ -2303,7 +2303,7 @@ def Helper__AddSimpleOption__File( self, fileData: PgCfgModel__FileData, optionName: str, - optionValue: any, + optionValue: typing.Any, ): assert fileData is not None assert type(fileData) is PgCfgModel__FileData @@ -2386,7 +2386,7 @@ def Helper__AddSimpleOption__File( def Helper__SetSimpleOptionValue__Common( self, optionName: str, - optionValue: any, + optionValue: typing.Any, ) -> PostgresConfigurationSetOptionValueResult_Base: assert type(optionName) is str assert optionValue is not None @@ -2433,7 +2433,7 @@ def Helper__SetSimpleOptionValue__File( self, fileData: PgCfgModel__FileData, optionName: str, - optionValue: any, + optionValue: typing.Any, ) -> PostgresConfigurationSetOptionValueResult_Base: assert type(fileData) is PgCfgModel__FileData assert type(fileData.m_OptionsByName) is dict @@ -2495,7 +2495,7 @@ def Helper__SetSimpleOptionValue__File( def Helper__SetSimpleOptionValue__Exact( self, optionData: PgCfgModel__OptionData, - optionValue: any, + optionValue: typing.Any, ) -> PostgresConfigurationSetOptionValueResult_Base: assert type(optionData) is PgCfgModel__OptionData assert optionData.IsAlive() @@ -2515,7 +2515,7 @@ def Helper__SetSimpleOptionValue__Exact( def Helper__SetUniqueOptionValueItem__Common( self, optionName: str, - optionValueItem: any, + optionValueItem: typing.Any, ) -> PostgresConfigurationSetOptionValueResult_Base: assert type(optionName) is str assert optionValueItem is not None @@ -2605,7 +2605,7 @@ def Helper__SetUniqueOptionValueItem__Common( def Helper__SetUniqueOptionValueItem__Exact( self, optionData: PgCfgModel__OptionData, - optionValueItem: any, + optionValueItem: typing.Any, ) -> PostgresConfigurationSetOptionValueResult_Base: assert type(optionData) is PgCfgModel__OptionData assert optionData.IsAlive() @@ -2619,7 +2619,7 @@ def Helper__SetUniqueOptionValueItem__Exact( def Helper__SetUniqueOptionPreparedValueItem__Exact( self, optionData: PgCfgModel__OptionData, - optionPreparedValueItem: any, + optionPreparedValueItem: typing.Any, ) -> PostgresConfigurationSetOptionValueResult_Base: assert type(optionData) is PgCfgModel__OptionData assert optionData.IsAlive() @@ -2699,7 +2699,7 @@ def Helper__SetUniqueOptionValueItem__File( self, fileData: PgCfgModel__FileData, optionName: str, - optionValueItem: any, + optionValueItem: typing.Any, ) -> PostgresConfigurationSetOptionValueResult_Base: assert type(fileData) is PgCfgModel__FileData assert type(optionName) is str @@ -2869,7 +2869,7 @@ def Helper__SetUniqueOptionValueItem__File( def Helper__FinalRegSimpleOptionValue__Common( self, optionName: str, - preparedOptionValue: any, + preparedOptionValue: typing.Any, ) -> PostgresConfigurationSetOptionValueResult_Base: assert type(optionName) is str assert preparedOptionValue is not None @@ -2925,7 +2925,7 @@ def Helper__FinalRegSimpleOptionValue__File( self, fileData: PgCfgModel__FileData, optionName: str, - preparedOptionValue: any, + preparedOptionValue: typing.Any, ) -> PostgresConfigurationSetOptionValueResult_Base: assert type(fileData) is PgCfgModel__FileData assert type(optionName) is str @@ -2987,7 +2987,7 @@ def Helper__FinalRegSimpleOptionValue__File( # -------------------------------------------------------------------- def Helper__DoesOptionValueAlreadyHaveThisUniqueItem( - optionData: PgCfgModel__OptionData, optionValueItem: any + optionData: PgCfgModel__OptionData, optionValueItem: typing.Any ) -> bool: assert optionData is not None assert optionValueItem is not None @@ -4230,7 +4230,7 @@ def AddOption( cfg: PostgresConfiguration_Base, target: typing.Union[None, PgCfgModel__FileData, PgCfgModel__FileLineData], optionName: str, - optionValue: any, + optionValue: typing.Any, optionOffset: typing.Union[int], ) -> PostgresConfigurationOption_Base: assert isinstance(cfg, PostgresConfiguration_Base) @@ -4273,7 +4273,7 @@ def SetOptionValue( cfg: PostgresConfiguration_Base, targetData: typing.Union[None, PgCfgModel__FileData, PgCfgModel__OptionData], optionName: str, - optionValue: any, + optionValue: typing.Any, optionOffset: typing.Union[int], ) -> PostgresConfigurationSetOptionValueResult_Base: assert isinstance(cfg, PostgresConfiguration_Base) @@ -4321,7 +4321,7 @@ def SetOptionValueItem( cfg: PostgresConfiguration_Base, targetData: typing.Union[None, PgCfgModel__FileData, PgCfgModel__OptionData], optionName: str, - optionValueItem: any, + optionValueItem: typing.Any, ) -> PostgresConfigurationSetOptionValueResult_Base: assert isinstance(cfg, PostgresConfiguration_Base) assert ( @@ -4367,7 +4367,7 @@ def GetOptionValue( cfg: PostgresConfiguration_Base, sourceData: typing.Union[None, PgCfgModel__FileData, PgCfgModel__OptionData], optionName: str, - ) -> any: + ) -> typing.Any: assert isinstance(cfg, PostgresConfiguration_Base) assert ( sourceData is None @@ -4387,8 +4387,8 @@ def GetOptionValue( # Helper methods ----------------------------------------------------- def Helper__PrepareSetValue( - cfg: PostgresConfiguration_Base, optionName: str, optionValue: any - ) -> any: + cfg: PostgresConfiguration_Base, optionName: str, optionValue: typing.Any + ) -> typing.Any: assert isinstance(cfg, PostgresConfiguration_Base) assert type(optionName) is str assert optionValue is not None @@ -4405,8 +4405,8 @@ def Helper__PrepareSetValue( # -------------------------------------------------------------------- def Helper__PrepareSetValueItem( - cfg: PostgresConfiguration_Base, optionName: str, optionValueItem: any - ) -> any: + cfg: PostgresConfiguration_Base, optionName: str, optionValueItem: typing.Any + ) -> typing.Any: assert isinstance(cfg, PostgresConfiguration_Base) assert type(optionName) is str assert optionValueItem is not None diff --git a/tests/ErrorMessageBuilder.py b/tests/ErrorMessageBuilder.py index 3f2580e..0580697 100644 --- a/tests/ErrorMessageBuilder.py +++ b/tests/ErrorMessageBuilder.py @@ -2,6 +2,7 @@ # Postgres Pro. PostgreSQL Configuration Python Library. Tests import datetime +import typing # ////////////////////////////////////////////////////////////////////////////// @@ -193,7 +194,7 @@ def OptionIsAlreadyExistInFile(filePath: str, optionName: str): # -------------------------------------------------------------------- @staticmethod - def OptionValueItemIsAlreadyDefined(filePath: str, optName: str, valueItem: any): + def OptionValueItemIsAlreadyDefined(filePath: str, optName: str, valueItem: typing.Any): assert type(filePath) is str assert type(optName) is str @@ -205,7 +206,7 @@ def OptionValueItemIsAlreadyDefined(filePath: str, optName: str, valueItem: any) # -------------------------------------------------------------------- @staticmethod def OptionValueItemIsAlreadyDefinedInAnotherFile( - filePath: str, optName: str, valueItem: any + filePath: str, optName: str, valueItem: typing.Any ): assert type(filePath) is str assert type(optName) is str diff --git a/tests/TestGlobalCache.py b/tests/TestGlobalCache.py index ac521c1..e34361e 100644 --- a/tests/TestGlobalCache.py +++ b/tests/TestGlobalCache.py @@ -13,7 +13,7 @@ class TestGlobalCache: sm_Guard = threading.Lock() - sm_Dict: typing.Dict[str, any] = dict() + sm_Dict: typing.Dict[str, typing.Any] = dict() # -------------------------------------------------------------------- def __init__(self): @@ -21,7 +21,7 @@ def __init__(self): # -------------------------------------------------------------------- @staticmethod - def GetOrCreateResource(globalResourceID: str, resourceFactory) -> any: + def GetOrCreateResource(globalResourceID: str, resourceFactory) -> typing.Any: assert resourceFactory is not None assert isinstance(globalResourceID, str) assert __class__.sm_Guard is not None @@ -47,7 +47,7 @@ def ReleaseAllResources(): assert type(__class__.sm_Dict) is dict with __class__.sm_Guard: - emptyDict: typing.Dict[str, any] = dict() + emptyDict: typing.Dict[str, typing.Any] = dict() assert type(emptyDict) is dict curDict = __class__.sm_Dict diff --git a/tests/conftest.py b/tests/conftest.py index 1078a16..e837015 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -576,7 +576,7 @@ def pytest_runtest_makereport(item: pytest.Function, call: pytest.CallInfo): class LogWrapper2: - _old_method: any + _old_method: typing.Any _err_counter: typing.Optional[int] _warn_counter: typing.Optional[int] diff --git a/tests/implementation/v00/configuration_std/Mix/test_set001__generic_support_of_options.py b/tests/implementation/v00/configuration_std/Mix/test_set001__generic_support_of_options.py index 8a48bda..32293d4 100644 --- a/tests/implementation/v00/configuration_std/Mix/test_set001__generic_support_of_options.py +++ b/tests/implementation/v00/configuration_std/Mix/test_set001__generic_support_of_options.py @@ -19,7 +19,7 @@ class TestSet001__GenericSupportOfOptions: - sm_data001: typing.List[typing.Tuple[str, any, any]] = [ + sm_data001: typing.List[typing.Tuple[str, typing.Any, typing.Any]] = [ ("int", 0, 0), ("str__empty", "", ""), ("bool_prop_true", True, True), @@ -28,7 +28,7 @@ class TestSet001__GenericSupportOfOptions: # -------------------------------------------------------------------- @pytest.fixture(params=sm_data001, ids=[x[0] for x in sm_data001]) - def data001(self, request: pytest.FixtureRequest) -> typing.Tuple[any, any]: + def data001(self, request: pytest.FixtureRequest) -> typing.Tuple[typing.Any, typing.Any]: assert isinstance(request, pytest.FixtureRequest) assert type(request.param) is tuple assert len(request.param) == 3 @@ -36,7 +36,7 @@ def data001(self, request: pytest.FixtureRequest) -> typing.Tuple[any, any]: # -------------------------------------------------------------------- def test_001__set_get( - self, request: pytest.FixtureRequest, data001: typing.Tuple[any, any] + self, request: pytest.FixtureRequest, data001: typing.Tuple[typing.Any, typing.Any] ): assert isinstance(request, pytest.FixtureRequest) @@ -50,7 +50,7 @@ def test_001__set_get( assert cfg.GetOptionValue("a") == data001[1] # -------------------------------------------------------------------- - sm_data002: typing.List[typing.Tuple[str, any, any]] = [ + sm_data002: typing.List[typing.Tuple[str, typing.Any, typing.Any]] = [ ("int", 0, "0"), ("str__empty", "", ""), ("bool_prop_true", True, "on"), @@ -59,7 +59,7 @@ def test_001__set_get( # -------------------------------------------------------------------- @pytest.fixture(params=sm_data002, ids=[x[0] for x in sm_data002]) - def data002(self, request: pytest.FixtureRequest) -> typing.Tuple[any, any]: + def data002(self, request: pytest.FixtureRequest) -> typing.Tuple[typing.Any, typing.Any]: assert isinstance(request, pytest.FixtureRequest) assert type(request.param) is tuple assert len(request.param) == 3 @@ -67,7 +67,7 @@ def data002(self, request: pytest.FixtureRequest) -> typing.Tuple[any, any]: # -------------------------------------------------------------------- def test_002__write_and_read( - self, request: pytest.FixtureRequest, data002: typing.Tuple[any, any] + self, request: pytest.FixtureRequest, data002: typing.Tuple[typing.Any, typing.Any] ): assert isinstance(request, pytest.FixtureRequest) assert type(data002) is tuple diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValue/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValue/test_set001__common.py index ee6e6fd..f3be455 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValue/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValue/test_set001__common.py @@ -90,7 +90,7 @@ def test_002__port___reasign(self, request: pytest.FixtureRequest, optName: str) # -------------------------------------------------------------------- def Helper__CheckStateOfCfgWithOneOpt( - cfg: PgCfg_Std, opt: PgCfg_Option_Base, optName: str, optValue: any + cfg: PgCfg_Std, opt: PgCfg_Option_Base, optName: str, optValue: typing.Any ): assert type(cfg.m_Data) is PgCfgModel__ConfigurationData assert type(opt) is PgCfg_Option_Base @@ -406,14 +406,14 @@ def test_011__empty_name(self, request: pytest.FixtureRequest): cfg.SetOptionValue("", 123) # -------------------------------------------------------------------- - sm_data012__values: typing.List[typing.Tuple[str, str, any, any]] = [ + sm_data012__values: typing.List[typing.Tuple[str, str, typing.Any, typing.Any]] = [ ("port-int_int", "port", 123, 123), ("port-str_int", "port", "321", 321), ] # -------------------------------------------------------------------- @pytest.fixture(params=sm_data012__values, ids=[x[0] for x in sm_data012__values]) - def data012(self, request: pytest.FixtureRequest) -> typing.Tuple[str, any, any]: + def data012(self, request: pytest.FixtureRequest) -> typing.Tuple[str, typing.Any, typing.Any]: assert isinstance(request, pytest.FixtureRequest) assert type(request.param) is tuple assert len(request.param) == 4 @@ -422,7 +422,7 @@ def data012(self, request: pytest.FixtureRequest) -> typing.Tuple[str, any, any] # -------------------------------------------------------------------- def test_012__one_opt( - self, request: pytest.FixtureRequest, data012: typing.Tuple[str, any, any] + self, request: pytest.FixtureRequest, data012: typing.Tuple[str, typing.Any, typing.Any] ): assert isinstance(request, pytest.FixtureRequest) assert type(data012) is tuple diff --git a/tests/implementation/v00/configuration_std/Options/STD/generic/bool_option/test_set001__common.py b/tests/implementation/v00/configuration_std/Options/STD/generic/bool_option/test_set001__common.py index c90e1f9..2093079 100644 --- a/tests/implementation/v00/configuration_std/Options/STD/generic/bool_option/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Options/STD/generic/bool_option/test_set001__common.py @@ -37,10 +37,10 @@ def optionName(self, request: pytest.FixtureRequest) -> str: # -------------------------------------------------------------------- class tagData001: - set_value: any + set_value: typing.Any get_value: bool - def __init__(self, set_value: any, get_value: bool): + def __init__(self, set_value: typing.Any, get_value: bool): self.set_value = set_value self.get_value = get_value @@ -141,9 +141,9 @@ def test_001__ok(self, optionName: str): # -------------------------------------------------------------------- class tagData002: - set_value: any + set_value: typing.Any - def __init__(self, set_value: any): + def __init__(self, set_value: typing.Any): self.set_value = set_value # -------------------------------------------------------------------- @@ -192,9 +192,9 @@ def test_002__cant_convert_value(self, optionName: str): # -------------------------------------------------------------------- class tagData003: - set_value: any + set_value: typing.Any - def __init__(self, set_value: any): + def __init__(self, set_value: typing.Any): self.set_value = set_value # -------------------------------------------------------------------- @@ -282,10 +282,10 @@ def __init__(self, sign: str, quote1: str, quote2: str): # -------------------------------------------------------------------- class tagData101_Value: - source: any + source: typing.Any result: bool - def __init__(self, source: any, result: bool): + def __init__(self, source: typing.Any, result: bool): self.source = source self.result = result