| 1064 | |
| 1065 | |
| 1066 | class OptionGroup (OptionContainer): |
| 1067 | |
| 1068 | def __init__(self, parser, title, description=None): |
| 1069 | self.parser = parser |
| 1070 | OptionContainer.__init__( |
| 1071 | self, parser.option_class, parser.conflict_handler, description) |
| 1072 | self.title = title |
| 1073 | |
| 1074 | def _create_option_list(self): |
| 1075 | self.option_list = [] |
| 1076 | self._share_option_mappings(self.parser) |
| 1077 | |
| 1078 | def set_title(self, title): |
| 1079 | self.title = title |
| 1080 | |
| 1081 | def destroy(self): |
| 1082 | """see OptionParser.destroy().""" |
| 1083 | OptionContainer.destroy(self) |
| 1084 | del self.option_list |
| 1085 | |
| 1086 | # -- Help-formatting methods --------------------------------------- |
| 1087 | |
| 1088 | def format_help(self, formatter): |
| 1089 | result = formatter.format_heading(self.title) |
| 1090 | formatter.indent() |
| 1091 | result += OptionContainer.format_help(self, formatter) |
| 1092 | formatter.dedent() |
| 1093 | return result |
| 1094 | |
| 1095 | |
| 1096 | class OptionParser (OptionContainer): |
no outgoing calls
searching dependent graphs…