mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-11 00:19:15 +00:00
linting
This commit is contained in:
@@ -436,7 +436,7 @@ class CfgYaml:
|
|||||||
if self._debug:
|
if self._debug:
|
||||||
self._dbg('saving to {}'.format(self._path))
|
self._dbg('saving to {}'.format(self._path))
|
||||||
try:
|
try:
|
||||||
with open(self._path, 'w') as file:
|
with open(self._path, 'w', encoding='utf8') as file:
|
||||||
self._yaml_dump(content, file)
|
self._yaml_dump(content, file)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
self._log.err(exc)
|
self._log.err(exc)
|
||||||
@@ -581,9 +581,9 @@ class CfgYaml:
|
|||||||
|
|
||||||
uvars = {}
|
uvars = {}
|
||||||
if not self._reloading and uvariables:
|
if not self._reloading and uvariables:
|
||||||
for k, v in uvariables.items():
|
for name, prompt in uvariables.items():
|
||||||
content = userinput(v, debug=self._debug)
|
content = userinput(prompt, debug=self._debug)
|
||||||
uvars[k] = content
|
uvars[name] = content
|
||||||
|
|
||||||
if uvars:
|
if uvars:
|
||||||
uvars = uvars.copy()
|
uvars = uvars.copy()
|
||||||
@@ -1105,7 +1105,7 @@ class CfgYaml:
|
|||||||
if self._debug:
|
if self._debug:
|
||||||
self._dbg('----------start:{}----------'.format(path))
|
self._dbg('----------start:{}----------'.format(path))
|
||||||
cfg = '\n'
|
cfg = '\n'
|
||||||
with open(path, 'r') as file:
|
with open(path, 'r', encoding='utf8') as file:
|
||||||
for line in file:
|
for line in file:
|
||||||
cfg += line
|
cfg += line
|
||||||
self._dbg(cfg.rstrip())
|
self._dbg(cfg.rstrip())
|
||||||
@@ -1150,7 +1150,7 @@ class CfgYaml:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def _yaml_load(cls, path):
|
def _yaml_load(cls, path):
|
||||||
"""load from yaml"""
|
"""load from yaml"""
|
||||||
with open(path, 'r') as file:
|
with open(path, 'r', encoding='utf8') as file:
|
||||||
data = yaml()
|
data = yaml()
|
||||||
data.typ = 'rt'
|
data.typ = 'rt'
|
||||||
content = data.load(file)
|
content = data.load(file)
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ class Templategen:
|
|||||||
path = os.path.normpath(path)
|
path = os.path.normpath(path)
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
raise TemplateNotFound(path)
|
raise TemplateNotFound(path)
|
||||||
with open(path, 'r') as file:
|
with open(path, 'r', encoding='utf8') as file:
|
||||||
content = file.read()
|
content = file.read()
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user