コード例 #1
0
ファイル: listbox.py プロジェクト: jmcb/urwid
    def __init__(self, contents):
        """
        contents -- list to copy into this object

        Changes made to this object (when it is treated as a list) are
        detected automatically and will cause ListBox objects using
        this list walker to be updated.
        """
        if not type(contents) == list and not hasattr(contents, '__getitem__'):
            raise ListWalkerError, "SimpleListWalker expecting list like object, got: %r"%(contents,)
        MonitoredList.__init__(self, contents)
        self.focus = 0
コード例 #2
0
    def __init__(self, contents):
        """
        contents -- list to copy into this object

        Changes made to this object (when it is treated as a list) are
        detected automatically and will cause ListBox objects using
        this list walker to be updated.
        """
        if not type(contents) == list and not hasattr(contents, '__getitem__'):
            raise ListWalkerError, "SimpleListWalker expecting list like object, got: %r"%(contents,)
        MonitoredList.__init__(self, contents)
        self.focus = 0