On new event, with -i flag, daterange parsing error shouldn't wipe the whole event
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 233
- Avg merge
- 1h 44m
- Merged PRs (30d)
- 1
Description
If I screw up the datetime range when adding a new event, khal should...
- give me a clue about what was wrong with the range given (same as #786 ), and also
- give me a chance to revise the datetime range, without starting over.
Right now if I screw up, I have to add the whole event from scratch:
amanda@mona:~$ khal new -i
calendar: logistics
summary: Coffee w/Somebody at a Place
datetime range: tuesday 13:30 - 14:30
Traceback (most recent call last):
File "/usr/local/bin/khal", line 11, in
sys.exit(main_khal())
File "/home/amanda/.local/lib/python3.5/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/home/amanda/.local/lib/python3.5/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/amanda/.local/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/amanda/.local/lib/python3.5/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/amanda/.local/lib/python3.5/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/amanda/.local/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/amanda/.local/lib/python3.5/site-packages/khal/cli.py", line 396, in new
format=format,
File "/home/amanda/.local/lib/python3.5/site-packages/khal/controllers.py", line 301, in new_interactive
daterange, conf['locale'], adjust_reasonably=True)
File "/home/amanda/.local/lib/python3.5/site-packages/khal/utils.py", line 438, in guessrangefstr
raise ValueError('Could not parse{}as a daterange'.format(daterange))
ValueError: Could not parsetuesday 13:30 - 14:30as a daterange
amanda@mona:~$
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at khal/controllers.py in new_interactive, which calls khal/utils.py:guessrangefstr; the command entry point is khal/cli.py. Reproduce the invalid datetime range with khal new -i, then verify that the range error is explained and the existing event fields remain available for another range attempt.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100