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

✨ feature: adding action_identifier for each client in get_info #382

Merged
merged 1 commit into from
Jul 8, 2024
Merged
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
5 changes: 4 additions & 1 deletion findmyorder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ async def get_info(self):

"""
version_info = f"ℹ️ {type(self).__name__} {__version__}\n"
client_info = "".join(f"🔎 {client.name}\n" for client in self.clients)
client_info = "".join(
f"🔎 {client.name}\n🔠 {client.action_identifier}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider handling cases where client.action_identifier might be None or empty.

If client.action_identifier can be None or an empty string, it might be better to handle these cases explicitly to avoid unexpected output.

Suggested change
f"🔎 {client.name}\n🔠 {client.action_identifier}"
f"🔎 {client.name}\n🔠 {client.action_identifier or 'N/A'}"

for client in self.clients
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (performance): Consider the performance impact of the join operation inside a generator expression.

While the current implementation is likely efficient for a small number of clients, if self.clients can be large, it might be worth considering alternative approaches to improve performance.

Suggested change
for client in self.clients
client_info = []
for client in self.clients:
client_info.append(f"🔎 {client.name}\n🔠 {client.action_identifier}")
client_info = "".join(client_info)

)
return version_info + client_info.strip()

async def search(self, message: str) -> bool:
Expand Down