testgres.postgres-configuration 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. testgres/postgres_configuration/__init__.py +22 -0
  2. testgres/postgres_configuration/abstract/v00/configuration.py +435 -0
  3. testgres/postgres_configuration/core/bugcheck_error.py +219 -0
  4. testgres/postgres_configuration/core/controller_utils.py +982 -0
  5. testgres/postgres_configuration/core/data_verificator.py +60 -0
  6. testgres/postgres_configuration/core/handlers.py +483 -0
  7. testgres/postgres_configuration/core/helpers.py +95 -0
  8. testgres/postgres_configuration/core/model.py +296 -0
  9. testgres/postgres_configuration/core/option/handlers/add/option_handler_to_add__std.py +38 -0
  10. testgres/postgres_configuration/core/option/handlers/get_value/option_handler_to_get_value__std__simple.py +36 -0
  11. testgres/postgres_configuration/core/option/handlers/get_value/option_handler_to_get_value__std__union_list.py +36 -0
  12. testgres/postgres_configuration/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__bool.py +31 -0
  13. testgres/postgres_configuration/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__generic.py +41 -0
  14. testgres/postgres_configuration/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__int.py +31 -0
  15. testgres/postgres_configuration/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__str.py +31 -0
  16. testgres/postgres_configuration/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__unique_str_list.py +46 -0
  17. testgres/postgres_configuration/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__bool.py +115 -0
  18. testgres/postgres_configuration/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__generic.py +41 -0
  19. testgres/postgres_configuration/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__int.py +44 -0
  20. testgres/postgres_configuration/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__str.py +37 -0
  21. testgres/postgres_configuration/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__unique_str_list.py +63 -0
  22. testgres/postgres_configuration/core/option/handlers/prepare_set_value_item/option_handler_to_prepare_set_value_item__std__str.py +37 -0
  23. testgres/postgres_configuration/core/option/handlers/set_value/option_handler_to_set_value__std__simple.py +38 -0
  24. testgres/postgres_configuration/core/option/handlers/set_value_item/option_handler_to_set_value_item__std__unique.py +38 -0
  25. testgres/postgres_configuration/core/option/handlers/write/option_handler_to_write__std__bool.py +42 -0
  26. testgres/postgres_configuration/core/option/handlers/write/option_handler_to_write__std__generic.py +51 -0
  27. testgres/postgres_configuration/core/option/handlers/write/option_handler_to_write__std__int.py +27 -0
  28. testgres/postgres_configuration/core/option/handlers/write/option_handler_to_write__std__str.py +36 -0
  29. testgres/postgres_configuration/core/option/handlers/write/option_handler_to_write__std__unique_str_list.py +37 -0
  30. testgres/postgres_configuration/core/raise_error.py +365 -0
  31. testgres/postgres_configuration/core/read_utils.py +308 -0
  32. testgres/postgres_configuration/core/write_utils.py +112 -0
  33. testgres/postgres_configuration/implementation/v00/configuration_base.py +4408 -0
  34. testgres/postgres_configuration/implementation/v00/configuration_std.py +538 -0
  35. testgres/postgres_configuration/os/abstract/configuration_os_ops.py +98 -0
  36. testgres/postgres_configuration/os/local/configuration_os_ops.py +154 -0
  37. testgres_postgres_configuration-0.1.0.dist-info/METADATA +25 -0
  38. testgres_postgres_configuration-0.1.0.dist-info/RECORD +40 -0
  39. testgres_postgres_configuration-0.1.0.dist-info/WHEEL +5 -0
  40. testgres_postgres_configuration-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,296 @@
