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

Method get

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

Source from the content-addressed store, hash-verified

796 return check_command("getmac.exe")
797
798 def get(self, arg): # type: (str) -> Optional[str]
799 try:
800 # /nh: Suppresses table headers
801 # /v: Verbose
802 command_output = _popen("getmac.exe", "/NH /V")
803 except CalledProcessError as ex:
804 # This shouldn't cause an exception if it's valid command
805 log.error("getmac.exe failed, marking unusable. Exception: %s", str(ex))
806 self.unusable = True
807 return None
808
809 if self._champ:
810 return _search(self._champ[0] + arg + self._champ[1], command_output)
811
812 for pair in self._regexes:
813 result = _search(pair[0] + arg + pair[1], command_output)
814 if result:
815 self._champ = pair
816 return result
817
818 return None
819
820
821class IpconfigExe(Method):

Callers

nothing calls this directly

Calls 3

_popenFunction · 0.85
_searchFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected