How to use the todoman.widgets.PrioritySelector.RANGES function in todoman

To help you get started, we’ve selected a few todoman 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 / todoman / tests / test_widgets.py View on Github external
assert selector.label == 'low'
    assert selector.priority == 9

    selector.keypress(10, 'right')
    assert selector.label == 'medium'
    assert selector.priority == 5

    # Spin the whoel way around:
    for _ in PrioritySelector.RANGES:
        selector.keypress(10, 'right')

    assert selector.label == 'medium'
    assert selector.priority == 5

    # Now the other way
    for _ in PrioritySelector.RANGES:
        selector.keypress(10, 'left')

    assert selector.label == 'medium'
    assert selector.priority == 5

    # Should do nothing:
    selector.keypress(10, 'd')
    selector.keypress(10, '9')
    assert selector.label == 'medium'
    assert selector.priority == 5
github pimutils / todoman / tests / test_widgets.py View on Github external
selector.keypress(10, 'right')
    assert selector.label == 'high'
    assert selector.priority == 1

    selector.keypress(10, 'left')
    selector.keypress(10, 'left')
    assert selector.label == 'low'
    assert selector.priority == 9

    selector.keypress(10, 'right')
    assert selector.label == 'medium'
    assert selector.priority == 5

    # Spin the whoel way around:
    for _ in PrioritySelector.RANGES:
        selector.keypress(10, 'right')

    assert selector.label == 'medium'
    assert selector.priority == 5

    # Now the other way
    for _ in PrioritySelector.RANGES:
        selector.keypress(10, 'left')

    assert selector.label == 'medium'
    assert selector.priority == 5

    # Should do nothing:
    selector.keypress(10, 'd')
    selector.keypress(10, '9')
    assert selector.label == 'medium'
github pimutils / todoman / todoman / widgets.py View on Github external
def _update_label(self, delta=0):
        for i, r in enumerate(PrioritySelector.RANGES):
            if self._priority in r:
                self._priority = PrioritySelector.RANGES[(
                    i + delta
                ) % len(PrioritySelector.RANGES)][0]
                self._set_label()
                return
github pimutils / todoman / todoman / widgets.py View on Github external
def _update_label(self, delta=0):
        for i, r in enumerate(PrioritySelector.RANGES):
            if self._priority in r:
                self._priority = PrioritySelector.RANGES[(
                    i + delta
                ) % len(PrioritySelector.RANGES)][0]
                self._set_label()
                return
github pimutils / todoman / todoman / widgets.py View on Github external
def _update_label(self, delta=0):
        for i, r in enumerate(PrioritySelector.RANGES):
            if self._priority in r:
                self._priority = PrioritySelector.RANGES[(
                    i + delta
                ) % len(PrioritySelector.RANGES)][0]
                self._set_label()
                return