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

Method get

pager_lib/getmac/getmac.py:412–427  ·  view source on GitHub ↗
(self, arg)

Source from the content-addressed store, hash-verified

410 return check_path(self._path)
411
412 def get(self, arg): # type: (str) -> Optional[str]
413 if not arg:
414 return None
415
416 data = _read_file(self._path)
417
418 if data is None:
419 self.unusable = True
420 return None
421
422 if data is not None and len(data) > 1:
423 # Need a space, otherwise a search for 192.168.16.2
424 # will match 192.168.16.254 if it comes first!
425 return _search(re.escape(arg) + r" .+" + MAC_RE_COLON, data)
426
427 return None
428
429
430class ArpFreebsd(Method):

Callers

nothing calls this directly

Calls 3

_read_fileFunction · 0.85
_searchFunction · 0.85
escapeMethod · 0.80

Tested by

no test coverage detected