def export_path_html(self, key): if len(self.selection)>0: explst = self.selection print 'export selection;', len(self.selection) else: explst = self.new_votes print 'export votes;', len(self.new_votes) query = [p for p in list(explst) if not p in self.trash] self.message('\n'.join([ 'Export assemblage of selected images. ({} imgs)'.format( len(query[:20])), '','This may take a while.'])) # FIXME: this is limited to 20 images??? path = index.chain(query=query[:20]) index.export_html(path, 'selection.html') self.redraw=True
import index from random import randrange as rnd index.load() for n in range(6): stars = sorted(index.pictures(), key=lambda p:p.rating, reverse=True)[:5+n*2] query = [] print 'Checkpoints:' for i in range(3+n): p = stars[rnd(len(stars))] query.append(p) stars.remove(p) print '{}. {}'.format(i+1, p.name) path = index.chain(query=query) print '\nPath:' print ' > '.join([p.name for p in path]) reference = [p for p in query if p in path] index.export_html(reference+[None]+path, 'path{}.html'.format(n))