gallery.py: Pass page data through .index()
authorW. Trevor King <wking@tremily.us>
Mon, 9 Dec 2013 06:09:40 +0000 (22:09 -0800)
committerW. Trevor King <wking@tremily.us>
Mon, 9 Dec 2013 06:09:40 +0000 (22:09 -0800)
Otherwise http://localhost:4000/?pp=2 will still get you the first
page.

posts/gallery/gallery.py

index 7b0d3d178d1f207679d6aa7d719de55b74aa1730..a7ec9442515173ae1d610e01046ed7a34dc1a2f2 100755 (executable)
@@ -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