testgres.postgres-configuration 0.4.0__py3-none-any.whl → 0.6.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.
- testgres/postgres_configuration/__init__.py +19 -0
- testgres/postgres_configuration/abstract/v00/configuration.py +123 -18
- testgres/postgres_configuration/core/bugcheck_error.py +122 -74
- testgres/postgres_configuration/core/data_verificator.py +7 -3
- testgres/postgres_configuration/core/handlers.py +139 -41
- testgres/postgres_configuration/core/helpers.py +10 -4
- testgres/postgres_configuration/core/model.py +73 -38
- testgres/postgres_configuration/core/model_s_multi_index.py +204 -0
- testgres/postgres_configuration/core/{controller_utils.py → model_utils.py} +609 -259
- testgres/postgres_configuration/core/option/handlers/add/option_handler_to_add__std.py +9 -2
- testgres/postgres_configuration/core/option/handlers/get_value/option_handler_to_get_value__std__simple.py +7 -2
- testgres/postgres_configuration/core/option/handlers/get_value/option_handler_to_get_value__std__union_list.py +7 -2
- testgres/postgres_configuration/core/option/handlers/instances.py +249 -0
- testgres/postgres_configuration/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__bool.py +5 -1
- testgres/postgres_configuration/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__generic.py +11 -7
- testgres/postgres_configuration/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__int.py +5 -1
- testgres/postgres_configuration/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__str.py +5 -1
- testgres/postgres_configuration/core/option/handlers/prepare_get_value/option_handler_to_prepare_get_value__std__unique_str_list.py +6 -2
- testgres/postgres_configuration/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__bool.py +23 -8
- testgres/postgres_configuration/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__generic.py +12 -7
- testgres/postgres_configuration/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__int.py +17 -7
- testgres/postgres_configuration/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__str.py +11 -5
- testgres/postgres_configuration/core/option/handlers/prepare_set_value/option_handler_to_prepare_set_value__std__unique_str_list.py +13 -3
- testgres/postgres_configuration/core/option/handlers/prepare_set_value_item/option_handler_to_prepare_set_value_item__std__str.py +8 -2
- testgres/postgres_configuration/core/option/handlers/set_value/option_handler_to_set_value__std__simple.py +8 -2
- testgres/postgres_configuration/core/option/handlers/set_value_item/option_handler_to_set_value_item__std__unique.py +8 -2
- testgres/postgres_configuration/core/option/handlers/write/option_handler_to_write__std__bool.py +11 -5
- testgres/postgres_configuration/core/option/handlers/write/option_handler_to_write__std__generic.py +8 -6
- testgres/postgres_configuration/core/option/handlers/write/option_handler_to_write__std__int.py +5 -1
- testgres/postgres_configuration/core/option/handlers/write/option_handler_to_write__std__str.py +5 -1
- testgres/postgres_configuration/core/option/handlers/write/option_handler_to_write__std__unique_str_list.py +5 -1
- testgres/postgres_configuration/core/raise_error.py +308 -122
- testgres/postgres_configuration/core/read_utils.py +6 -3
- testgres/postgres_configuration/core/write_utils.py +2 -0
- testgres/postgres_configuration/exceptions.py +94 -0
- testgres/postgres_configuration/implementation/v00/configuration_base.py +1033 -2674
- testgres/postgres_configuration/implementation/v00/configuration_base_ds_standard.py +1098 -0
- testgres/postgres_configuration/implementation/v00/configuration_base_ds_strict.py +1228 -0
- testgres/postgres_configuration/implementation/v00/configuration_base_r.py +793 -0
- testgres/postgres_configuration/implementation/v00/configuration_base_w.py +583 -0
- testgres/postgres_configuration/implementation/v00/configuration_std.py +135 -321
- testgres/postgres_configuration/os/abstract/configuration_os_ops.py +4 -0
- testgres/postgres_configuration/os/local/configuration_os_ops.py +4 -0
- testgres_postgres_configuration-0.6.0.dist-info/METADATA +137 -0
- testgres_postgres_configuration-0.6.0.dist-info/RECORD +48 -0
- {testgres_postgres_configuration-0.4.0.dist-info → testgres_postgres_configuration-0.6.0.dist-info}/WHEEL +1 -1
- testgres_postgres_configuration-0.4.0.dist-info/METADATA +0 -34
- testgres_postgres_configuration-0.4.0.dist-info/RECORD +0 -41
- {testgres_postgres_configuration-0.4.0.dist-info → testgres_postgres_configuration-0.6.0.dist-info}/licenses/LICENSE +0 -0
- {testgres_postgres_configuration-0.4.0.dist-info → testgres_postgres_configuration-0.6.0.dist-info}/top_level.txt +0 -0
|
@@ -7,6 +7,16 @@ from .implementation.v00.configuration_std import PostgresConfiguration_Std as P
|
|
|
7
7
|
from .implementation.v00.configuration_std import PostgresConfigurationReader_Std as PostgresConfigurationReader
|
|
8
8
|
|
|
9
9
|
from .implementation.v00.configuration_std import PostgresConfigurationWriter_Std as PostgresConfigurationWriter
|
|
10
|
+
|
|
11
|
+
from .abstract.v00.configuration import PostgresConfigurationOption
|
|
12
|
+
from .abstract.v00.configuration import PostgresConfigurationInclude
|
|
13
|
+
from .abstract.v00.configuration import PostgresConfigurationIncludeIfExists
|
|
14
|
+
from .abstract.v00.configuration import PostgresConfigurationComment
|
|
15
|
+
from .abstract.v00.configuration import PostgresConfigurationOptions
|
|
16
|
+
from .abstract.v00.configuration import PostgresConfigurationFiles
|
|
17
|
+
from .abstract.v00.configuration import AddIncludeIfExistsRule
|
|
18
|
+
from .abstract.v00.configuration import PostgresConfigurationSetOptionValueResult
|
|
19
|
+
from .abstract.v00.configuration import PostgresConfigurationSetOptionValueEventID
|
|
10
20
|
# fmt: on
|
|
11
21
|
|
|
12
22
|
# //////////////////////////////////////////////////////////////////////////////
|
|
@@ -16,6 +26,15 @@ __all__ = [
|
|
|
16
26
|
"PostgresConfiguration",
|
|
17
27
|
"PostgresConfigurationReader",
|
|
18
28
|
"PostgresConfigurationWriter",
|
|
29
|
+
"PostgresConfigurationOption",
|
|
30
|
+
"PostgresConfigurationInclude",
|
|
31
|
+
"PostgresConfigurationIncludeIfExists",
|
|
32
|
+
"PostgresConfigurationComment",
|
|
33
|
+
"PostgresConfigurationOptions",
|
|
34
|
+
"PostgresConfigurationFiles",
|
|
35
|
+
"AddIncludeIfExistsRule",
|
|
36
|
+
"PostgresConfigurationSetOptionValueResult",
|
|
37
|
+
"PostgresConfigurationSetOptionValueEventID",
|
|
19
38
|
]
|
|
20
39
|
|
|
21
40
|
|
|
@@ -8,6 +8,15 @@ from ...core.raise_error import RaiseError
|
|
|
8
8
|
import typing
|
|
9
9
|
import enum
|
|
10
10
|
|
|
11
|
+
# //////////////////////////////////////////////////////////////////////////////
|
|
12
|
+
# AddIncludeIfExistsRule
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class AddIncludeIfExistsRule(enum.Enum):
|
|
16
|
+
without_file = 0
|
|
17
|
+
with_file = 1
|
|
18
|
+
|
|
19
|
+
|
|
11
20
|
# //////////////////////////////////////////////////////////////////////////////
|
|
12
21
|
# class PostgresConfigurationObject
|
|
13
22
|
|
|
@@ -102,12 +111,16 @@ class PostgresConfigurationOption(PostgresConfigurationElement):
|
|
|
102
111
|
RaiseError.MethodIsNotImplemented(__class__, "get_Value")
|
|
103
112
|
|
|
104
113
|
# --------------------------------------------------------------------
|
|
105
|
-
def set_Value(
|
|
114
|
+
def set_Value(
|
|
115
|
+
self,
|
|
116
|
+
value: typing.Any,
|
|
117
|
+
) -> PostgresConfigurationSetOptionValueResult:
|
|
106
118
|
RaiseError.MethodIsNotImplemented(__class__, "set_Value")
|
|
107
119
|
|
|
108
120
|
# --------------------------------------------------------------------
|
|
109
121
|
def set_ValueItem(
|
|
110
|
-
self,
|
|
122
|
+
self,
|
|
123
|
+
value_item: typing.Any,
|
|
111
124
|
) -> PostgresConfigurationSetOptionValueResult:
|
|
112
125
|
assert value_item is not None
|
|
113
126
|
RaiseError.MethodIsNotImplemented(__class__, "set_ValueItem")
|
|
@@ -127,6 +140,7 @@ class PostgresConfigurationOptionsIterator(
|
|
|
127
140
|
def __iter__(self) -> PostgresConfigurationOptionsIterator:
|
|
128
141
|
RaiseError.MethodIsNotImplemented(__class__, "__iter__")
|
|
129
142
|
|
|
143
|
+
# --------------------------------------------------------------------
|
|
130
144
|
def __next__(self) -> PostgresConfigurationOption:
|
|
131
145
|
RaiseError.MethodIsNotImplemented(__class__, "__next__")
|
|
132
146
|
|
|
@@ -161,7 +175,31 @@ class PostgresConfigurationInclude(PostgresConfigurationElement):
|
|
|
161
175
|
RaiseError.MethodIsNotImplemented(__class__, "get_File")
|
|
162
176
|
|
|
163
177
|
# --------------------------------------------------------------------
|
|
164
|
-
def Delete(
|
|
178
|
+
def Delete(
|
|
179
|
+
self,
|
|
180
|
+
withLine: bool,
|
|
181
|
+
) -> None:
|
|
182
|
+
assert type(withLine) is bool
|
|
183
|
+
RaiseError.MethodIsNotImplemented(__class__, "Delete")
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
# //////////////////////////////////////////////////////////////////////////////
|
|
187
|
+
# class PostgresConfigurationIncludeIfExists
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
class PostgresConfigurationIncludeIfExists(PostgresConfigurationElement):
|
|
191
|
+
def __init__(self):
|
|
192
|
+
super().__init__()
|
|
193
|
+
|
|
194
|
+
# interface ----------------------------------------------------------
|
|
195
|
+
def get_File(self) -> typing.Optional[PostgresConfigurationFile]:
|
|
196
|
+
RaiseError.MethodIsNotImplemented(__class__, "get_File")
|
|
197
|
+
|
|
198
|
+
# --------------------------------------------------------------------
|
|
199
|
+
def Delete(
|
|
200
|
+
self,
|
|
201
|
+
withLine: bool,
|
|
202
|
+
) -> None:
|
|
165
203
|
assert type(withLine) is bool
|
|
166
204
|
RaiseError.MethodIsNotImplemented(__class__, "Delete")
|
|
167
205
|
|
|
@@ -180,7 +218,9 @@ class PostgresConfigurationFileLine(PostgresConfigurationObject):
|
|
|
180
218
|
|
|
181
219
|
# --------------------------------------------------------------------
|
|
182
220
|
def AddComment(
|
|
183
|
-
self,
|
|
221
|
+
self,
|
|
222
|
+
text: str,
|
|
223
|
+
offset: typing.Optional[int],
|
|
184
224
|
) -> PostgresConfigurationComment:
|
|
185
225
|
assert type(text) is str
|
|
186
226
|
assert (offset is None) or (type(offset) is int)
|
|
@@ -188,7 +228,10 @@ class PostgresConfigurationFileLine(PostgresConfigurationObject):
|
|
|
188
228
|
|
|
189
229
|
# --------------------------------------------------------------------
|
|
190
230
|
def AddOption(
|
|
191
|
-
self,
|
|
231
|
+
self,
|
|
232
|
+
name: str,
|
|
233
|
+
value: typing.Any,
|
|
234
|
+
offset: typing.Optional[int],
|
|
192
235
|
) -> PostgresConfigurationOption:
|
|
193
236
|
assert type(name) is str
|
|
194
237
|
assert name != ""
|
|
@@ -198,13 +241,28 @@ class PostgresConfigurationFileLine(PostgresConfigurationObject):
|
|
|
198
241
|
|
|
199
242
|
# --------------------------------------------------------------------
|
|
200
243
|
def AddInclude(
|
|
201
|
-
self,
|
|
244
|
+
self,
|
|
245
|
+
path: str,
|
|
246
|
+
offset: typing.Optional[int],
|
|
202
247
|
) -> PostgresConfigurationInclude:
|
|
203
248
|
assert type(path) is str
|
|
204
249
|
assert path != ""
|
|
205
250
|
assert (offset is None) or (type(offset) is int)
|
|
206
251
|
RaiseError.MethodIsNotImplemented(__class__, "AddInclude")
|
|
207
252
|
|
|
253
|
+
# --------------------------------------------------------------------
|
|
254
|
+
def AddIncludeIfExists(
|
|
255
|
+
self,
|
|
256
|
+
path: str,
|
|
257
|
+
offset: typing.Optional[int],
|
|
258
|
+
rule: AddIncludeIfExistsRule,
|
|
259
|
+
) -> PostgresConfigurationIncludeIfExists:
|
|
260
|
+
assert type(path) is str
|
|
261
|
+
assert path != ""
|
|
262
|
+
assert (offset is None) or (type(offset) is int)
|
|
263
|
+
assert type(rule) is AddIncludeIfExistsRule
|
|
264
|
+
RaiseError.MethodIsNotImplemented(__class__, "AddIncludeIfExists")
|
|
265
|
+
|
|
208
266
|
# --------------------------------------------------------------------
|
|
209
267
|
def Clear(self) -> None:
|
|
210
268
|
RaiseError.MethodIsNotImplemented(__class__, "Clear")
|
|
@@ -224,6 +282,7 @@ class PostgresConfigurationFileLinesIterator(
|
|
|
224
282
|
def __iter__(self) -> PostgresConfigurationFileLinesIterator:
|
|
225
283
|
RaiseError.MethodIsNotImplemented(__class__, "__iter__")
|
|
226
284
|
|
|
285
|
+
# --------------------------------------------------------------------
|
|
227
286
|
def __next__(self) -> PostgresConfigurationFileLine:
|
|
228
287
|
RaiseError.MethodIsNotImplemented(__class__, "__next__")
|
|
229
288
|
|
|
@@ -270,23 +329,44 @@ class PostgresConfigurationFile(PostgresConfigurationObject):
|
|
|
270
329
|
RaiseError.MethodIsNotImplemented(__class__, "AddEmptyLine")
|
|
271
330
|
|
|
272
331
|
# --------------------------------------------------------------------
|
|
273
|
-
def AddComment(
|
|
332
|
+
def AddComment(
|
|
333
|
+
self,
|
|
334
|
+
text: str,
|
|
335
|
+
) -> PostgresConfigurationComment:
|
|
274
336
|
assert type(text) is str
|
|
275
337
|
RaiseError.MethodIsNotImplemented(__class__, "AddComment")
|
|
276
338
|
|
|
277
339
|
# --------------------------------------------------------------------
|
|
278
|
-
def AddOption(
|
|
340
|
+
def AddOption(
|
|
341
|
+
self,
|
|
342
|
+
name: str,
|
|
343
|
+
value: typing.Any,
|
|
344
|
+
) -> PostgresConfigurationOption:
|
|
279
345
|
assert type(name) is str
|
|
280
346
|
assert name != ""
|
|
281
347
|
assert value is not None
|
|
282
348
|
RaiseError.MethodIsNotImplemented(__class__, "AddOption")
|
|
283
349
|
|
|
284
350
|
# --------------------------------------------------------------------
|
|
285
|
-
def AddInclude(
|
|
351
|
+
def AddInclude(
|
|
352
|
+
self,
|
|
353
|
+
path: str,
|
|
354
|
+
) -> PostgresConfigurationInclude:
|
|
286
355
|
assert type(path) is str
|
|
287
356
|
assert path != ""
|
|
288
357
|
RaiseError.MethodIsNotImplemented(__class__, "AddInclude")
|
|
289
358
|
|
|
359
|
+
# --------------------------------------------------------------------
|
|
360
|
+
def AddIncludeIfExists(
|
|
361
|
+
self,
|
|
362
|
+
path: str,
|
|
363
|
+
rule: AddIncludeIfExistsRule,
|
|
364
|
+
) -> PostgresConfigurationIncludeIfExists:
|
|
365
|
+
assert type(path) is str
|
|
366
|
+
assert path != ""
|
|
367
|
+
assert type(rule) is AddIncludeIfExistsRule
|
|
368
|
+
RaiseError.MethodIsNotImplemented(__class__, "AddIncludeIfExists")
|
|
369
|
+
|
|
290
370
|
# --------------------------------------------------------------------
|
|
291
371
|
#
|
|
292
372
|
# Method for inserting, updating and deleting of an option.
|
|
@@ -299,7 +379,9 @@ class PostgresConfigurationFile(PostgresConfigurationObject):
|
|
|
299
379
|
# PostgresConfigurationSetOptionValueResult object.
|
|
300
380
|
#
|
|
301
381
|
def SetOptionValue(
|
|
302
|
-
self,
|
|
382
|
+
self,
|
|
383
|
+
name: str,
|
|
384
|
+
value: typing.Any,
|
|
303
385
|
) -> PostgresConfigurationSetOptionValueResult:
|
|
304
386
|
assert type(name) is str
|
|
305
387
|
assert name != ""
|
|
@@ -313,13 +395,18 @@ class PostgresConfigurationFile(PostgresConfigurationObject):
|
|
|
313
395
|
# - Value of option.
|
|
314
396
|
# - None if option is not found in this file.
|
|
315
397
|
#
|
|
316
|
-
def GetOptionValue(
|
|
398
|
+
def GetOptionValue(
|
|
399
|
+
self,
|
|
400
|
+
name: str,
|
|
401
|
+
) -> typing.Any:
|
|
317
402
|
assert type(name) is str
|
|
318
403
|
RaiseError.MethodIsNotImplemented(__class__, "GetOptionValue")
|
|
319
404
|
|
|
320
405
|
# --------------------------------------------------------------------
|
|
321
406
|
def SetOptionValueItem(
|
|
322
|
-
self,
|
|
407
|
+
self,
|
|
408
|
+
name: str,
|
|
409
|
+
value_item: typing.Any,
|
|
323
410
|
) -> PostgresConfigurationSetOptionValueResult:
|
|
324
411
|
assert type(name) is str
|
|
325
412
|
assert name != ""
|
|
@@ -339,6 +426,7 @@ class PostgresConfigurationFilesIterator(typing.Iterator[PostgresConfigurationFi
|
|
|
339
426
|
def __iter__(self) -> PostgresConfigurationFilesIterator:
|
|
340
427
|
RaiseError.MethodIsNotImplemented(__class__, "__iter__")
|
|
341
428
|
|
|
429
|
+
# --------------------------------------------------------------------
|
|
342
430
|
def __next__(self) -> PostgresConfigurationFile:
|
|
343
431
|
RaiseError.MethodIsNotImplemented(__class__, "__next__")
|
|
344
432
|
|
|
@@ -360,7 +448,10 @@ class PostgresConfigurationFiles(typing.Iterable[PostgresConfigurationFile]):
|
|
|
360
448
|
RaiseError.MethodIsNotImplemented(__class__, "__iter__")
|
|
361
449
|
|
|
362
450
|
# --------------------------------------------------------------------
|
|
363
|
-
def GetFileByName(
|
|
451
|
+
def GetFileByName(
|
|
452
|
+
self,
|
|
453
|
+
file_name: str,
|
|
454
|
+
) -> PostgresConfigurationFile:
|
|
364
455
|
assert file_name is not None
|
|
365
456
|
RaiseError.MethodIsNotImplemented(__class__, "GetFileByName")
|
|
366
457
|
|
|
@@ -374,13 +465,20 @@ class PostgresConfiguration(PostgresConfigurationObject):
|
|
|
374
465
|
pass
|
|
375
466
|
|
|
376
467
|
# interface ----------------------------------------------------------
|
|
377
|
-
def AddTopLevelFile(
|
|
468
|
+
def AddTopLevelFile(
|
|
469
|
+
self,
|
|
470
|
+
path: str,
|
|
471
|
+
) -> PostgresConfigurationFile:
|
|
378
472
|
assert type(path) is str
|
|
379
473
|
assert path != ""
|
|
380
474
|
RaiseError.MethodIsNotImplemented(__class__, "AddTopLevelFile")
|
|
381
475
|
|
|
382
476
|
# --------------------------------------------------------------------
|
|
383
|
-
def AddOption(
|
|
477
|
+
def AddOption(
|
|
478
|
+
self,
|
|
479
|
+
name: str,
|
|
480
|
+
value: typing.Any,
|
|
481
|
+
) -> PostgresConfigurationOption:
|
|
384
482
|
assert type(name) is str
|
|
385
483
|
assert name != ""
|
|
386
484
|
assert value is not None
|
|
@@ -398,7 +496,9 @@ class PostgresConfiguration(PostgresConfigurationObject):
|
|
|
398
496
|
# PostgresConfigurationSetOptionValueResult object.
|
|
399
497
|
#
|
|
400
498
|
def SetOptionValue(
|
|
401
|
-
self,
|
|
499
|
+
self,
|
|
500
|
+
name: str,
|
|
501
|
+
value: typing.Any,
|
|
402
502
|
) -> PostgresConfigurationSetOptionValueResult:
|
|
403
503
|
assert type(name) is str
|
|
404
504
|
RaiseError.MethodIsNotImplemented(__class__, "SetOptionValue")
|
|
@@ -411,13 +511,18 @@ class PostgresConfiguration(PostgresConfigurationObject):
|
|
|
411
511
|
# - Value of option.
|
|
412
512
|
# - None if option is not found.
|
|
413
513
|
#
|
|
414
|
-
def GetOptionValue(
|
|
514
|
+
def GetOptionValue(
|
|
515
|
+
self,
|
|
516
|
+
name: str,
|
|
517
|
+
) -> typing.Any:
|
|
415
518
|
assert type(name) is str
|
|
416
519
|
RaiseError.MethodIsNotImplemented(__class__, "GetOptionValue")
|
|
417
520
|
|
|
418
521
|
# --------------------------------------------------------------------
|
|
419
522
|
def SetOptionValueItem(
|
|
420
|
-
self,
|
|
523
|
+
self,
|
|
524
|
+
name: str,
|
|
525
|
+
value_item: typing.Any,
|
|
421
526
|
) -> PostgresConfigurationSetOptionValueResult:
|
|
422
527
|
assert type(name) is str
|
|
423
528
|
assert value_item is not None
|