1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 19:09:44 +00:00

add __repr__

This commit is contained in:
deadc0de6
2019-03-23 18:04:08 +01:00
parent 1f836d2b74
commit 90f9ced746
2 changed files with 9 additions and 0 deletions

View File

@@ -27,6 +27,9 @@ class Cmd:
def __str__(self):
return 'key:{} -> \"{}\"'.format(self.key, self.action)
def __repr__(self):
return 'cmd({})'.format(self.__str__())
def __eq__(self, other):
return self.__dict__ == other.__dict__
@@ -51,6 +54,9 @@ class Action(Cmd):
out = '{}: \"{}\" with args: {}'
return out.format(self.key, self.action, self.args)
def __repr__(self):
return 'action({})'.format(self.__str__())
def execute(self):
"""execute the action in the shell"""
ret = 1

View File

@@ -41,6 +41,9 @@ class Dotfile:
msg = 'key:\"{}\", src:\"{}\", dst:\"{}\", link:\"{}\"'
return msg.format(self.key, self.src, self.dst, self.link.name.lower())
def __repr__(self):
return 'dotfile({})'.format(self.__str__())
def __eq__(self, other):
return self.__dict__ == other.__dict__