Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/abstract/v00/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 != ""
Expand Down Expand Up @@ -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
Expand All @@ -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 != ""
Expand All @@ -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 != ""
Expand Down Expand Up @@ -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
Expand All @@ -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")
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/core/bugcheck_error.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# //////////////////////////////////////////////////////////////////////////////
# Postgres Pro. PostgreSQL Configuration Python Library.

import typing


# //////////////////////////////////////////////////////////////////////////////
# BugCheckError
Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/core/controller_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@

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

optionData.m_Value = value

# --------------------------------------------------------------------
@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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
54 changes: 27 additions & 27 deletions src/core/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
)
Expand All @@ -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
Expand Down Expand Up @@ -134,15 +134,15 @@ class OptionHandlerCtxToSetValue:
DataHandler: ConfigurationDataHandler
TargetData: typing.Union[None, FileData, OptionData]
OptionName: str
OptionValue: any
OptionValue: typing.Any

# --------------------------------------------------------------------
def __init__(
self,
dataHandler: ConfigurationDataHandler,
targetData: typing.Union[None, FileData, OptionData],
optionName: str,
optionValue: any,
optionValue: typing.Any,
):
assert isinstance(dataHandler, ConfigurationDataHandler)
assert (
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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__(
Expand All @@ -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 (
Expand All @@ -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")

Expand All @@ -279,15 +279,15 @@ class OptionHandlerCtxToSetValueItem:
DataHandler: ConfigurationDataHandler
TargetData: typing.Union[None, FileData, OptionData]
OptionName: str
OptionValueItem: any
OptionValueItem: typing.Any

# --------------------------------------------------------------------
def __init__(
self,
dataHandler: ConfigurationDataHandler,
targetData: typing.Union[None, FileData, OptionData],
optionName: str,
optionValueItem: any,
optionValueItem: typing.Any,
):
assert isinstance(dataHandler, ConfigurationDataHandler)
assert (
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/core/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading