Skip to content

Commit aed94a7

Browse files
authored
Merge pull request #3 from muslih-DIY/dev
class_type attribute not need to declare in the dataclass
2 parents 7b3ed69 + fc43c54 commit aed94a7

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

ClassConfig/ReadConfig.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ def load(self):
5151

5252
for path in self._config_paths:
5353
configfile = config.readConfigDict(path)
54-
print(path)
5554
for conf_name,conf in configfile.items():
56-
print(conf)
57-
class_type = conf.get('class_type',None)
55+
class_type = conf.pop('class_type',None)
5856
if class_type and self._config_class.get(class_type):
5957
setattr(self,conf_name,self._config_class[class_type](**conf))
6058
continue

tests/test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
@dataclass
1414
class _oracledb:
15-
class_type:str
1615
dbname :str
1716
dbuser :str
1817
host :str
@@ -25,7 +24,6 @@ def __post_init__(self):
2524

2625
@dataclass
2726
class _postgresdb:
28-
class_type:str
2927
dbname :str
3028
dbuser :str
3129
host :str

0 commit comments

Comments
 (0)