def __init__(self, portal_names, app_matchers):
if not isinstance(app_matchers, list) and not isinstance(app_matchers, tuple):
assert isinstance(app_matchers, AppMatcher)
app_matchers = (app_matchers,)
for matcher in app_matchers:
assert isinstance(matcher, AppMatcher)
self.__app_matchers = app_matchers
self.__portal_matchers = []
if not isinstance(portal_names, list) and not isinstance(portal_names, tuple):
portal_names = (portal_names,)
for name in portal_names:
if isinstance(name, str):
name = re.compile(re.escape(name))
assert hasattr(name, 'match') and callable(name.match)
self.__portal_matchers.append(name)
评论列表
文章目录