def reset_parsers(self, usage=""): # configuration file parser self.cfgfile_parser = configparser.ConfigParser( inline_comment_prefixes=("#", ";")) # command line parser self.cmdline_parser = OptionParser(Option, usage=usage) self.cmdline_parser.options_manager = self self._optik_option_attrs = set(self.cmdline_parser.option_class.ATTRS)
def reset_parsers(self, usage: str = "") -> None: """DEPRECATED.""" warnings.warn( "reset_parsers has been deprecated. Parsers should be instantiated " "once during initialization and do not need to be reset.", DeprecationWarning, ) # configuration file parser self.cfgfile_parser = configparser.ConfigParser( inline_comment_prefixes=("#", ";") ) # command line parser self.cmdline_parser = OptionParser(Option, usage=usage) self.cmdline_parser.options_manager = self # type: ignore[attr-defined] self._optik_option_attrs = set(self.cmdline_parser.option_class.ATTRS)