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

Function _swap_method_fallback

pager_lib/getmac/getmac.py:1365–1384  ·  view source on GitHub ↗
(method_type, swap_with)

Source from the content-addressed store, hash-verified

1363
1364
1365def _swap_method_fallback(method_type, swap_with):
1366 # type: (str, str) -> bool
1367 if str(METHOD_CACHE[method_type]) == swap_with:
1368 return True
1369
1370 found = None # type: Optional[Method]
1371 for f_meth in FALLBACK_CACHE[method_type]:
1372 if str(f_meth) == swap_with:
1373 found = f_meth
1374 break
1375
1376 if not found:
1377 return False
1378
1379 curr = METHOD_CACHE[method_type]
1380 FALLBACK_CACHE[method_type].remove(found)
1381 METHOD_CACHE[method_type] = found
1382 FALLBACK_CACHE[method_type].insert(0, curr) # noqa: T484
1383
1384 return True
1385
1386
1387def _warn_critical(err_msg):

Callers 1

get_mac_addressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected