How to use the khal.ui.editor.EventEditor function in khal

To help you get started, we’ve selected a few khal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pimutils / khal / khal / ui / __init__.py View on Github external
new_event = Event.fromString(
                text,
                locale=self._conf['locale'],
                href=event.href,
                calendar=event.calendar,
                etag=event.etag,
            )
            self.pane.collection.update(new_event)
            update_colors(
                new_event.start_local,
                new_event.end_local,
                (event.recurring or new_event.recurring)
            )
        else:
            self.editor = True
            editor = EventEditor(self.pane, event, update_colors, always_save=always_save)

            ContainerWidget = linebox[self.pane._conf['view']['frame']]
            new_pane = urwid.Columns([
                ('weight', 2, ContainerWidget(editor)),
                ('weight', 1, ContainerWidget(self.dlistbox))
            ], dividechars=2, focus_column=0)
            new_pane.title = editor.title

            def teardown(data):
                self.editor = False
            self.pane.window.open(new_pane, callback=teardown)
github pimutils / khal / khal / ui / __init__.py View on Github external
new_event = Event.fromString(
                text,
                locale=self._conf['locale'],
                href=event.href,
                calendar=event.calendar,
                etag=event.etag,
            )
            self.pane.collection.update(new_event)
            update_colors(
                new_event.start_local,
                new_event.end_local,
                (event.recurring or new_event.recurring)
            )
        else:
            self.editor = True
            editor = EventEditor(self.pane, event, update_colors, always_save=always_save)

            ContainerWidget = linebox[self.pane._conf['view']['frame']]
            new_pane = urwid.Columns([
                ('weight', 2, ContainerWidget(editor)),
                ('weight', 1, ContainerWidget(self.dlistbox))
            ], dividechars=2, focus_column=0)
            new_pane.title = editor.title

            def teardown(data):
                self.editor = False
            self.pane.window.open(new_pane, callback=teardown)