def parse(self):
"""
Loads the :class:`OptionList` from the associated file, if it exists.
"""
try:
if os.path.isfile(self.filename):
parser = make_parser()
parser.setContentHandler(OptionParser(self))
with open(self.filename, encoding="utf-8") as the_file:
parser.parse(the_file)
except (IOError, OSError, SAXParseException):
pass
#-------------------------------------------------------------------------
#
# OptionParser
#
#-------------------------------------------------------------------------
评论列表
文章目录