khal icon indicating copy to clipboard operation
khal copied to clipboard

Clean-up and refactoring

Open geier opened this issue 3 years ago • 2 comments

As we are breaking backwards compatibility anyway, we should try to clean the code base.

Some ideas:

  • [x] there are lots of different ways to create events at the moment, we should aggregate and only expose as few as possible
  • [ ] better naming convention for different types of events, we currently have
    • strings in icalendar format (starting with BEGIN:VCALENDAR), which are often names ics or ical (and probably some other things) -> suggestion: ics (ical string)
    • icalendar.Vevents() -> suggestion: vevent
    • List[icalendar.Vevents() - often called events_list
    • our own khalendar.event.Events() -> suggestion: event
    • urwid widgets representing events (several different types I believe)
  • [ ] rename backend to cache
  • [x] rename CalendarCollection.new() to insert()

see #1160

geier avatar Jun 28 '22 18:06 geier

there are lots of different ways to create events at the moment, we should aggregate and only expose as few as possible

Might be best to start listing all those ways. I'm only familiar with khal new and ikhal, n.

WhyNotHugo avatar Jun 28 '22 19:06 WhyNotHugo

I mean the internal ways of creating or converting events, you can at the very least do that from CalendarCollection, Event, and some icalendar methods. Which mostly call each other, but IMHO it would be best, if e.g. controller.py only uses CalendarCollection.

geier avatar Jun 28 '22 19:06 geier