Ejemplo n.º 1
0
 def filter_pat(option, opt, value, parser, action):
     rule = {'match_type': 'glob', 'query': value, 'action': action}
     try:
         getattr(parser.values, option.dest).append(compile_rule(rule))
     except Exception:
         raise OptionValueError('%r is not a valid filename pattern' %
                                value)
Ejemplo n.º 2
0
 def filter_pat(option, opt, value, parser, action):
     try:
         getattr(parser.values, option.dest).append(
             compile_rule({
                 'match_type': 'glob',
                 'query': value,
                 'action': action
             })
         )
     except Exception:
         raise OptionValueError('%r is not a valid filename pattern' % value)