MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _search

Function _search

pager_lib/getmac/getmac.py:239–250  ·  view source on GitHub ↗
(regex, text, group_index=0, flags=0)

Source from the content-addressed store, hash-verified

237
238
239def _search(regex, text, group_index=0, flags=0):
240 # type: (str, str, int, int) -> Optional[str]
241 if not text:
242 if DEBUG:
243 log.debug("No text to _search()")
244 return None
245
246 match = re.search(regex, text, flags)
247 if match:
248 return match.groups()[group_index]
249
250 return None
251
252
253def _popen(command, args):

Callers 14

getMethod · 0.85
getMethod · 0.85
getMethod · 0.85
getMethod · 0.85
getMethod · 0.85
getMethod · 0.85
getMethod · 0.85
getMethod · 0.85
getMethod · 0.85
_parse_ifconfigFunction · 0.85
getMethod · 0.85
getMethod · 0.85

Calls 1

debugMethod · 0.80

Tested by

no test coverage detected