view getan/walker.py @ 535:d5acadeef0f8

improve usage message & simply code * Shorten help output for `--database` as the good option name is enough to explain. * Fix typo in help output for `--empty' * Simplyied code by removing `dest` and `metavar` for add_argument where it was not necessary because it was already the default if those parameters are not given. * Add Intevation and Magnus as rights holder and author for 2019 and 2020.
author Bernhard Reiter <bernhard@intevation.de>
date Wed, 08 Jan 2020 09:22:23 +0100
parents 7e27d2145007
children
line wrap: on
line source
# -*- coding: utf-8 -*-
#
# (c) 2013 by Björn Ricks <bjoern.ricks@intevation.de>
#
# This is Free Software licensed under the terms of GPLv3 or later.
# For details see LICENSE coming with the source of 'getan'.
#
import logging

import urwid


logger = logging.getLogger(__name__)


class ListWalker(urwid.SimpleListWalker):

    def __init__(self, content, widget=None):
        super(ListWalker, self).__init__(content)
        self.widget = widget
        self.position = None

    def set_focus(self, position):
        if position is None:
            return

        super(ListWalker, self).set_focus(position)
        if self.widget and self.position != position:
            self.position = position
            self.widget.content_focus_changed()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)