我们从Python开源项目中,提取了以下16个代码示例,用于说明如何使用distutils.errors.DistutilsGetoptError()。
def add_option (self, long_option, short_option=None, help_string=None): if long_option in self.option_index: raise DistutilsGetoptError, \ "option conflict: already an option '%s'" % long_option else: option = (long_option, short_option, help_string) self.option_table.append(option) self.option_index[long_option] = option
def _check_alias_dict (self, aliases, what): assert isinstance(aliases, dict) for (alias, opt) in aliases.items(): if alias not in self.option_index: raise DistutilsGetoptError, \ ("invalid %s '%s': " "option '%s' not defined") % (what, alias, alias) if opt not in self.option_index: raise DistutilsGetoptError, \ ("invalid %s '%s': " "aliased option '%s' not defined") % (what, alias, opt)