18 from functools
import partial
20 from .compat
import py2to3
21 from .normalizing
import normalize
22 from .platform
import IRONPYTHON, PY3
23 from .robottypes
import is_string
26 def eq(str1, str2, ignore=(), caseless=
True, spaceless=
True):
27 str1 =
normalize(str1, ignore, caseless, spaceless)
28 str2 =
normalize(str2, ignore, caseless, spaceless)
35 def __init__(self, pattern, ignore=(), caseless=
True, spaceless=
True,
37 if PY3
and isinstance(pattern, bytes):
38 raise TypeError(
'Matching bytes is not supported on Python 3.')
40 self.
_normalize_normalize = partial(normalize, ignore=ignore, caseless=caseless,
46 pattern = fnmatch.translate(pattern)
48 if IRONPYTHON
and "\\'" in pattern:
49 pattern = pattern.replace(
"\\'",
"'")
50 return re.compile(pattern, re.DOTALL)
56 return any(self.
matchmatch(s)
for s
in strings)
64 def __init__(self, patterns=None, ignore=(), caseless=
True, spaceless=
True,
65 match_if_no_patterns=
False, regexp=
False):
79 return any(m.match(string)
for m
in self.
_matchers_matchers)
83 return any(self.
matchmatch(s)
for s
in strings)
def __init__(self, pattern, ignore=(), caseless=True, spaceless=True, regexp=False)
def match_any(self, strings)
def _compile(self, pattern, regexp=False)
def _ensure_list(self, patterns)
def match_any(self, strings)
def __init__(self, patterns=None, ignore=(), caseless=True, spaceless=True, match_if_no_patterns=False, regexp=False)
def eq(str1, str2, ignore=(), caseless=True, spaceless=True)
def normalize(string, ignore=(), caseless=True, spaceless=True)
Normalizes given string according to given spec.