def iter_options(): for o in select.findAll("option"): term = Term.parse(o.text) if term: attrs = dict(o.attrs) yield (term, attrs["value"])
def iter_options(): for o in select.findAll('option'): term = Term.parse(o.text) if term: attrs = dict(o.attrs) yield (term, attrs['value'])
def term_type(value): term = Term.parse(value) if term is None: raise argparse.ArgumentTypeError("invalid format") return term