27
27
import os .path
28
28
29
29
import libioc .helpers_object
30
+ import libioc .Config .Data
30
31
31
32
# MyPy
32
33
import libioc .Logger
@@ -44,7 +45,7 @@ class Prototype:
44
45
"""Prototype of a JailConfig."""
45
46
46
47
logger : typing .Type ['libioc.Logger.Logger' ]
47
- data : ConfigDataDict = {}
48
+ data : ConfigDataDict
48
49
_file : str
49
50
50
51
def __init__ (
@@ -54,6 +55,7 @@ def __init__(
54
55
) -> None :
55
56
56
57
self .logger = libioc .helpers_object .init_logger (self , logger )
58
+ self .data = libioc .Config .Data .Data ()
57
59
58
60
if file is not None :
59
61
self ._file = file
@@ -67,7 +69,7 @@ def file(self) -> str:
67
69
def file (self , value : str ) -> None :
68
70
self ._file = value
69
71
70
- def read (self ) -> ConfigDataDict :
72
+ def read (self ) -> libioc . Config . Data . Data :
71
73
"""
72
74
Read from the configuration file.
73
75
@@ -93,14 +95,14 @@ def write(self, data: ConfigDataDict) -> None:
93
95
def map_input (
94
96
self ,
95
97
data : typing .Union [typing .TextIO , ConfigDataDict ]
96
- ) -> ConfigDataDict :
98
+ ) -> libioc . Config . Data . Data :
97
99
"""
98
100
Map input data (for reading from the configuration).
99
101
100
102
Implementing classes may provide individual mappings.
101
103
"""
102
104
if not isinstance (data , typing .TextIO ):
103
- return data
105
+ return libioc . Config . Data . Data ( data )
104
106
105
107
raise NotImplementedError ("Mapping not implemented on the prototype" )
106
108
0 commit comments