diff options
Diffstat (limited to 'src/debputy/integration_detection.py')
-rw-r--r-- | src/debputy/integration_detection.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/debputy/integration_detection.py b/src/debputy/integration_detection.py new file mode 100644 index 0000000..f412268 --- /dev/null +++ b/src/debputy/integration_detection.py @@ -0,0 +1,21 @@ +from typing import Container, Optional + +from debputy.plugin.api.spec import ( + DebputyIntegrationMode, + INTEGRATION_MODE_DH_DEBPUTY_RRR, + INTEGRATION_MODE_DH_DEBPUTY, +) + + +def determine_debputy_integration_mode( + all_sequences: Container[str], +) -> Optional[DebputyIntegrationMode]: + + has_zz_debputy = "zz-debputy" in all_sequences or "debputy" in all_sequences + has_zz_debputy_rrr = "zz-debputy-rrr" in all_sequences + has_any_existing = has_zz_debputy or has_zz_debputy_rrr + if has_zz_debputy_rrr: + return INTEGRATION_MODE_DH_DEBPUTY_RRR + if has_any_existing: + return INTEGRATION_MODE_DH_DEBPUTY + return None |