# Path: sen/exceptions.py
# class NotifyError(Exception):
#     """
#     There was an error, we should notify user.
#     """


import logging
import threading
import urwid
from sen.exceptions import NotifyError
    def reload_widget(self):
        # this is the easiest way to refresh body
        with self.body_change_lock:
            self.body[:] = self.body

    def _search(self, reverse_search=False):
        if self.search_string is None:
            raise NotifyError("No search pattern specified.")
        if not self.search_string:
            self.search_string = None
            return
        pos = self.focus_position
        original_position = pos
        wrapped = False
        while True:
            if reverse_search:
                obj, pos = self.body.get_prev(pos)
            else:
                obj, pos = self.body.get_next(pos)
            if obj is None:
                # wrap
                wrapped = True
                if reverse_search:
                    obj, pos = self.body[-1], len(self.body)
                else:
                    obj, pos = self.body[0], 0
            if wrapped and (
                        (pos > original_position and not reverse_search) or
                        (pos < original_position and reverse_search)
            ):

# Path: sen/exceptions.py
# class NotifyError(Exception):
#     """
#     There was an error, we should notify user.
#     """


# Path: sen/tui/widgets/list/base.py
import logging
import threading
import urwid
from sen.exceptions import NotifyError

    def reload_widget(self):
        # this is the easiest way to refresh body
        with self.body_change_lock:
            self.body[:] = self.body

    def _search(self, reverse_search=False):
        if self.search_string is None:
            raise NotifyError("No search pattern specified.")
        if not self.search_string:
            self.search_string = None
            return
        pos = self.focus_position
        original_position = pos
        wrapped = False
        while True:
            if reverse_search:
                obj, pos = self.body.get_prev(pos)
            else:
                obj, pos = self.body.get_next(pos)
            if obj is None:
                # wrap
                wrapped = True
                if reverse_search:
                    obj, pos = self.body[-1], len(self.body)
                else:
                    obj, pos = self.body[0], 0
            if wrapped and (
                        (pos > original_position and not reverse_search) or
                        (pos < original_position and reverse_search)
            ):

                raise NotifyError("Pattern not found: %r." % self.search_string)