1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-06 07:52:57 +00:00

Testing merge funcationalities in import_configs

This commit is contained in:
Davide Laezza
2019-04-22 00:38:33 +02:00
parent bcf89478ba
commit 124336ed57
4 changed files with 305 additions and 65 deletions

View File

@@ -14,6 +14,7 @@ from dotdrop.logger import Logger
class Cmd:
eq_ignore = ('log',)
def __init__(self, key, action):
"""constructor
@@ -31,7 +32,17 @@ class Cmd:
return 'cmd({})'.format(self.__str__())
def __eq__(self, other):
return self.__dict__ == other.__dict__
self_dict = {
k: v
for k, v in self.__dict__.items()
if k not in self.eq_ignore
}
other_dict = {
k: v
for k, v in other.__dict__.items()
if k not in self.eq_ignore
}
return self_dict == other_dict
def __hash__(self):
return hash(self.key) ^ hash(self.action)