Skip to content

Commit cf0f5be

Browse files
authored
Merge pull request #7 from muslih-DIY/dev
Dev
2 parents 138ee82 + a13e318 commit cf0f5be

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

ClassConfig/ReadConfig.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ class config:
1010
# }
1111
_config_paths: list = None
1212

13-
def __init__(self,path:str|list|None=None) -> None:
13+
def __init__(self,path=None) -> None:
14+
"""
15+
path should be list|str
16+
17+
"""
1418
self.path = path
1519

1620
@property
@@ -19,14 +23,15 @@ def path(self):
1923
return self._config_paths
2024

2125
@path.setter
22-
def path(self,path:str|list|None=None):
26+
def path(self,path=None):
2327
if path is None:
2428
self._config_paths = []
25-
if isinstance(path,str):
29+
elif isinstance(path,str):
2630
self._config_paths = [path]
27-
if isinstance(path,list):
31+
elif isinstance(path,list):
2832
self._config_paths = path
29-
33+
else:
34+
raise ValueError('path should be list|str')
3035
class DictClass(object):
3136
"create a class from dict"
3237
def __init__(self, **kwargs):

0 commit comments

Comments
 (0)