Skip to content

Dev #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions ClassConfig/ReadConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ class config:
# }
_config_paths: list = None

def __init__(self,path:str|list|None=None) -> None:
def __init__(self,path=None) -> None:
"""
path should be list|str

"""
self.path = path

@property
Expand All @@ -19,14 +23,15 @@ def path(self):
return self._config_paths

@path.setter
def path(self,path:str|list|None=None):
def path(self,path=None):
if path is None:
self._config_paths = []
if isinstance(path,str):
elif isinstance(path,str):
self._config_paths = [path]
if isinstance(path,list):
elif isinstance(path,list):
self._config_paths = path

else:
raise ValueError('path should be list|str')
class DictClass(object):
"create a class from dict"
def __init__(self, **kwargs):
Expand Down