-
Notifications
You must be signed in to change notification settings - Fork 213
Support for editing alarms #321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
for a in self._vevents[self.ref].subcomponents | ||
if a.name == 'VALARM' and self._can_handle_alarm(a)] | ||
|
||
def updated_alarms(self, alarms): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the alarms.setter
decorator here, FWIW, but better to stay consistent.
But: please rename to update_alarms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, sure. this was a typo.
Thank you! As far as I see, the only thing that really is left, is validation of user inputs, right? While it doesn't make the event editor any prettier, that's not your fault at all. |
Yes, that's what is missing to my mind. And optionally supporting more types of alarms. It's funny that the Ical spec supports so many more types of alarms than ical on OSX supports. ;) Unfortunately I am currently a bit out of time for fixing this. I hope I find some time in a few days. |
I'm a big fan of this feature. Thanks for the good work, keep it going :) |
I created a new widget type |
@geier great, I've seen the commit and already thought that this might be useful. I hope I will find some time at the weekend to finalize this. |
Looks great! Only few more wishes:
|
Extends the event class with a getter and an update method for alarms. This method only handles alarm types which can be handled by khal. Others are not touched.
Hi @languitar, I took the liberty of rebasing your PR and making the EditWidgets in the DurationWidget validate input (see branch |
@geier Thank you. I'm sorry, I didn't find the time to do this so far. Should I overwrite my own branch with yours and add the authors change or what is the idea? |
@languitar nothing to be sorry for, you did all the work. I don't mind really, you cant just do a PR against my |
Ok, I have updated my own branch. I also changed the return statement for the |
@staticmethod | ||
def unsigned_int(number): | ||
"""test if `number` can be converted to a positive int""" | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like my previous comment got lost in the void during rebasing.
IMHO, this looks simpler/cleaner:
try:
return int(number) >= 0
except ValueError:
return False
Thank you for your patience and this big improvement! |
As requested in #301, this is a work in progress pull request for editing alarms.