def __init__(self, source, *, current_page=None): self._source = source self._is_content_source = isinstance(source, (ContentSource, _CombinedSource)) self._cache = None self._pagination_slicer = None self._has_sorter = False self._next_page = None self._prev_page = None self._locked = False self._load_event = Event() self._iter_event = Event() self._current_page = current_page self._initIterator()
def __init__(self, source, current_page=None, pagination_filter=None, offset=0, limit=-1, locked=False): self._source = source self._current_page = current_page self._locked = False self._pages = source self._pagesData = None self._pagination_slicer = None self._has_sorter = False self._next_page = None self._prev_page = None self._iter_event = Event() if isinstance(source, IPaginationSource): src_it = source.getSourceIterator() if src_it is not None: self._pages = src_it # Apply any filter first, before we start sorting or slicing. if pagination_filter is not None: self._simpleNonSortedWrap(PaginationFilterIterator, pagination_filter) if offset > 0 or limit > 0: self.slice(offset, limit) self._locked = locked
def __setstate__(self, state): state['entry_added'] = Event() self.__dict__.update(state)
def __init__(self): self.entries = [] self.entry_added = Event() self.app_version = APP_VERSION self.record_version = self.__class__.RECORD_VERSION