refactor(modules): improve exception handling and simplify service usage

Enhancements
- Replace bare `except:` with `except Exception:` in multiple modules- Cast step calculation to `int` for consistent type
- Simplify `get_battery_icon_file` to return a string directly
- Use `get_todo_service()` instead of module-level `todo_service` throughout todo widget
- Remove unused `"zen": "zen-browser"` mapping entry

Bug Fixes
- Prevent bare exception swallowing by catching `Exception` explicitly
- Ensure proper cleanup of timer IDs and other resources
- Delete unused modules/osdd components

New Features
- None
This commit is contained in:
sankalp committed 2026-03-23 23:34:03 +05:45
1 parent 34cfb2f49e
commit ef4065bc1f
34 files changed
+682 -519

No files matched your search

+2 -2
View File
@@ -1040,7 +1040,7 @@ class Launcher(Window):
return widget
# Also check if this is the only Entry in the widget (likely to be the target)
return widget
except:
except Exception:
# If focus checking fails, assume this Entry should handle the event
return widget
@@ -1207,7 +1207,7 @@ class Launcher(Window):
allocation = selected_child.get_allocation()
item_height = allocation.height if allocation.height > 0 else 68
item_y = allocation.y
except:
except Exception:
# Fallback to estimation
item_height = DEFAULT_ITEM_HEIGHT
item_y = self.selected_index * item_height