You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When adding an alarm in ikhal to an existing or new event the program crashes.
If applicable: Stack Trace
Traceback (most recent call last):
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/khal/ui/__init__.py", line 1484, in start_pane
loop.run()
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/event_loop/main_loop.py", line 343, in run
self._run()
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/event_loop/main_loop.py", line 445, in _run
self.event_loop.run()
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/event_loop/select_loop.py", line 182, in run
self._loop()
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/event_loop/select_loop.py", line 229, in _loop
record.data()
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/display/_posix_raw_display.py", line 273, in wrapper
return self.parse_input(event_loop, callback, self.get_available_raw_input())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/display/_raw_display_base.py", line 493, in parse_input
callback(decoded_codes, raw_codes)
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/event_loop/main_loop.py", line 472, in _update
self.process_input(keys)
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/event_loop/main_loop.py", line 573, in process_input
k = self._topmost_widget.keypress(self.screen_size, k) # noqa: PLW2901
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/popup.py", line 129, in keypress
return self._current_widget.keypress(size, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/frame.py", line 449, in keypress
return self.body.keypress((maxcol, remaining), key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/columns.py", line 1121, in keypress
key = w.keypress(size_args[i], key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/widget.py", line 798, in keypress
return get_delegate(self).keypress(size, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/widget.py", line 798, in keypress
return get_delegate(self).keypress(size, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/pile.py", line 862, in keypress
key = self.focus.keypress(size_args[i], key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/columns.py", line 1121, in keypress
key = w.keypress(size_args[i], key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/khal/ui/editor.py", line 616, in keypress
return super().keypress(size, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/widget.py", line 798, in keypress
return get_delegate(self).keypress(size, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/khal/ui/widgets.py", line 384, in keypress
key = super().keypress(size, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/listbox.py", line 1102, in keypress
key = focus_widget.keypress((maxcol,), key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/widget.py", line 798, in keypress
return get_delegate(self).keypress(size, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/khal/ui/widgets.py", line 316, in keypress
key = super().keypress(size, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/pile.py", line 862, in keypress
key = self.focus.keypress(size_args[i], key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/columns.py", line 1121, in keypress
key = w.keypress(size_args[i], key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/padding.py", line 418, in keypress
return self._original_widget.keypress(maxvals, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/widget.py", line 798, in keypress
return get_delegate(self).keypress(size, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/wimp.py", line 762, in keypress
self._emit("click")
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/widget/widget.py", line 428, in _emit
signals.emit_signal(self, name, self, *args)
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/signals.py", line 301, in emit
result |= self._call_callback(callback, user_arg, weak_args, user_args, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jason/.local/share/pipx/venvs/khal/lib/python3.11/site-packages/urwid/signals.py", line 325, in _call_callback
return bool(callback(*args))
^^^^^^^^^^^^^^^
TypeError: AlarmsEditor.add_alarm() missing 1 required positional argument: 'timedelta'
To Reproduce
Create a new event or edit an existing event
Select the "Add" button in the Alarms section
Expected behavior
The dialogue to add alarms should appear and the user should be able to edit it as needed.
OS, version, khal version and how you installed it:
The output of khal --version: khal, version 0.11.3.dev182+g0c9108e
Additional context
I was able to fix this by setting a default value of None for timedelta in the add_alarm function, which seems to concur with its initial check for timedelta being None, as follows (from: khal/ui/widgets.py: 563)
I'd be happy to just make a PR for this, but I'm not a very good python dev so I'm not sure if this is necessarily the "right" way to fix this or if it would be better to pass None explicitly to the function when it's being called.
The text was updated successfully, but these errors were encountered:
This can be worked around by setting default_event_alarm and default_dayevent_alarm to any values in the [default] section like this (but this should obviously be fixed):
@JBlocklove hey, just wanted to follow up here. I don't mind making the PR if that's easier, but wouldn't want to steal credit for your fix if you were planning on making one.
Sorry, life got hectic and this kept slipping off my todo list. Thanks for the consideration; feel free to make the PR yourself since it'll still probably be a bit before I can get around to following the PR guidelines for this project
Describe the bug
When adding an alarm in ikhal to an existing or new event the program crashes.
If applicable: Stack Trace
To Reproduce
Expected behavior
The dialogue to add alarms should appear and the user should be able to edit it as needed.
OS, version, khal version and how you installed it:
khal, version 0.11.3.dev182+g0c9108e
pipx
Additional context
I was able to fix this by setting a default value of
None
fortimedelta
in theadd_alarm
function, which seems to concur with its initial check fortimedelta
beingNone
, as follows (from:khal/ui/widgets.py: 563
)I'd be happy to just make a PR for this, but I'm not a very good python dev so I'm not sure if this is necessarily the "right" way to fix this or if it would be better to pass
None
explicitly to the function when it's being called.The text was updated successfully, but these errors were encountered: