Ruff lint fixes

This commit is contained in:
Chris Rose 2023-10-28 10:58:41 -07:00
commit 6cf6a1ffe9
No known key found for this signature in database

View file

@ -10,7 +10,7 @@ def err(msg, die=None):
"""Print an error message and exits if an exit code is given""" """Print an error message and exits if an exit code is given"""
sys.stderr.write(msg + '\n') sys.stderr.write(msg + '\n')
if die: if die:
sys.exit(die if type(die) is int else 1) sys.exit(die if isinstance(die, int) else 1)
try: try:
@ -135,16 +135,16 @@ def themes():
def list_themes(v=False): def list_themes(v=False):
"""Display the list of the themes""" """Display the list of the themes"""
for t, l in themes(): for theme_path, link_target in themes():
if not v: if not v:
t = os.path.basename(t) theme_path = os.path.basename(theme_path)
if l: if link_target:
if v: if v:
print(t + (" (symbolic link to `" + l + "')")) print(theme_path + (" (symbolic link to `" + link_target + "')"))
else: else:
print(t + '@') print(theme_path + '@')
else: else:
print(t) print(theme_path)
def remove(theme_name, v=False): def remove(theme_name, v=False):