mirror of
https://github.com/gnh1201/caterpillar.git
synced 2025-09-05 17:31:03 +00:00
Update base.py
This commit is contained in:
parent
c19a38a008
commit
ed91362515
9
base.py
9
base.py
|
@ -200,13 +200,16 @@ class Extension:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def test_connector(cls, data):
|
def test_connector(cls, data):
|
||||||
def test(prelude, data):
|
def test(preludes, data):
|
||||||
return data.find(prelude) == 0
|
for prelude in preludes:
|
||||||
|
if data.find(prelude) == 0:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
for extension in cls.extensions:
|
for extension in cls.extensions:
|
||||||
if (
|
if (
|
||||||
extension.type == "connector"
|
extension.type == "connector"
|
||||||
and test(extension.prelude, data)
|
and test(extension.preludes, data)
|
||||||
):
|
):
|
||||||
return extension
|
return extension
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user