def _add_tiles_to_flowgrid(self, docs, flowgrid, amount): '''Adds application tiles to a FlowableGrid: docs = xapian documents (apps) flowgrid = the FlowableGrid to add tiles to amount = number of tiles to add from start of doc range''' amount = min(len(docs), amount) for doc in docs[0:amount]: tile = FeaturedTile(self.properties_helper, doc) tile.connect('clicked', self.on_app_clicked, self.properties_helper.get_application(doc)) flowgrid.add_child(tile) return
def _add_tiles_to_flowgrid(self, docs, flowgrid, amount): '''Adds application tiles to a FlowableGrid: docs = xapian documents (apps) flowgrid = the FlowableGrid to add tiles to amount = number of tiles to add from start of doc range''' amount = min(len(docs), amount) for doc in docs[0:amount]: tile = FeaturedTile(self.helper, doc) tile.connect('clicked', self.on_app_clicked, self.helper.get_application(doc)) flowgrid.add_child(tile) return
def add_tiles(self, properties_helper, docs, amount): '''Adds application tiles to an ApplicationTileGrid: properties_help -- an instance of the PropertiesHelper object docs -- xapian documents (apps) amount -- number of tiles to add from start of doc range ''' amount = min(len(docs), amount) for doc in docs[0:amount]: tile = FeaturedTile(properties_helper, doc) tile.connect('clicked', self._on_app_clicked, properties_helper.get_application(doc)) self.add_child(tile)
def _add_tiles_to_flowgrid(self, docs, flowgrid, amount): '''Adds application tiles to a FlowableGrid: docs = xapian documents (apps) flowgrid = the FlowableGrid to add tiles to amount = number of tiles to add from start of doc range''' amount = min(len(docs), amount) cache = get_pkg_info() if hasattr(cache, 'prefill_cache'): prefill_pkgnames = [ self.db.get_pkgname(doc) for doc in docs[0:amount] ] cache.prefill_cache(wanted_pkgs = prefill_pkgnames, only_newest=True) for doc in docs[0:amount]: tile = FeaturedTile(self.properties_helper, doc) tile.connect('clicked', self.on_app_clicked, self.properties_helper.get_application(doc)) flowgrid.add_child(tile) return