refactor(modules): clean up dock update logic and fix TOTP action closure
- Refactor dock update loop to use explicit parentheses and improve readability - Fix closure capture in OTP plugin action to correctly pass current code - Remove redundant lambda wrapper in player label binding - Update logger messages with full exception context - Adjust imports and naming for consistency across modules - Minor code style updates and whitespace cleanup
This commit is contained in:
12 files changed
+48
-39
No files matched your search
@@ -167,8 +167,8 @@ class OTPPlugin(PluginBase):
|
||||
if current_totp_code != old_code:
|
||||
result_item.result.data["code"] = current_totp_code
|
||||
self._find_and_update_title_label(result_item, current_totp_code)
|
||||
result_item.result.action = (
|
||||
lambda code=current_totp_code: self._copy_to_clipboard(code)
|
||||
result_item.result.action = lambda code=current_totp_code: (
|
||||
self._copy_to_clipboard(code)
|
||||
)
|
||||
|
||||
new_subtitle_markup = f"{display_name} • {time_display} remaining"
|
||||
@@ -431,8 +431,8 @@ class OTPPlugin(PluginBase):
|
||||
"type": "totp",
|
||||
"account": account_name,
|
||||
"code": totp_code,
|
||||
"alt_action": lambda acc=account_name: self._remove_account_and_refresh(
|
||||
acc
|
||||
"alt_action": lambda acc=account_name: (
|
||||
self._remove_account_and_refresh(acc)
|
||||
),
|
||||
},
|
||||
)
|
||||
@@ -491,8 +491,8 @@ class OTPPlugin(PluginBase):
|
||||
"type": "totp",
|
||||
"account": account_name,
|
||||
"code": totp_code,
|
||||
"alt_action": lambda acc=account_name: self._remove_account_and_refresh(
|
||||
acc
|
||||
"alt_action": lambda acc=account_name: (
|
||||
self._remove_account_and_refresh(acc)
|
||||
),
|
||||
},
|
||||
)
|
||||
@@ -696,8 +696,8 @@ class OTPPlugin(PluginBase):
|
||||
time_display
|
||||
} remaining",
|
||||
icon_name="user-trash-symbolic",
|
||||
action=lambda acc=acc_name: self._remove_account_and_refresh(
|
||||
acc
|
||||
action=lambda acc=acc_name: (
|
||||
self._remove_account_and_refresh(acc)
|
||||
),
|
||||
relevance=0.9,
|
||||
plugin_name=self.display_name,
|
||||
@@ -715,8 +715,8 @@ class OTPPlugin(PluginBase):
|
||||
title=f"Error: {acc_name}",
|
||||
subtitle="Press Enter to remove (Invalid secret)",
|
||||
icon_name="user-trash-symbolic",
|
||||
action=lambda acc=acc_name: self._remove_account_and_refresh(
|
||||
acc
|
||||
action=lambda acc=acc_name: (
|
||||
self._remove_account_and_refresh(acc)
|
||||
),
|
||||
relevance=0.8,
|
||||
plugin_name=self.display_name,
|
||||
|
||||
@@ -407,8 +407,8 @@ class RemindersPlugin(PluginBase):
|
||||
target_time_str
|
||||
})",
|
||||
icon_name="alarm-timer",
|
||||
action=lambda ts=time_str, msg=message: self._create_and_confirm_reminder(
|
||||
ts, msg
|
||||
action=lambda ts=time_str, msg=message: (
|
||||
self._create_and_confirm_reminder(ts, msg)
|
||||
),
|
||||
relevance=1.0,
|
||||
plugin_name=self.display_name,
|
||||
|
||||
@@ -467,8 +467,8 @@ class ScreencapturePlugin(PluginBase):
|
||||
if format_type != "gif"
|
||||
else "image-x-generic-symbolic"
|
||||
),
|
||||
action=lambda fp=file_param, ft=format_type: self._run_script_with_file(
|
||||
ft, fp
|
||||
action=lambda fp=file_param, ft=format_type: (
|
||||
self._run_script_with_file(ft, fp)
|
||||
),
|
||||
relevance=1.0,
|
||||
plugin_name=self.display_name,
|
||||
|
||||
@@ -539,8 +539,8 @@ class WallpaperPlugin(PluginBase):
|
||||
status_text
|
||||
}",
|
||||
icon_name="color-picker-symbolic",
|
||||
action=lambda c=hex_color, s=scheme: self._apply_hex_color_direct(
|
||||
c, s
|
||||
action=lambda c=hex_color, s=scheme: (
|
||||
self._apply_hex_color_direct(c, s)
|
||||
),
|
||||
relevance=1.0,
|
||||
plugin_name=self.display_name,
|
||||
|
||||
Reference in new issue
Block a user