mirror of
https://github.com/gnh1201/caterpillar.git
synced 2024-11-26 07:21:46 +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
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user