Skip to content

Commit befcce5

Browse files
fix: Usage "typing.Any" instead "any" (#22)
1 parent 4c96037 commit befcce5

30 files changed

Lines changed: 159 additions & 128 deletions

src/abstract/v00/configuration.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,16 @@ def get_Name(self) -> str:
9898
RaiseError.MethodIsNotImplemented(__class__, "get_Name")
9999

100100
# --------------------------------------------------------------------
101-
def get_Value(self) -> any:
101+
def get_Value(self) -> typing.Any:
102102
RaiseError.MethodIsNotImplemented(__class__, "get_Value")
103103

104104
# --------------------------------------------------------------------
105-
def set_Value(self, value: any) -> PostgresConfigurationSetOptionValueResult:
105+
def set_Value(self, value: typing.Any) -> PostgresConfigurationSetOptionValueResult:
106106
RaiseError.MethodIsNotImplemented(__class__, "set_Value")
107107

108108
# --------------------------------------------------------------------
109109
def set_ValueItem(
110-
self, value_item: any
110+
self, value_item: typing.Any
111111
) -> PostgresConfigurationSetOptionValueResult:
112112
assert value_item is not None
113113
RaiseError.MethodIsNotImplemented(__class__, "set_ValueItem")
@@ -188,7 +188,7 @@ def AddComment(
188188

189189
# --------------------------------------------------------------------
190190
def AddOption(
191-
self, name: str, value: any, offset: typing.Optional[int]
191+
self, name: str, value: typing.Any, offset: typing.Optional[int]
192192
) -> PostgresConfigurationOption:
193193
assert type(name) is str
194194
assert name != ""
@@ -275,7 +275,7 @@ def AddComment(self, text: str) -> PostgresConfigurationComment:
275275
RaiseError.MethodIsNotImplemented(__class__, "AddComment")
276276

277277
# --------------------------------------------------------------------
278-
def AddOption(self, name: str, value: any) -> PostgresConfigurationOption:
278+
def AddOption(self, name: str, value: typing.Any) -> PostgresConfigurationOption:
279279
assert type(name) is str
280280
assert name != ""
281281
assert value is not None
@@ -299,7 +299,7 @@ def AddInclude(self, path: str) -> PostgresConfigurationInclude:
299299
# PostgresConfigurationSetOptionValueResult object.
300300
#
301301
def SetOptionValue(
302-
self, name: str, value: any
302+
self, name: str, value: typing.Any
303303
) -> PostgresConfigurationSetOptionValueResult:
304304
assert type(name) is str
305305
assert name != ""
@@ -313,13 +313,13 @@ def SetOptionValue(
313313
# - Value of option.
314314
# - None if option is not found in this file.
315315
#
316-
def GetOptionValue(self, name: str) -> any:
316+
def GetOptionValue(self, name: str) -> typing.Any:
317317
assert type(name) is str
318318
RaiseError.MethodIsNotImplemented(__class__, "GetOptionValue")
319319

320320
# --------------------------------------------------------------------
321321
def SetOptionValueItem(
322-
self, name: str, value_item: any
322+
self, name: str, value_item: typing.Any
323323
) -> PostgresConfigurationSetOptionValueResult:
324324
assert type(name) is str
325325
assert name != ""
@@ -380,7 +380,7 @@ def AddTopLevelFile(self, path: str) -> PostgresConfigurationFile:
380380
RaiseError.MethodIsNotImplemented(__class__, "AddTopLevelFile")
381381

382382
# --------------------------------------------------------------------
383-
def AddOption(self, name: str, value: any) -> PostgresConfigurationOption:
383+
def AddOption(self, name: str, value: typing.Any) -> PostgresConfigurationOption:
384384
assert type(name) is str
385385
assert name != ""
386386
assert value is not None
@@ -398,7 +398,7 @@ def AddOption(self, name: str, value: any) -> PostgresConfigurationOption:
398398
# PostgresConfigurationSetOptionValueResult object.
399399
#
400400
def SetOptionValue(
401-
self, name: str, value: any
401+
self, name: str, value: typing.Any
402402
) -> PostgresConfigurationSetOptionValueResult:
403403
assert type(name) is str
404404
RaiseError.MethodIsNotImplemented(__class__, "SetOptionValue")
@@ -411,13 +411,13 @@ def SetOptionValue(
411411
# - Value of option.
412412
# - None if option is not found.
413413
#
414-
def GetOptionValue(self, name: str) -> any:
414+
def GetOptionValue(self, name: str) -> typing.Any:
415415
assert type(name) is str
416416
RaiseError.MethodIsNotImplemented(__class__, "GetOptionValue")
417417

418418
# --------------------------------------------------------------------
419419
def SetOptionValueItem(
420-
self, name: str, value_item: any
420+
self, name: str, value_item: typing.Any
421421
) -> PostgresConfigurationSetOptionValueResult:
422422
assert type(name) is str
423423
assert value_item is not None

src/core/bugcheck_error.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# //////////////////////////////////////////////////////////////////////////////
22
# Postgres Pro. PostgreSQL Configuration Python Library.
33

4+
import typing
5+
46

57
# //////////////////////////////////////////////////////////////////////////////
68
# BugCheckError
@@ -67,7 +69,7 @@ def UnkFileObjectDataType(fileName: str, fileDataType: type):
6769

6870
# --------------------------------------------------------------------
6971
@staticmethod
70-
def UnkFileDataStatus(filePath: str, fileStatus: any):
72+
def UnkFileDataStatus(filePath: str, fileStatus: typing.Any):
7173
assert type(filePath) is str
7274
assert fileStatus is not None
7375

src/core/controller_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828

2929
class DataControllerUtils:
3030
@staticmethod
31-
def Option__set_Value(optionData: PgCfgModel__OptionData, value: any):
31+
def Option__set_Value(optionData: PgCfgModel__OptionData, value: typing.Any):
3232
assert type(optionData) is PgCfgModel__OptionData
3333
assert value is not None
3434

3535
optionData.m_Value = value
3636

3737
# --------------------------------------------------------------------
3838
@staticmethod
39-
def Option__add_ValueItem(optionData: PgCfgModel__OptionData, valueItem: any):
39+
def Option__add_ValueItem(optionData: PgCfgModel__OptionData, valueItem: typing.Any):
4040
assert type(optionData) is PgCfgModel__OptionData
4141
assert type(optionData.m_Value) is list
4242
assert valueItem is not None
@@ -205,7 +205,7 @@ def FileLine__add_Option(
205205
cfgData: PgCfgModel__ConfigurationData,
206206
fileLineData: PgCfgModel__FileLineData,
207207
optName: str,
208-
optValue: any,
208+
optValue: typing.Any,
209209
optOffset: typing.Optional[int],
210210
) -> PgCfgModel__OptionData:
211211
assert type(cfgData) is PgCfgModel__ConfigurationData
@@ -321,7 +321,7 @@ def File__add_Option(
321321
cfgData: PgCfgModel__ConfigurationData,
322322
fileData: PgCfgModel__FileData,
323323
optName: str,
324-
optValue: any,
324+
optValue: typing.Any,
325325
) -> PgCfgModel__OptionData:
326326
assert type(cfgData) is PgCfgModel__ConfigurationData
327327
assert type(fileData) is PgCfgModel__FileData

src/core/handlers.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def DataHandler__SetOptionValue__Simple(
2323
self,
2424
targetData: typing.Union[None, FileData, OptionData],
2525
optionName: str,
26-
optionValue: any,
27-
) -> any:
26+
optionValue: typing.Any,
27+
) -> typing.Any:
2828
assert (
2929
targetData is None
3030
or type(targetData) is FileData
@@ -41,7 +41,7 @@ def DataHandler__GetOptionValue__Simple(
4141
self,
4242
sourceData: typing.Union[None, FileData, OptionData],
4343
optionName: str,
44-
) -> any:
44+
) -> typing.Any:
4545
assert (
4646
sourceData is None
4747
or type(sourceData) is FileData
@@ -57,7 +57,7 @@ def DataHandler__GetOptionValue__UnionList(
5757
self,
5858
sourceData: typing.Union[None, FileLineData, OptionData],
5959
optionName: str,
60-
) -> any:
60+
) -> typing.Any:
6161
assert (
6262
sourceData is None
6363
or type(sourceData) is FileData
@@ -73,7 +73,7 @@ def DataHandler__ResetOption(
7373
self,
7474
targetData: typing.Union[None, FileData, OptionData],
7575
optionName: str,
76-
) -> any:
76+
) -> typing.Any:
7777
assert (
7878
targetData is None
7979
or type(targetData) is FileData
@@ -88,8 +88,8 @@ def DataHandler__AddSimpleOption(
8888
target: typing.Union[None, FileData, FileLineData],
8989
optionOffset: typing.Optional[int],
9090
optionName: str,
91-
optionValue: any,
92-
) -> any:
91+
optionValue: typing.Any,
92+
) -> typing.Any:
9393
assert (
9494
target is None or type(target) is FileData or type(target) is FileLineData
9595
)
@@ -103,8 +103,8 @@ def DataHandler__SetUniqueOptionValueItem(
103103
self,
104104
targetData: typing.Union[None, FileData, OptionData],
105105
optionName: str,
106-
optionValueItem: any,
107-
) -> any:
106+
optionValueItem: typing.Any,
107+
) -> typing.Any:
108108
assert (
109109
targetData is None
110110
or type(targetData) is FileData
@@ -134,15 +134,15 @@ class OptionHandlerCtxToSetValue:
134134
DataHandler: ConfigurationDataHandler
135135
TargetData: typing.Union[None, FileData, OptionData]
136136
OptionName: str
137-
OptionValue: any
137+
OptionValue: typing.Any
138138

139139
# --------------------------------------------------------------------
140140
def __init__(
141141
self,
142142
dataHandler: ConfigurationDataHandler,
143143
targetData: typing.Union[None, FileData, OptionData],
144144
optionName: str,
145-
optionValue: any,
145+
optionValue: typing.Any,
146146
):
147147
assert isinstance(dataHandler, ConfigurationDataHandler)
148148
assert (
@@ -167,7 +167,7 @@ def __init__(self):
167167
super().__init__()
168168

169169
# interface ----------------------------------------------------------
170-
def SetOptionValue(self, ctx: OptionHandlerCtxToSetValue) -> any:
170+
def SetOptionValue(self, ctx: OptionHandlerCtxToSetValue) -> typing.Any:
171171
assert type(ctx) is OptionHandlerCtxToSetValue
172172
assert ctx.OptionName is not None
173173
assert ctx.OptionValue is not None
@@ -212,7 +212,7 @@ def __init__(self):
212212
super().__init__()
213213

214214
# interface ----------------------------------------------------------
215-
def GetOptionValue(self, ctx: OptionHandlerCtxToGetValue) -> any:
215+
def GetOptionValue(self, ctx: OptionHandlerCtxToGetValue) -> typing.Any:
216216
assert type(ctx) is OptionHandlerCtxToGetValue
217217
assert (
218218
ctx.SourceData is None
@@ -232,7 +232,7 @@ class OptionHandlerCtxToAddOption:
232232
Target: typing.Union[None, FileData, FileLineData]
233233
OptionOffset: typing.Optional[int]
234234
OptionName: str
235-
OptionValue: any
235+
OptionValue: typing.Any
236236

237237
# --------------------------------------------------------------------
238238
def __init__(
@@ -241,7 +241,7 @@ def __init__(
241241
target: typing.Union[None, FileData, FileLineData],
242242
optionOffset: typing.Optional[int],
243243
optionName: str,
244-
optionValue: any,
244+
optionValue: typing.Any,
245245
):
246246
assert isinstance(dataHandler, ConfigurationDataHandler)
247247
assert (
@@ -266,7 +266,7 @@ def __init__(self):
266266
super().__init__()
267267

268268
# interface ----------------------------------------------------------
269-
def AddOption(self, ctx: OptionHandlerCtxToSetValue) -> any:
269+
def AddOption(self, ctx: OptionHandlerCtxToSetValue) -> typing.Any:
270270
assert type(ctx) is OptionHandlerCtxToSetValue
271271
RaiseError.MethodIsNotImplemented(__class__, "AddOption")
272272

@@ -279,15 +279,15 @@ class OptionHandlerCtxToSetValueItem:
279279
DataHandler: ConfigurationDataHandler
280280
TargetData: typing.Union[None, FileData, OptionData]
281281
OptionName: str
282-
OptionValueItem: any
282+
OptionValueItem: typing.Any
283283

284284
# --------------------------------------------------------------------
285285
def __init__(
286286
self,
287287
dataHandler: ConfigurationDataHandler,
288288
targetData: typing.Union[None, FileData, OptionData],
289289
optionName: str,
290-
optionValueItem: any,
290+
optionValueItem: typing.Any,
291291
):
292292
assert isinstance(dataHandler, ConfigurationDataHandler)
293293
assert (
@@ -312,7 +312,7 @@ def __init__(self):
312312
super().__init__()
313313

314314
# interface ----------------------------------------------------------
315-
def SetOptionValueItem(self, ctx: OptionHandlerCtxToSetValueItem) -> any:
315+
def SetOptionValueItem(self, ctx: OptionHandlerCtxToSetValueItem) -> typing.Any:
316316
assert type(ctx) is OptionHandlerCtxToSetValueItem
317317
assert (
318318
ctx.TargetData is None
@@ -331,14 +331,14 @@ def SetOptionValueItem(self, ctx: OptionHandlerCtxToSetValueItem) -> any:
331331
class OptionHandlerCtxToPrepareSetValue:
332332
DataHandler: ConfigurationDataHandler
333333
OptionName: str
334-
OptionValue: any
334+
OptionValue: typing.Any
335335

336336
# --------------------------------------------------------------------
337337
def __init__(
338338
self,
339339
dataHandler: ConfigurationDataHandler,
340340
optionName: str,
341-
optionValue: any,
341+
optionValue: typing.Any,
342342
):
343343
assert isinstance(dataHandler, ConfigurationDataHandler)
344344
assert type(optionName) is str
@@ -370,14 +370,14 @@ def PrepareSetValue(self, ctx: OptionHandlerCtxToPrepareSetValue) -> str:
370370
class OptionHandlerCtxToPrepareSetValueItem:
371371
DataHandler: ConfigurationDataHandler
372372
OptionName: str
373-
OptionValueItem: any
373+
OptionValueItem: typing.Any
374374

375375
# --------------------------------------------------------------------
376376
def __init__(
377377
self,
378378
dataHandler: ConfigurationDataHandler,
379379
optionName: str,
380-
optionValueItem: any,
380+
optionValueItem: typing.Any,
381381
):
382382
assert isinstance(dataHandler, ConfigurationDataHandler)
383383
assert type(optionName) is str
@@ -409,14 +409,14 @@ def PrepareSetValueItem(self, ctx: OptionHandlerCtxToPrepareSetValueItem) -> str
409409
class OptionHandlerCtxToPrepareGetValue:
410410
DataHandler: ConfigurationDataHandler
411411
OptionName: str
412-
OptionValue: any
412+
OptionValue: typing.Any
413413

414414
# --------------------------------------------------------------------
415415
def __init__(
416416
self,
417417
dataHandler: ConfigurationDataHandler,
418418
optionName: str,
419-
optionValue: any,
419+
optionValue: typing.Any,
420420
):
421421
assert isinstance(dataHandler, ConfigurationDataHandler)
422422
assert type(optionName) is str
@@ -448,14 +448,14 @@ def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> str:
448448
class OptionHandlerCtxToWrite:
449449
DataHandler: ConfigurationDataHandler
450450
OptionName: str
451-
OptionValue: any
451+
OptionValue: typing.Any
452452

453453
# --------------------------------------------------------------------
454454
def __init__(
455455
self,
456456
dataHandler: ConfigurationDataHandler,
457457
optionName: str,
458-
optionValue: any,
458+
optionValue: typing.Any,
459459
):
460460
assert isinstance(dataHandler, ConfigurationDataHandler)
461461
assert type(optionName) is str

src/core/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def ExtractFirstOptionFromIndexItem(
4848

4949
# --------------------------------------------------------------------
5050
def DoesContainerContainsValue__NotNullAndExact(
51-
container: typing.Iterable, value: any
51+
container: typing.Iterable, value: typing.Any
5252
) -> bool:
5353
assert container is not None
5454
assert isinstance(container, typing.Iterable)

src/core/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ def __init__(self, parent: FileLineData, offset: typing.Optional[int], text: str
8989

9090
class OptionData(FileLineElementData):
9191
m_Name: str
92-
m_Value: any
92+
m_Value: typing.Any
9393

9494
# --------------------------------------------------------------------
9595
def __init__(
96-
self, parent: FileLineData, offset: typing.Optional[int], name: str, value: any
96+
self, parent: FileLineData, offset: typing.Optional[int], name: str, value: typing.Any
9797
):
9898
assert type(parent) is FileLineData
9999
assert offset is None or type(offset) is int

0 commit comments

Comments
 (0)