MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __init__

Method __init__

tools/python-3.11.9-amd64/Lib/argparse.py:1342–1390  ·  view source on GitHub ↗
(self,
                 description,
                 prefix_chars,
                 argument_default,
                 conflict_handler)

Source from the content-addressed store, hash-verified

1340class _ActionsContainer(object):
1341
1342 def __init__(self,
1343 description,
1344 prefix_chars,
1345 argument_default,
1346 conflict_handler):
1347 super(_ActionsContainer, self).__init__()
1348
1349 self.description = description
1350 self.argument_default = argument_default
1351 self.prefix_chars = prefix_chars
1352 self.conflict_handler = conflict_handler
1353
1354 # set up registries
1355 self._registries = {}
1356
1357 # register actions
1358 self.register('action', None, _StoreAction)
1359 self.register('action', 'store', _StoreAction)
1360 self.register('action', 'store_const', _StoreConstAction)
1361 self.register('action', 'store_true', _StoreTrueAction)
1362 self.register('action', 'store_false', _StoreFalseAction)
1363 self.register('action', 'append', _AppendAction)
1364 self.register('action', 'append_const', _AppendConstAction)
1365 self.register('action', 'count', _CountAction)
1366 self.register('action', 'help', _HelpAction)
1367 self.register('action', 'version', _VersionAction)
1368 self.register('action', 'parsers', _SubParsersAction)
1369 self.register('action', 'extend', _ExtendAction)
1370
1371 # raise an exception if the conflict handler is invalid
1372 self._get_handler()
1373
1374 # action storage
1375 self._actions = []
1376 self._option_string_actions = {}
1377
1378 # groups
1379 self._action_groups = []
1380 self._mutually_exclusive_groups = []
1381
1382 # defaults storage
1383 self._defaults = {}
1384
1385 # determines whether an "option" looks like a negative number
1386 self._negative_number_matcher = _re.compile(r'^-\d+$|^-\d*\.\d+$')
1387
1388 # whether or not there are any optionals that look like negative
1389 # numbers -- uses a list so it can be shared and edited
1390 self._has_negative_number_optionals = []
1391
1392 # ====================
1393 # Registration methods

Callers

nothing calls this directly

Calls 4

registerMethod · 0.95
_get_handlerMethod · 0.95
__init__Method · 0.45
compileMethod · 0.45

Tested by

no test coverage detected