MCPcopy
hub / github.com/docopt/docopt / Argument

Class Argument

docopt.py:155–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153
154
155class Argument(ChildPattern):
156
157 def single_match(self, left):
158 for n, p in enumerate(left):
159 if type(p) is Argument:
160 return n, Argument(self.name, p.value)
161 return None, None
162
163 @classmethod
164 def parse(class_, source):
165 name = re.findall('(<\S*?>)', source)[0]
166 value = re.findall('\[default: (.*)\]', source, flags=re.I)
167 return class_(name, value[0] if value else None)
168
169
170class Command(Argument):

Callers 15

test_pattern_flatFunction · 0.90
test_parse_argvFunction · 0.90
test_parse_patternFunction · 0.90
test_option_matchFunction · 0.90
test_argument_matchFunction · 0.90
test_command_matchFunction · 0.90
test_optional_matchFunction · 0.90
test_either_matchFunction · 0.90
test_one_or_more_matchFunction · 0.90
test_list_argument_matchFunction · 0.90
test_pattern_eitherFunction · 0.90

Calls

no outgoing calls

Tested by 15

test_pattern_flatFunction · 0.72
test_parse_argvFunction · 0.72
test_parse_patternFunction · 0.72
test_option_matchFunction · 0.72
test_argument_matchFunction · 0.72
test_command_matchFunction · 0.72
test_optional_matchFunction · 0.72
test_either_matchFunction · 0.72
test_one_or_more_matchFunction · 0.72
test_list_argument_matchFunction · 0.72
test_pattern_eitherFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…