Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing CI jobs #164

Merged
merged 2 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "dmenu_extended"
version = "1.2.2"
version = "1.2.3"
authors = [
{ name="Mark Hedley Jones", email="[email protected]" },
]
Expand Down
18 changes: 9 additions & 9 deletions src/dmenu_extended/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ def menu(self, items, prompt=""):
text=True,
)

if type(items) == list:
if isinstance(items, list):
items = "\n".join(items)

# Prevent rofi from closing with no prompt
Expand Down Expand Up @@ -688,15 +688,15 @@ def command_to_list(self, command):
strings. Also handles lists that contain strings that contain spaces.
"""
out = []
if type(command) == list:
if isinstance(command, list):
tmp = []
for i, item in enumerate(command):
if item.find(" ") != -1:
tmp = tmp + item.split(" ")
else:
tmp = tmp + [item]
out = tmp
elif type(command) == str:
elif isinstance(command, str):
out = command.split(" ")

quote_count = "".join(out).count('"')
Expand Down Expand Up @@ -770,7 +770,7 @@ def cache_regenerate(self, message=True):
def cache_save(self, items, path):
try:
with open(path, "w") as f:
if type(items) == list:
if isinstance(items, list):
for item in items:
f.write(item + "\n")
else:
Expand Down Expand Up @@ -853,7 +853,7 @@ def cache_load(self, exitOnFail=False):
return cache_plugins + cache_frequent + cache_scanned + settings

def command_output(self, command, split=True):
if type(command) != list:
if isinstance(command, list):
command = command.split(" ")
out = subprocess.check_output(command, text=True)
if split:
Expand Down Expand Up @@ -1197,7 +1197,7 @@ def build_cache(self):
if "include_items" in self.prefs:
include_items = []
for item in self.prefs["include_items"]:
if type(item) == list:
if isinstance(item, list):
if len(item) > 1:
aliased_items.append(self.format_alias(item[0], item[1]))
aliases.append([self.format_alias(item[0], item[1]), item[1]])
Expand Down Expand Up @@ -1887,7 +1887,7 @@ def run(*args):
print("Starting to match given command with store elements")

for item in d.prefs["include_items"]:
if action == "+" and type(item) == list:
if action == "+" and isinstance(item, list):
if d.debug:
print(
"Is (+) " + str(item[0]) + " == " + str(alias) + "?"
Expand All @@ -1901,7 +1901,7 @@ def run(*args):
print("No")

# If removing a command - an alias would be detected as command
if action == "-" and type(item) == list:
if action == "-" and isinstance(item, list):
if d.debug:
print(
"Is (-) "
Expand Down Expand Up @@ -1968,7 +1968,7 @@ def run(*args):
elif d.debug:
print("No")

if type(item) != list:
if isinstance(item, list):
if d.debug:
print("Is " + str(item) + " == " + str(command) + "?")
if command == item:
Expand Down