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

Method get

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

Source from the content-addressed store, hash-verified

860 return check_command("wmic.exe")
861
862 def get(self, arg): # type: (str) -> Optional[str]
863 command_output = _popen(
864 "wmic.exe",
865 'nic where "NetConnectionID = \'%s\'" get "MACAddress" /value' % arg,
866 )
867
868 # Negative: "No Instance(s) Available"
869 # Positive: "MACAddress=00:FF:E7:78:95:A0"
870 # NOTE: .partition() always returns 3 parts,
871 # therefore it won't cause an IndexError
872 return command_output.strip().partition("=")[2]
873
874
875class DarwinNetworksetupIface(Method):

Callers

nothing calls this directly

Calls 1

_popenFunction · 0.85

Tested by

no test coverage detected