14
14
class GlobalConfig (object ):
15
15
"""
16
16
Global configuration object which allows user to override default settings.
17
-
18
- Attributes:
19
- cache_initdb: shall we use cached initdb instance?
20
- cached_initdb_dir: path to a temp directory for cached initdb.
21
- cached_initdb_unique: shall we give new node a unique system id?
22
-
23
- cache_pg_config: shall we cache pg_config results?
24
-
25
- temp_dir: path to temp dir containing nodes with default 'base_dir'.
26
-
27
- use_python_logging: enable python logging subsystem (see logger.py).
28
- error_log_lines: N of log lines to be shown in exceptions (0=inf).
29
-
30
- node_cleanup_full: shall we remove EVERYTHING (including logs)?
31
- node_cleanup_on_good_exit: remove base_dir on nominal __exit__().
32
- node_cleanup_on_bad_exit: remove base_dir on __exit__() via exception.
33
-
34
- NOTE: attributes must not be callable or begin with __.
35
17
"""
18
+ # NOTE: attributes must not be callable or begin with __.
36
19
37
20
cache_initdb = True
38
- _cached_initdb_dir = None
21
+ """ shall we use cached initdb instance? """
22
+
39
23
cached_initdb_unique = False
24
+ """ shall we give new node a unique system id? """
40
25
41
26
cache_pg_config = True
27
+ """ shall we cache pg_config results? """
42
28
43
29
use_python_logging = False
30
+ """ enable python logging subsystem (see logger.py). """
31
+
44
32
error_log_lines = 20
33
+ """ N of log lines to be shown in exceptions (0=inf). """
45
34
46
35
node_cleanup_full = True
36
+ """ shall we remove EVERYTHING (including logs)? """
37
+
47
38
node_cleanup_on_good_exit = True
39
+ """ remove base_dir on nominal __exit__(). """
40
+
48
41
node_cleanup_on_bad_exit = False
42
+ """ remove base_dir on __exit__() via exception. """
43
+
44
+ _cached_initdb_dir = None
45
+ """ underlying class attribute for cached_initdb_dir property """
49
46
50
47
@property
51
48
def cached_initdb_dir (self ):
49
+ """ path to a temp directory for cached initdb. """
52
50
return self ._cached_initdb_dir
53
51
54
52
@cached_initdb_dir .setter
@@ -60,6 +58,7 @@ def cached_initdb_dir(self, value):
60
58
61
59
@property
62
60
def temp_dir (self ):
61
+ """ path to temp dir containing nodes with default 'base_dir'. """
63
62
return tempfile .tempdir
64
63
65
64
@temp_dir .setter
0 commit comments