Skip to content

Commit

Permalink
have github issues de-duplicated
Browse files Browse the repository at this point in the history
  • Loading branch information
maxandersen committed Dec 9, 2023
1 parent e91b752 commit 77ede92
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions did/plugins/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ def __str__(self):
return "{0}/{1}#{2} - {3}".format(
self.owner, self.project,
str(self.id).zfill(PADDING), self.data["title"])

def __eq__(self, other):
""" Equality comparison """
if isinstance(other, Issue):
return self.owner == other.owner and self.project == other.project and self.id == other.id
return False

def __hash__(self):
""" Hash function """
return hash((self.owner, self.project, self.id))


# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit 77ede92

Please sign in to comment.