MCPcopy Create free account
hub / github.com/apache/madlib / __init__

Method __init__

src/madpack/argparse.py:1197–1244  ·  view source on GitHub ↗
(self,
                 description,
                 prefix_chars,
                 argument_default,
                 conflict_handler)

Source from the content-addressed store, hash-verified

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