Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorDylan Taylor <dylan@dylanmtaylor.com>2021-05-15 15:11:59 -0400
committerDylan Taylor <dylan@dylanmtaylor.com>2021-05-15 15:14:38 -0400
commit55b09aa1eb4e5ec83d826b8a3dd10670d674aad7 (patch)
treea436f49849e7c45a02578596f9c30acd6e103e31 /archinstall/lib
parent4a34b3a9d032e62265f31444339ceba1ef0d7168 (diff)
Fix E713 test for membership should be 'not in'
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/networking.py6
-rw-r--r--archinstall/lib/output.py10
-rw-r--r--archinstall/lib/profiles.py2
3 files changed, 9 insertions, 9 deletions
diff --git a/archinstall/lib/networking.py b/archinstall/lib/networking.py
index e12d9cc3..1a5c403f 100644
--- a/archinstall/lib/networking.py
+++ b/archinstall/lib/networking.py
@@ -55,9 +55,9 @@ def wireless_scan(interface):
sys_command(f"iwctl station {interface} scan")
- if not '_WIFI' in storage:
+ if '_WIFI' not in storage:
storage['_WIFI'] = {}
- if not interface in storage['_WIFI']:
+ if interface not in storage['_WIFI']:
storage['_WIFI'][interface] = {}
storage['_WIFI'][interface]['scanning'] = True
@@ -66,7 +66,7 @@ def wireless_scan(interface):
# TODO: Full WiFi experience might get evolved in the future, pausing for now 2021-01-25
def get_wireless_networks(interface):
# TODO: Make this oneliner pritter to check if the interface is scanning or not.
- if not '_WIFI' in storage or interface not in storage['_WIFI'] or storage['_WIFI'][interface].get('scanning', False) is False:
+ if '_WIFI' not in storage or interface not in storage['_WIFI'] or storage['_WIFI'][interface].get('scanning', False) is False:
import time
wireless_scan(interface)
diff --git a/archinstall/lib/output.py b/archinstall/lib/output.py
index cce9e88c..f69571c0 100644
--- a/archinstall/lib/output.py
+++ b/archinstall/lib/output.py
@@ -83,11 +83,11 @@ def stylize_output(text: str, *opts, **kwargs):
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
- RESET = '0'
+ reset = '0'
code_list = []
if text == '' and len(opts) == 1 and opts[0] == 'reset':
- return '\x1b[%sm' % RESET
+ return '\x1b[%sm' % reset
for k, v in kwargs.items():
if k == 'fg':
code_list.append(foreground[v])
@@ -97,7 +97,7 @@ def stylize_output(text: str, *opts, **kwargs):
if o in opt_dict:
code_list.append(opt_dict[o])
if 'noreset' not in opts:
- text = '%s\x1b[%sm' % (text or '', RESET)
+ text = '%s\x1b[%sm' % (text or '', reset)
return '%s%s' % (('\x1b[%sm' % ';'.join(code_list)), text or '')
@@ -112,7 +112,7 @@ def log(*args, **kwargs):
# If a logfile is defined in storage,
# we use that one to output everything
- if (filename := storage.get('LOG_FILE', None)):
+ if filename := storage.get('LOG_FILE', None):
absolute_logfile = os.path.join(storage.get('LOG_PATH', './'), filename)
try:
@@ -155,7 +155,7 @@ def log(*args, **kwargs):
log("Deprecated level detected in log message, please use new logging.<level> instead for the following log message:", fg="red", level=logging.ERROR, force=True)
kwargs['level'] = logging.DEBUG
- if kwargs['level'] > storage.get('LOG_LEVEL', logging.INFO) and not 'force' in kwargs:
+ if kwargs['level'] > storage.get('LOG_LEVEL', logging.INFO) and 'force' not in kwargs:
# Level on log message was Debug, but output level is set to Info.
# In that case, we'll drop it.
return None
diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py
index 894b8fcb..62190cbf 100644
--- a/archinstall/lib/profiles.py
+++ b/archinstall/lib/profiles.py
@@ -154,7 +154,7 @@ class Script:
return self
def execute(self):
- if not self.namespace in sys.modules or self.spec is None:
+ if self.namespace not in sys.modules or self.spec is None:
self.load_instructions()
self.spec.loader.exec_module(sys.modules[self.namespace])