def _build_cache(self):
self.cache = []<EOL>if self.done:<EOL><INDENT>return<EOL><DEDENT>for i in (self.get_cached() if self._cached else self.get_page(self.url)):<EOL><INDENT>if not self._cached:<EOL><INDENT>if not i.get("<STR_LIT>"):<EOL><INDENT>i["<STR_LIT>"] = self.feed.object_types[<NUM_LIT:0>]<EOL><DEDENT>obj = Mapper(pypump=self.feed._pump).get_object(i)<EOL><DEDENT>else:<EOL><INDENT>obj = i<EOL><DEDENT>self.cache.append(obj)<EOL><DEDENT>if len(self.cache) <= <NUM_LIT:0>:<EOL><INDENT>self._done = True<EOL><DEDENT>if getattr(self.feed, '<STR_LIT>', False):<EOL><INDENT>if self._offset is None:<EOL><INDENT>self._offset = <NUM_LIT:0><EOL><DEDENT>self._offset += <NUM_LIT:20><EOL><DEDENT>elif self._since is not None:<EOL><INDENT>if self.feed.links.get('<STR_LIT>'):<EOL><INDENT>self.url = self.feed.links['<STR_LIT>']<EOL>del self.feed.links['<STR_LIT>']  <EOL><DEDENT><DEDENT>else:<EOL><INDENT>if self.feed.links.get('<STR_LIT>'):<EOL><INDENT>self.url = self.feed.links['<STR_LIT>']<EOL>del self.feed.links['<STR_LIT>']  <EOL><DEDENT>else:<EOL><INDENT>self.url = None<EOL><DEDENT><DEDENT>
Build a list of objects from feed's cached items or API page