-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Artiom N
committed
Oct 5, 2022
1 parent
0d5b56d
commit 3ce48dd
Showing
7 changed files
with
97 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from enum import Enum | ||
|
||
from markdown_toolset.deduplicators.content_hash_dedup import ContentHashDeduplicator | ||
from markdown_toolset.deduplicators.name_hash_dedup import NameHashDeduplicator | ||
|
||
|
||
class DeduplicationVariant(Enum): | ||
DISABLED = 0, | ||
NAMES_HASHING = 1, | ||
CONTENT_HASH = 2 | ||
|
||
|
||
DEDUP_MAP = { | ||
DeduplicationVariant.CONTENT_HASH: ContentHashDeduplicator, | ||
DeduplicationVariant.NAMES_HASHING: NameHashDeduplicator, | ||
DeduplicationVariant.DISABLED: None, | ||
} | ||
|
||
|
||
def select_deduplicator(deduplication_variant: DeduplicationVariant, *args, **kwargs): | ||
dedup_class = DEDUP_MAP[deduplication_variant] | ||
|
||
return dedup_class(*args, **kwargs) if dedup_class is not None else None | ||
|
||
|
||
__all__ = [DeduplicationVariant, select_deduplicator] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters