simplified
This commit is contained in:
parent
b81116f62a
commit
3ee98164fa
|
@ -144,10 +144,9 @@ class Config(dict):
|
||||||
Configuration from file.
|
Configuration from file.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if isinstance(fname, (str, Path)):
|
fhandle = open(fname) if isinstance(fname, (str, Path)) else \
|
||||||
fhandle = open(fname)
|
fname
|
||||||
else:
|
|
||||||
fhandle = fname
|
|
||||||
return cls(yaml.safe_load(fhandle))
|
return cls(yaml.safe_load(fhandle))
|
||||||
|
|
||||||
def save(self,
|
def save(self,
|
||||||
|
@ -164,10 +163,8 @@ class Config(dict):
|
||||||
Keyword arguments parsed to yaml.dump.
|
Keyword arguments parsed to yaml.dump.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if isinstance(fname, (str, Path)):
|
fhandle = open(fname,'w',newline='\n') if isinstance(fname, (str, Path)) else \
|
||||||
fhandle = open(fname,'w',newline='\n')
|
fname
|
||||||
else:
|
|
||||||
fhandle = fname
|
|
||||||
|
|
||||||
if 'width' not in kwargs:
|
if 'width' not in kwargs:
|
||||||
kwargs['width'] = 256
|
kwargs['width'] = 256
|
||||||
|
|
Loading…
Reference in New Issue