def __init__(self): self.config = optparse.Values() for option in self.options: try: option, optdict = option except ValueError: raise Exception('Bad option: %r' % option) if isinstance(optdict.get('default'), Method): optdict['default'].bind(self) elif isinstance(optdict.get('callback'), Method): optdict['callback'].bind(self) self.load_defaults()
def __init__(self) -> None: self.config = optik_ext.Values() for option_tuple in self.options: try: option, optdict = option_tuple except ValueError: raise Exception("Bad option: %s" % str(option_tuple)) if isinstance(optdict.get("default"), Method): optdict["default"].bind(self) elif isinstance(optdict.get("callback"), Method): optdict["callback"].bind(self) self.load_defaults()