1
+ # //////////////////////////////////////////////////////////////////////////////
2
+ # Postgres Pro. PostgreSQL Configuration Python Library.
3
+
4
+ from __future__ import annotations
5
+
6
+ from .raise_error import RaiseError
7
+
8
+ from ..os.abstract.configuration_os_ops import ConfigurationOsOps
9
+
10
+ import typing
11
+ import enum
12
+ import datetime
13
+
14
+ # //////////////////////////////////////////////////////////////////////////////
15
+ # ObjectData
16
+
17
+
18
+ class ObjectData:
19
+ def __init__(self):
20
+ pass
21
+
22
+ # interface ----------------------------------------------------------
23
+ def get_Parent(self) -> ObjectData:
24
+ RaiseError.MethodIsNotImplemented(__class__, "get_Parent")
25
+
26
+ def IsAlive(self) -> bool:
27
+ RaiseError.MethodIsNotImplemented(__class__, "IsAlive")
28
+
29
+
30
+ # //////////////////////////////////////////////////////////////////////////////
31
+ # FileLineElementData
32
+
33
+
34
+ class FileLineElementData(ObjectData):
35
+ m_Parent: FileLineData
36
+ m_Offset: typing.Optional[int]
37
+
38
+ # --------------------------------------------------------------------
39
+ def __init__(self, parent: FileLineData, offset: typing.Optional[int]):
40
+ assert type(parent) == FileLineData
41
+ assert offset is None or type(offset) == int
42
+
43
+ super().__init__()
44
+
45
+ self.m_Parent = parent
46
+ self.m_Offset = offset
47
+
48
+ # own interface ------------------------------------------------------
49
+ def MarkAsDeletedFrom(self, fileLineData: FileLineData) -> None:
50
+ assert fileLineData is not None
51
+ assert isinstance(fileLineData, FileLineData)
52
+ assert self.m_Parent is fileLineData
53
+ self.m_Parent = None
54
+
55
+ # Object interface ---------------------------------------------------
56
+ def get_Parent(self) -> FileLineData:
57
+ assert type(self.m_Parent) == FileLineData
58
+ return self.m_Parent
59
+
60
+ # --------------------------------------------------------------------
61
+ def IsAlive(self) -> bool:
62
+ if self.m_Parent is None:
63
+ return False
64
+
65
+ return self.m_Parent.IsAlive()
66
+
67
+
68
+ # //////////////////////////////////////////////////////////////////////////////
69
+ # CommentData
70
+
71
+
72
+ class CommentData(FileLineElementData):
73
+ m_Text: str
74
+
75
+ # --------------------------------------------------------------------
76
+ def __init__(self, parent: FileLineData, offset: typing.Optional[int], text: str):
77
+ assert type(parent) == FileLineData
78
+ assert offset is None or type(offset) == int
79
+ assert type(text) == str
80
+
81
+ super().__init__(parent, offset)
82
+
83
+ self.m_Text = text
84
+
85
+
86
+ # //////////////////////////////////////////////////////////////////////////////
87
+ # OptionData
88
+
89
+
90
+ class OptionData(FileLineElementData):
91
+ m_Name: str
92
+ m_Value: any
93
+
94
+ # --------------------------------------------------------------------
95
+ def __init__(
96
+ self, parent: FileLineData, offset: typing.Offset[int], name: str, value: any
97
+ ):
98
+ assert type(parent) == FileLineData
99
+ assert offset is None or type(offset) == int
100
+ assert type(name) == str
101
+ assert value is not None
102
+ assert name != ""
103
+
104
+ super().__init__(parent, offset)
105
+
106
+ self.m_Name = name
107
+ self.m_Value = value
108
+
109
+
110
+ # //////////////////////////////////////////////////////////////////////////////
111
+ # IncludeData
112
+
113
+
114
+ class IncludeData(FileLineElementData):
115
+ m_Path: str
116
+ m_File: FileData
117
+
118
+ # --------------------------------------------------------------------
119
+ def __init__(
120
+ self,
121
+ parent: FileLineData,
122
+ offset: typing.Optional[int],
123
+ path: str,
124
+ fileData: FileData,
125
+ ):
126
+ assert type(parent) == FileLineData
127
+ assert type(path) == str
128
+ assert type(fileData) == FileData
129
+ assert offset is None or type(offset) == int
130
+
131
+ assert parent.IsAlive()
132
+ assert fileData.IsAlive()
133
+
134
+ assert fileData.get_Parent() is parent.get_Parent().get_Parent()
135
+
136
+ super().__init__(parent, offset)
137
+
138
+ self.m_Path = path
139
+ self.m_File = fileData
140
+
141
+
142
+ # //////////////////////////////////////////////////////////////////////////////
143
+ # FileLineData
144
+
145
+
146
+ class FileLineData(ObjectData):
147
+ class tagItem:
148
+ m_Element: FileLineElementData
149
+
150
+ # ----------------------------------------------------------------
151
+ def __init__(self, element: FileLineElementData):
152
+ assert isinstance(element, FileLineElementData)
153
+
154
+ self.m_Element = element
155
+
156
+ # --------------------------------------------------------------------
157
+ m_Parent: FileData
158
+ m_Items: typing.List[tagItem]
159
+
160
+ # --------------------------------------------------------------------
161
+ def __init__(self, parent: FileData):
162
+ assert type(parent) == FileData
163
+
164
+ super().__init__()
165
+
166
+ self.m_Parent = parent
167
+ self.m_Items = list()
168
+
169
+ # own interface ------------------------------------------------------
170
+ def MarkAsDeletedFrom(self, fileData: FileData) -> None:
171
+ assert fileData is not None
172
+ assert isinstance(fileData, FileData)
173
+ assert self.m_Parent is fileData
174
+ self.m_Parent = None
175
+
176
+ # Object interface ---------------------------------------------------
177
+ def get_Parent(self) -> FileData:
178
+ assert type(self.m_Parent) == FileData
179
+ return self.m_Parent
180
+
181
+ # --------------------------------------------------------------------
182
+ def IsAlive(self) -> bool:
183
+ if self.m_Parent is None:
184
+ return False
185
+
186
+ return self.m_Parent.IsAlive()
187
+
188
+
189
+ # //////////////////////////////////////////////////////////////////////////////
190
+ # FileStatus
191
+
192
+
193
+ class FileStatus(enum.Enum):
194
+ IS_NEW: int = 0
195
+ EXISTS: int = 1
196
+
197
+
198
+ # //////////////////////////////////////////////////////////////////////////////
199
+ # FileData
200
+
201
+
202
+ class FileData(ObjectData):
203
+ m_Parent: ConfigurationData
204
+
205
+ m_Status: FileStatus
206
+ m_LastModifiedTimestamp: typing.Optional[datetime.datetime]
207
+
208
+ m_Path: str
209
+ m_Lines: typing.List[FileLineData]
210
+
211
+ m_OptionsByName: typing.Dict[str, OptionData]
212
+
213
+ # --------------------------------------------------------------------
214
+ def __init__(self, parent: ConfigurationData, path: str):
215
+ assert type(parent) == ConfigurationData
216
+ assert type(path) == str
217
+ assert parent.OsOps.Path_IsAbs(path)
218
+ assert parent.OsOps.Path_NormPath(path) == path
219
+ assert parent.OsOps.Path_NormCase(path) == path
220
+
221
+ super().__init__()
222
+
223
+ self.m_Parent = parent
224
+
225
+ self.m_Status = FileStatus.IS_NEW
226
+ self.m_LastModifiedTimestamp = None
227
+
228
+ self.m_Path = path
229
+ self.m_Lines = list()
230
+
231
+ self.m_OptionsByName = dict()
232
+ assert type(self.m_OptionsByName) == dict
233
+
234
+ assert type(self.m_Path) == str
235
+ assert self.m_Path != ""
236
+
237
+ # Object interface ---------------------------------------------------
238
+ def get_Parent(self) -> ConfigurationData:
239
+ assert type(self.m_Parent) == ConfigurationData
240
+ return self.m_Parent
241
+
242
+ # --------------------------------------------------------------------
243
+ def IsAlive(self) -> bool:
244
+ if self.m_Parent is None:
245
+ return False
246
+
247
+ return self.m_Parent.IsAlive()
248
+
249
+
250
+ # //////////////////////////////////////////////////////////////////////////////
251
+ # ConfigurationData
252
+
253
+
254
+ class ConfigurationData(ObjectData):
255
+ m_DataDir: str
256
+ m_OsOps: ConfigurationOsOps
257
+
258
+ m_Files: typing.List[FileData]
259
+
260
+ m_AllOptionsByName: typing.Dict[str, typing.Union[OptionData, typing.List[OptionData]]]
261
+ m_AllFilesByName: typing.Dict[str, typing.Union[FileData, typing.List[FileData]]]
262
+
263
+ # --------------------------------------------------------------------
264
+ def __init__(self, data_dir: str, osOps: ConfigurationOsOps):
265
+ assert type(data_dir) == str
266
+ assert isinstance(osOps, ConfigurationOsOps)
267
+
268
+ super().__init__()
269
+
270
+ self.m_DataDir = data_dir
271
+ self.m_OsOps = osOps
272
+
273
+ self.m_Files = list()
274
+ self.m_AllOptionsByName = dict()
275
+ self.m_AllFilesByName = dict()
276
+
277
+ assert type(self.m_Files) == list
278
+ assert type(self.m_AllOptionsByName) == dict
279
+ assert type(self.m_AllFilesByName) == dict
280
+
281
+ # Own interface ------------------------------------------------------
282
+ @property
283
+ def OsOps(self) -> ConfigurationOsOps:
284
+ assert isinstance(self.m_OsOps, ConfigurationOsOps)
285
+ return self.m_OsOps
286
+
287
+ # Object interface ---------------------------------------------------
288
+ def get_Parent(self) -> FileData:
289
+ return None
290
+
291
+ # --------------------------------------------------------------------
292
+ def IsAlive(self) -> bool:
293
+ return True
294
+
295
+
296
+ # //////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,38 @@
1
+ # //////////////////////////////////////////////////////////////////////////////
2
+ # Postgres Pro. PostgreSQL Configuration Python Library.
3
+
4
+ from __future__ import annotations
5
+
6
+ from ....handlers import OptionHandlerToAddOption
7
+ from ....handlers import OptionHandlerCtxToAddOption
8
+ from ....handlers import ConfigurationDataHandler
9
+ from ....handlers import FileData
10
+ from ....handlers import FileLineData
11
+
12
+ # //////////////////////////////////////////////////////////////////////////////
13
+ # OptionHandlerToAddOption__Std
14
+
15
+
16
+ class OptionHandlerToAddOption__Std(OptionHandlerToAddOption):
17
+ def __init__(self):
18
+ super().__init__()
19
+
20
+ # interface ----------------------------------------------------------
21
+ def AddOption(self, ctx: OptionHandlerCtxToAddOption) -> any:
22
+ assert type(ctx) == OptionHandlerCtxToAddOption
23
+ assert isinstance(ctx.DataHandler, ConfigurationDataHandler)
24
+ assert (
25
+ ctx.Target is None
26
+ or type(ctx.Target) == FileData
27
+ or type(ctx.Target) == FileLineData
28
+ )
29
+ assert ctx.OptionOffset is None or type(ctx.OptionOffset) == int
30
+ assert type(ctx.OptionName) == str
31
+ assert ctx.OptionName is not None
32
+
33
+ return ctx.DataHandler.DataHandler__AddSimpleOption(
34
+ ctx.Target, ctx.OptionOffset, ctx.OptionName, ctx.OptionValue
35
+ )
36
+
37
+
38
+ # //////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,36 @@
1
+ # //////////////////////////////////////////////////////////////////////////////
2
+ # Postgres Pro. PostgreSQL Configuration Python Library.
3
+
4
+ from __future__ import annotations
5
+
6
+ from ....handlers import OptionHandlerToGetValue
7
+ from ....handlers import OptionHandlerCtxToGetValue
8
+ from ....handlers import ConfigurationDataHandler
9
+ from ....handlers import FileData
10
+ from ....handlers import OptionData
11
+
12
+ # //////////////////////////////////////////////////////////////////////////////
13
+ # OptionHandlerToGetValue__Std__Simple
14
+
15
+
16
+ class OptionHandlerToGetValue__Std__Simple(OptionHandlerToGetValue):
17
+ def __init__(self):
18
+ super().__init__()
19
+
20
+ # interface ----------------------------------------------------------
21
+ def GetOptionValue(self, ctx: OptionHandlerCtxToGetValue) -> any:
22
+ assert type(ctx) == OptionHandlerCtxToGetValue
23
+ assert isinstance(ctx.DataHandler, ConfigurationDataHandler)
24
+ assert (
25
+ ctx.SourceData is None
26
+ or type(ctx.SourceData) == FileData
27
+ or type(ctx.SourceData) == OptionData
28
+ )
29
+ assert type(ctx.OptionName) == str
30
+
31
+ return ctx.DataHandler.DataHandler__GetOptionValue__Simple(
32
+ ctx.SourceData, ctx.OptionName
33
+ )
34
+
35
+
36
+ # //////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,36 @@
1
+ # //////////////////////////////////////////////////////////////////////////////
2
+ # Postgres Pro. PostgreSQL Configuration Python Library.
3
+
4
+ from __future__ import annotations
5
+
6
+ from ....handlers import OptionHandlerToGetValue
7
+ from ....handlers import OptionHandlerCtxToGetValue
8
+ from ....handlers import ConfigurationDataHandler
9
+ from ....handlers import FileData
10
+ from ....handlers import OptionData
11
+
12
+ # //////////////////////////////////////////////////////////////////////////////
13
+ # OptionHandlerToGetValue__Std__UnionList
14
+
15
+
16
+ class OptionHandlerToGetValue__Std__UnionList(OptionHandlerToGetValue):
17
+ def __init__(self):
18
+ super().__init__()
19
+
20
+ # interface ----------------------------------------------------------
21
+ def GetOptionValue(self, ctx: OptionHandlerCtxToGetValue) -> any:
22
+ assert type(ctx) == OptionHandlerCtxToGetValue
23
+ assert isinstance(ctx.DataHandler, ConfigurationDataHandler)
24
+ assert (
25
+ ctx.SourceData is None
26
+ or type(ctx.SourceData) == FileData
27
+ or type(ctx.SourceData) == OptionData
28
+ )
29
+ assert type(ctx.OptionName) == str
30
+
31
+ return ctx.DataHandler.DataHandler__GetOptionValue__UnionList(
32
+ ctx.SourceData, ctx.OptionName
33
+ )
34
+
35
+
36
+ # //////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,31 @@
1
+ # //////////////////////////////////////////////////////////////////////////////
2
+ # Postgres Pro. PostgreSQL Configuration Python Library.
3
+
4
+ from __future__ import annotations
5
+
6
+ from ....handlers import OptionHandlerToPrepareGetValue
7
+ from ....handlers import OptionHandlerCtxToPrepareGetValue
8
+ from ....handlers import ConfigurationDataHandler
9
+
10
+ # //////////////////////////////////////////////////////////////////////////////
11
+ # OptionHandlerToPrepareGetValue__Std__Bool
12
+
13
+
14
+ class OptionHandlerToPrepareGetValue__Std__Bool(OptionHandlerToPrepareGetValue):
15
+ def __init__(self):
16
+ super().__init__()
17
+
18
+ # interface ----------------------------------------------------------
19
+ def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> any:
20
+ assert type(ctx) == OptionHandlerCtxToPrepareGetValue
21
+ assert isinstance(ctx.DataHandler, ConfigurationDataHandler)
22
+ assert type(ctx.OptionName) == str
23
+ assert ctx.OptionValue is not None
24
+
25
+ # [2025-04-13] Research
26
+ assert type(ctx.OptionValue) == bool
27
+
28
+ return bool(ctx.OptionValue)
29
+
30
+
31
+ # //////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,41 @@
1
+ # //////////////////////////////////////////////////////////////////////////////
2
+ # Postgres Pro. PostgreSQL Configuration Python Library.
3
+
4
+ from __future__ import annotations
5
+
6
+ from ....bugcheck_error import BugCheckError
7
+
8
+ from ....handlers import OptionHandlerToPrepareGetValue
9
+ from ....handlers import OptionHandlerCtxToPrepareGetValue
10
+ from ....handlers import ConfigurationDataHandler
11
+
12
+ # //////////////////////////////////////////////////////////////////////////////
13
+ # OptionHandlerToPrepareGetValue__Std__Generic
14
+
15
+
16
+ class OptionHandlerToPrepareGetValue__Std__Generic(OptionHandlerToPrepareGetValue):
17
+ def __init__(self):
18
+ super().__init__()
19
+
20
+ # interface ----------------------------------------------------------
21
+ def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> any:
22
+ assert type(ctx) == OptionHandlerCtxToPrepareGetValue
23
+ assert isinstance(ctx.DataHandler, ConfigurationDataHandler)
24
+ assert type(ctx.OptionName) == str
25
+ assert ctx.OptionValue is not None
26
+
27
+ typeOfOptionValue = type(ctx.OptionValue)
28
+
29
+ if typeOfOptionValue == int:
30
+ pass # OK
31
+ elif typeOfOptionValue == str:
32
+ pass # OK
33
+ elif typeOfOptionValue == bool:
34
+ pass # OK
35
+ else:
36
+ BugCheckError.UnknownOptionValueType(ctx.OptionName, typeOfOptionValue)
37
+
38
+ return ctx.OptionValue
39
+
40
+
41
+ # //////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,31 @@
1
+ # //////////////////////////////////////////////////////////////////////////////
2
+ # Postgres Pro. PostgreSQL Configuration Python Library.
3
+
4
+ from __future__ import annotations
5
+
6
+ from ....handlers import OptionHandlerToPrepareGetValue
7
+ from ....handlers import OptionHandlerCtxToPrepareGetValue
8
+ from ....handlers import ConfigurationDataHandler
9
+
10
+ # //////////////////////////////////////////////////////////////////////////////
11
+ # OptionHandlerToPrepareGetValue__Std__Int
12
+
13
+
14
+ class OptionHandlerToPrepareGetValue__Std__Int(OptionHandlerToPrepareGetValue):
15
+ def __init__(self):
16
+ super().__init__()
17
+
18
+ # interface ----------------------------------------------------------
19
+ def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> any:
20
+ assert type(ctx) == OptionHandlerCtxToPrepareGetValue
21
+ assert isinstance(ctx.DataHandler, ConfigurationDataHandler)
22
+ assert type(ctx.OptionName) == str
23
+ assert ctx.OptionValue is not None
24
+
25
+ # [2025-04-13] Research
26
+ assert type(ctx.OptionValue) == int
27
+
28
+ return int(ctx.OptionValue)
29
+
30
+
31
+ # //////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,31 @@
1
+ # //////////////////////////////////////////////////////////////////////////////
2
+ # Postgres Pro. PostgreSQL Configuration Python Library.
3
+
4
+ from __future__ import annotations
5
+
6
+ from ....handlers import OptionHandlerToPrepareGetValue
7
+ from ....handlers import OptionHandlerCtxToPrepareGetValue
8
+ from ....handlers import ConfigurationDataHandler
9
+
10
+ # //////////////////////////////////////////////////////////////////////////////
11
+ # OptionHandlerToPrepareGetValue__Std__Str
12
+
13
+
14
+ class OptionHandlerToPrepareGetValue__Std__Str(OptionHandlerToPrepareGetValue):
15
+ def __init__(self):
16
+ super().__init__()
17
+
18
+ # interface ----------------------------------------------------------
19
+ def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> any:
20
+ assert type(ctx) == OptionHandlerCtxToPrepareGetValue
21
+ assert isinstance(ctx.DataHandler, ConfigurationDataHandler)
22
+ assert type(ctx.OptionName) == str
23
+ assert ctx.OptionValue is not None
24
+
25
+ # [2025-04-13] Research
26
+ assert type(ctx.OptionValue) == str
27
+
28
+ return str(ctx.OptionValue)
29
+
30
+
31
+ # //////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,46 @@
1
+ # //////////////////////////////////////////////////////////////////////////////
2
+ # Postgres Pro. PostgreSQL Configuration Python Library.
3
+
4
+ from __future__ import annotations
5
+
6
+ from ....handlers import OptionHandlerToPrepareGetValue
7
+ from ....handlers import OptionHandlerCtxToPrepareGetValue
8
+ from ....handlers import ConfigurationDataHandler
9
+
10
+ import typing
11
+
12
+ # //////////////////////////////////////////////////////////////////////////////
13
+ # OptionHandlerToPrepareGetValue__Std__UniqueStrList
14
+
15
+
16
+ class OptionHandlerToPrepareGetValue__Std__UniqueStrList(
17
+ OptionHandlerToPrepareGetValue
18
+ ):
19
+ def __init__(self):
20
+ super().__init__()
21
+
22
+ # interface ----------------------------------------------------------
23
+ def PrepareGetValue(self, ctx: OptionHandlerCtxToPrepareGetValue) -> any:
24
+ assert type(ctx) == OptionHandlerCtxToPrepareGetValue
25
+ assert isinstance(ctx.DataHandler, ConfigurationDataHandler)
26
+ assert type(ctx.OptionName) == str
27
+ assert ctx.OptionValue is not None
28
+ assert type(ctx.OptionValue) == list
29
+
30
+ result: typing.List[str] = list()
31
+ index: set[str] = set()
32
+
33
+ for x in ctx.OptionValue:
34
+ assert x is not None
35
+ v = str(x)
36
+
37
+ if v in index:
38
+ continue
39
+
40
+ result.append(v)
41
+ index.add(v)
42
+
43
+ return result
44
+
45
+
46
+ # //////////////////////////////////////////////////////////////////////////////