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

Method get

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

Source from the content-addressed store, hash-verified

961 return check_command("ifconfig")
962
963 def get(self, arg): # type: (str) -> Optional[str]
964 # Check if this version of "ifconfig" accepts an interface argument
965 command_output = ""
966
967 if not self._tested_arg:
968 try:
969 command_output = _popen("ifconfig", arg)
970 self._iface_arg = True
971 except CalledProcessError:
972 self._iface_arg = False
973 self._tested_arg = True
974
975 if self._iface_arg and not command_output: # Don't repeat work on first run
976 command_output = _popen("ifconfig", arg)
977 else:
978 command_output = _popen("ifconfig", "")
979
980 return _parse_ifconfig(arg, command_output)
981
982
983# TODO: create new methods, IfconfigNoArgs and IfconfigVariousArgs

Callers

nothing calls this directly

Calls 2

_popenFunction · 0.85
_parse_ifconfigFunction · 0.85

Tested by

no test coverage detected