mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-09 02:42:30 -05:00
Config locks (#2654)
* Config locks Signed-off-by: Toby Harradine <tobyharradine@gmail.com> * Add locks for all_XXX Signed-off-by: Toby Harradine <tobyharradine@gmail.com> * Remove a word Signed-off-by: Toby Harradine <tobyharradine@gmail.com> * Add acquire_lock kwarg for value context manager Signed-off-by: Toby Harradine <tobyharradine@gmail.com> * Add towncrier entry Signed-off-by: Toby <tobyharradine@gmail.com> * Fix issues with `get_custom_lock` and `get_members_lock` Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
committed by
Michael H
parent
a8091332b8
commit
af096bc1cc
@@ -56,6 +56,19 @@ class IdentifierData:
|
||||
f" identifiers={self.identifiers}>"
|
||||
)
|
||||
|
||||
def __eq__(self, other) -> bool:
|
||||
if not isinstance(other, IdentifierData):
|
||||
return False
|
||||
return (
|
||||
self.uuid == other.uuid
|
||||
and self.category == other.category
|
||||
and self.primary_key == other.primary_key
|
||||
and self.identifiers == other.identifiers
|
||||
)
|
||||
|
||||
def __hash__(self) -> int:
|
||||
return hash((self.uuid, self.category, self.primary_key, self.identifiers))
|
||||
|
||||
def add_identifier(self, *identifier: str) -> "IdentifierData":
|
||||
if not all(isinstance(i, str) for i in identifier):
|
||||
raise ValueError("Identifiers must be strings.")
|
||||
|
||||
Reference in New Issue
Block a user