MCPcopy Index your code
hub / github.com/tanelpoder/0xtools / __init__

Method __init__

lib/0xtools/argparse.py:1191–1238  ·  view source on GitHub ↗
(self,
                 description,
                 prefix_chars,
                 argument_default,
                 conflict_handler)

Source from the content-addressed store, hash-verified

1189class _ActionsContainer(object):
1190
1191 def __init__(self,
1192 description,
1193 prefix_chars,
1194 argument_default,
1195 conflict_handler):
1196 super(_ActionsContainer, self).__init__()
1197
1198 self.description = description
1199 self.argument_default = argument_default
1200 self.prefix_chars = prefix_chars
1201 self.conflict_handler = conflict_handler
1202
1203 # set up registries
1204 self._registries = {}
1205
1206 # register actions
1207 self.register('action', None, _StoreAction)
1208 self.register('action', 'store', _StoreAction)
1209 self.register('action', 'store_const', _StoreConstAction)
1210 self.register('action', 'store_true', _StoreTrueAction)
1211 self.register('action', 'store_false', _StoreFalseAction)
1212 self.register('action', 'append', _AppendAction)
1213 self.register('action', 'append_const', _AppendConstAction)
1214 self.register('action', 'count', _CountAction)
1215 self.register('action', 'help', _HelpAction)
1216 self.register('action', 'version', _VersionAction)
1217 self.register('action', 'parsers', _SubParsersAction)
1218
1219 # raise an exception if the conflict handler is invalid
1220 self._get_handler()
1221
1222 # action storage
1223 self._actions = []
1224 self._option_string_actions = {}
1225
1226 # groups
1227 self._action_groups = []
1228 self._mutually_exclusive_groups = []
1229
1230 # defaults storage
1231 self._defaults = {}
1232
1233 # determines whether an "option" looks like a negative number
1234 self._negative_number_matcher = _re.compile(r'^-\d+$|^-\d*\.\d+$')
1235
1236 # whether or not there are any optionals that look like negative
1237 # numbers -- uses a list so it can be shared and edited
1238 self._has_negative_number_optionals = []
1239
1240 # ====================
1241 # Registration methods

Callers

nothing calls this directly

Calls 3

registerMethod · 0.95
_get_handlerMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected