def convert(self, val, param, ctx): val = read(val) if not val: return [] try: filt = json.loads(val) except ValueError: raise click.BadParameter('invalid JSON') if not filters.is_filter_like(filt): self.fail('Does not appear to be valid filter', param, ctx) return filt
def convert(self, val, param, ctx): val = read(val) if not val: return [] try: filt = json.loads(val) except ValueError: raise click.BadParameter('invalid JSON') if not filters.is_filter_like(filt): self.fail('Does not appear to be valid filter', param, ctx) return filt