1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-07 01:55:37 +00:00

code quality

This commit is contained in:
deadc0de6
2021-02-20 13:36:24 +01:00
parent 6cd5755170
commit 1c0749822f
5 changed files with 10 additions and 15 deletions

View File

@@ -669,13 +669,15 @@ class CfgYaml:
err = 'bad format for chmod: {}'.format(val)
self._log.err(err)
raise YamlException('config content error: {}'.format(err))
# normalize chmod value
for x in list(val):
y = int(x)
if y >= 0 or y <= 7:
continue
err = 'bad format for chmod: {}'.format(val)
self._log.err(err)
raise YamlException('config content error: {}'.format(err))
if y < 0 or y > 7:
err = 'bad format for chmod: {}'.format(val)
self._log.err(err)
raise YamlException(
'config content error: {}'.format(err)
)
v[self.key_dotfile_chmod] = int(val, 8)
return new
@@ -1028,7 +1030,6 @@ class CfgYaml:
if not yamldict[self.key_dotfiles]:
return
for k, dotfile in yamldict[self.key_dotfiles].items():
new = self.lnk_nolink
if self.key_dotfile_link in dotfile and \
type(dotfile[self.key_dotfile_link]) is bool:
# patch link: <bool>