예제 #1
0
 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()
예제 #2
0
 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()