Skip to content

Commit

Permalink
Update base.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gnh1201 authored Nov 12, 2024
1 parent c19a38a commit ed91362
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions base.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,16 @@ def get_connector(cls, connection_type):

@classmethod
def test_connector(cls, data):
def test(prelude, data):
return data.find(prelude) == 0
def test(preludes, data):
for prelude in preludes:
if data.find(prelude) == 0:
return True
return False

for extension in cls.extensions:
if (
extension.type == "connector"
and test(extension.prelude, data)
and test(extension.preludes, data)
):
return extension
return None
Expand Down

0 comments on commit ed91362

Please sign in to comment.