1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-07 20:54:22 +00:00

debug log improvements

This commit is contained in:
deadc0de6
2020-06-23 10:25:30 +02:00
parent 2a67c49edd
commit e8f4d9afe8
8 changed files with 196 additions and 74 deletions

View File

@@ -107,5 +107,36 @@ class Dotfile(DictParser):
msg = 'key:\"{}\", src:\"{}\", dst:\"{}\", link:\"{}\"'
return msg.format(self.key, self.src, self.dst, str(self.link))
def prt(self):
"""extended dotfile to str"""
indent = ' '
out = 'dotfile: \"{}\"'.format(self.key)
out += '\n{}src: \"{}\"'.format(indent, self.src)
out += '\n{}dst: \"{}\"'.format(indent, self.dst)
out += '\n{}link: \"{}\"'.format(indent, str(self.link))
out += '\n{}pre-action:'.format(indent)
some = self.get_pre_actions()
if some:
for a in some:
out += '\n{}- {}'.format(2 * indent, a)
out += '\n{}post-action:'.format(indent)
some = self.get_post_actions()
if some:
for a in some:
out += '\n{}- {}'.format(2 * indent, a)
out += '\n{}trans_r:'.format(indent)
some = self.get_trans_r()
if some:
out += '\n{}- {}'.format(2 * indent, some)
out += '\n{}trans_w:'.format(indent)
some = self.get_trans_w()
if some:
out += '\n{}- {}'.format(2 * indent, some)
return out
def __repr__(self):
return 'dotfile({!s})'.format(self)