def _preprocess(argument):
"""Receives the argument (from the constructor), and normalizes it
into a list of Pattern objects."""
pattern_set = PatternSet()
if argument is not None:
if isinstance(argument, basestring):
argument = [argument]
for glob in argument:
if isinstance(glob, basestring):
patterns = Pattern.create(glob)
pattern_set.extend(patterns)
elif isinstance(glob, Pattern):
pattern_set.append(glob)
return pattern_set
评论列表
文章目录