# Path: mvc/signals.py
# class NestedSignalError(StandardError):
# class WeakMethodReference:
# class Callback:
# class WeakCallback:
# class SignalEmitter(object):
# class SystemSignals(SignalEmitter):
#     def __init__(self, method):
#     def __call__(self):
#     def __init__(self, func, extra_args):
#     def invoke(self, obj, args):
#     def compare_function(self, func):
#     def is_dead(self):
#     def __init__(self, method, extra_args):
#     def compare_function(self, func):
#     def invoke(self, obj, args):
#     def is_dead(self):
#     def __init__(self, *signal_names):
#     def freeze_signals(self):
#     def thaw_signals(self):
#     def create_signal(self, name):
#     def get_callbacks(self, signal_name):
#     def _check_already_connected(self, name, func):
#     def connect(self, name, func, *extra_args):
#     def connect_weak(self, name, method, *extra_args):
#     def disconnect(self, callback_handle):
#     def disconnect_all(self):
#     def emit(self, name, *args):
#     def _run_signal(self, name, args):
#     def clear_old_weak_references(self):
#     def __init__(self):
#     def shutdown(self):
#     def update_available(self, latest):
#     def new_dialog(self, dialog):
#     def theme_first_run(self, theme):
#     def videos_added(self, view):
#     def download_complete(self, item):
#     def failed_exn(self, when, details=None):
#     def failed(self, when, with_exception=False, details=None):


import logging
import fasttypes
import wrappermap
from AppKit import (NSDragOperationNone, NSDragOperationAll, NSTableViewDropOn,
                    NSOutlineViewDropOnItemIndex, protocols)
from Foundation import NSObject, NSNotFound, NSMutableIndexSet
from objc import YES, NO, nil
from mvc import signals
from mvc.errors import WidgetActionError
        iter = self.firstIter()
        while iter != self.lastIter():
            yield iter.value()
            iter.forward()

    def remove(self, iter):
        self.iter_cache = []
        return self.list.remove(iter)

    def nth_iter(self, index):
        if index < 0:
            raise IndexError(index)
        elif index >= len(self):
            raise LookupError()
        if len(self.iter_cache) == 0:
            self.iter_cache.append(self.firstIter())
        try:
            return self.iter_cache[index].copy()
        except IndexError:
            pass
        iter = self.iter_cache[-1].copy()
        index -= len(self.iter_cache) - 1
        for x in xrange(index):
            iter.forward()
            self.iter_cache.append(iter.copy())
        return iter

class TableModelBase(signals.SignalEmitter):
    """Base class for TableModel and TreeTableModel."""
    def __init__(self, *column_types):

# Path: mvc/signals.py
# class NestedSignalError(StandardError):
# class WeakMethodReference:
# class Callback:
# class WeakCallback:
# class SignalEmitter(object):
# class SystemSignals(SignalEmitter):
#     def __init__(self, method):
#     def __call__(self):
#     def __init__(self, func, extra_args):
#     def invoke(self, obj, args):
#     def compare_function(self, func):
#     def is_dead(self):
#     def __init__(self, method, extra_args):
#     def compare_function(self, func):
#     def invoke(self, obj, args):
#     def is_dead(self):
#     def __init__(self, *signal_names):
#     def freeze_signals(self):
#     def thaw_signals(self):
#     def create_signal(self, name):
#     def get_callbacks(self, signal_name):
#     def _check_already_connected(self, name, func):
#     def connect(self, name, func, *extra_args):
#     def connect_weak(self, name, method, *extra_args):
#     def disconnect(self, callback_handle):
#     def disconnect_all(self):
#     def emit(self, name, *args):
#     def _run_signal(self, name, args):
#     def clear_old_weak_references(self):
#     def __init__(self):
#     def shutdown(self):
#     def update_available(self, latest):
#     def new_dialog(self, dialog):
#     def theme_first_run(self, theme):
#     def videos_added(self, view):
#     def download_complete(self, item):
#     def failed_exn(self, when, details=None):
#     def failed(self, when, with_exception=False, details=None):


# Path: mvc/widgets/osx/tablemodel.py
import logging
import fasttypes
import wrappermap
from AppKit import (NSDragOperationNone, NSDragOperationAll, NSTableViewDropOn,
                    NSOutlineViewDropOnItemIndex, protocols)
from Foundation import NSObject, NSNotFound, NSMutableIndexSet
from objc import YES, NO, nil
from mvc import signals
from mvc.errors import WidgetActionError

        iter = self.firstIter()
        while iter != self.lastIter():
            yield iter.value()
            iter.forward()

    def remove(self, iter):
        self.iter_cache = []
        return self.list.remove(iter)

    def nth_iter(self, index):
        if index < 0:
            raise IndexError(index)
        elif index >= len(self):
            raise LookupError()
        if len(self.iter_cache) == 0:
            self.iter_cache.append(self.firstIter())
        try:
            return self.iter_cache[index].copy()
        except IndexError:
            pass
        iter = self.iter_cache[-1].copy()
        index -= len(self.iter_cache) - 1
        for x in xrange(index):
            iter.forward()
            self.iter_cache.append(iter.copy())
        return iter

class TableModelBase(signals.SignalEmitter):
    """Base class for TableModel and TreeTableModel."""
    def __init__(self, *column_types):

        signals.SignalEmitter.__init__(self)