Fixed flake8 issues in networking, plugins and profiles.
This commit is contained in:
parent
0c4ba29978
commit
b573421df2
|
|
@ -4,7 +4,7 @@ import socket
|
||||||
import struct
|
import struct
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
from .exceptions import *
|
from .exceptions import HardwareIncompatibilityError
|
||||||
from .general import SysCommand
|
from .general import SysCommand
|
||||||
from .output import log
|
from .output import log
|
||||||
from .storage import storage
|
from .storage import storage
|
||||||
|
|
@ -30,7 +30,7 @@ def list_interfaces(skip_loopback=True):
|
||||||
|
|
||||||
def check_mirror_reachable():
|
def check_mirror_reachable():
|
||||||
log("Testing connectivity to the Arch Linux mirrors ...", level=logging.INFO)
|
log("Testing connectivity to the Arch Linux mirrors ...", level=logging.INFO)
|
||||||
if (exit_code := SysCommand("pacman -Sy").exit_code) == 0:
|
if SysCommand("pacman -Sy").exit_code == 0:
|
||||||
return True
|
return True
|
||||||
elif os.geteuid() != 0:
|
elif os.geteuid() != 0:
|
||||||
log("check_mirror_reachable() uses 'pacman -Sy' which requires root.", level=logging.ERROR, fg="red")
|
log("check_mirror_reachable() uses 'pacman -Sy' which requires root.", level=logging.ERROR, fg="red")
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ def import_via_path(path :str, namespace=None): # -> module (not sure how to wri
|
||||||
def find_nth(haystack, needle, n):
|
def find_nth(haystack, needle, n):
|
||||||
start = haystack.find(needle)
|
start = haystack.find(needle)
|
||||||
while start >= 0 and n > 1:
|
while start >= 0 and n > 1:
|
||||||
start = haystack.find(needle, start+len(needle))
|
start = haystack.find(needle, start + len(needle))
|
||||||
n -= 1
|
n -= 1
|
||||||
return start
|
return start
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import hashlib
|
import hashlib
|
||||||
import importlib.util
|
import importlib.util
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
import ssl
|
import ssl
|
||||||
import sys
|
import sys
|
||||||
|
|
@ -10,7 +11,7 @@ import urllib.request
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from .general import multisplit
|
from .general import multisplit
|
||||||
from .networking import *
|
from .networking import list_interfaces
|
||||||
from .storage import storage
|
from .storage import storage
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue