From: W. Trevor King Date: Mon, 9 Dec 2013 06:09:40 +0000 (-0800) Subject: gallery.py: Pass page data through .index() X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=909fd5f9232899d5ca9d7f65868fcdd094717c9e;p=blog.git gallery.py: Pass page data through .index() Otherwise http://localhost:4000/?pp=2 will still get you the first page. --- diff --git a/posts/gallery/gallery.py b/posts/gallery/gallery.py index 7b0d3d1..a7ec944 100755 --- a/posts/gallery/gallery.py +++ b/posts/gallery/gallery.py @@ -254,7 +254,7 @@ class CGIGalleryServer (object): try: try: if url is None: - self.index(stream=stream) + self.index(stream=stream, page=page) elif url.endswith('random'): self.random( url=url, stream=stream, max_width=500, max_height=500) @@ -349,9 +349,9 @@ class CGIGalleryServer (object): if is_image(picture_path): yield picture_path - def index(self, stream=None): + def index(self, page=0, stream=None): LOG.debug('index page') - return self._directory(self._base_path, stream=stream) + return self._directory(path=self._base_path, page=page, stream=stream) def _original_url(self, url): """Reverse thumbnail URL mapping