(self, window: SpendWindow, amount: float)
| 139 | self._load() |
| 140 | |
| 141 | def set_limit(self, window: SpendWindow, amount: float) -> None: |
| 142 | if amount <= 0 or not isinstance(amount, (int, float)): |
| 143 | raise ValueError("Limit must be a positive number") |
| 144 | setattr(self._limits, window, float(amount)) |
| 145 | self._save() |
| 146 | |
| 147 | def clear_limit(self, window: SpendWindow) -> None: |
| 148 | setattr(self._limits, window, None) |