Update util.py
Removed the unused is_arm function
This commit is contained in:
@@ -1,22 +1,17 @@
|
|||||||
"""Utility methods."""
|
"""Utility methods."""
|
||||||
|
|
||||||
import platform
|
|
||||||
import uuid
|
import uuid
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
|
||||||
def get_mac() -> str:
|
def get_mac() -> str:
|
||||||
mac = uuid.getnode()
|
"""Get MAC address as a string."""
|
||||||
mac_str = ":".join(f"{(mac >> i) & 0xff:02x}" for i in range(40, -1, -8))
|
return ":".join(
|
||||||
return mac_str
|
f"{((uuid.getnode() >> i) & 0xFF):02x}" for i in range(0, 8 * 6, 8)
|
||||||
|
)[::-1]
|
||||||
|
|
||||||
|
|
||||||
def call_all(*callables: Optional[Callable[[], None]]) -> None:
|
def call_all(*callables: Optional[Callable[[], None]]) -> None:
|
||||||
for item in filter(None, callables):
|
for item in filter(None, callables):
|
||||||
item()
|
item()
|
||||||
|
|
||||||
|
|
||||||
def is_arm() -> bool:
|
|
||||||
machine = platform.machine()
|
|
||||||
return ("arm" in machine) or ("aarch" in machine)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user