MCPcopy Create free account
hub / github.com/nodejs/node / SourceTreeAndPathFromPath

Function SourceTreeAndPathFromPath

tools/gyp/pylib/gyp/xcodeproj_file.py:176–193  ·  view source on GitHub ↗

Given input_path, returns a tuple with sourceTree and path values. Examples: input_path (source_tree, output_path) '$(VAR)/path' ('VAR', 'path') '$(VAR)' ('VAR', None) 'path' (None, 'path')

(input_path)

Source from the content-addressed store, hash-verified

174
175
176def SourceTreeAndPathFromPath(input_path):
177 """Given input_path, returns a tuple with sourceTree and path values.
178
179 Examples:
180 input_path (source_tree, output_path)
181 '$(VAR)/path' ('VAR', 'path')
182 '$(VAR)' ('VAR', None)
183 'path' (None, 'path')
184 """
185
186 if source_group_match := _path_leading_variable.match(input_path):
187 source_tree = source_group_match.group(1)
188 output_path = source_group_match.group(3) # This may be None.
189 else:
190 source_tree = None
191 output_path = input_path
192
193 return (source_tree, output_path)
194
195
196def ConvertVariablesToShellSyntax(input_string):

Callers 2

__init__Method · 0.85
RootGroupForPathMethod · 0.85

Calls 1

matchMethod · 0.65

Tested by

no test coverage detected