MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / Argument

Class Argument

preprocessor/docopt.py:150–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 5

single_matchMethod · 0.85
parse_atomFunction · 0.85
parse_argvFunction · 0.85
parseArgumentStartingAtFunction · 0.85

Calls

no outgoing calls

Tested by 1