changeset 254:a422d7d58d56

text_x_arnica: beautified selected_images
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 10 Sep 2008 11:07:22 +0200
parents 902a0b543b9b
children 3c6496586d40
files data/plugin/parser/text_x_arnica.py
diffstat 1 files changed, 7 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Wed Sep 10 10:20:36 2008 +0200
+++ b/data/plugin/parser/text_x_arnica.py	Wed Sep 10 11:07:22 2008 +0200
@@ -276,15 +276,12 @@
                     "this_alias": self.to_wikitext(self.arnica_image[image][4])}
         return html
 
-    def html_arrange_thumbnails(self, image):
+    def html_arrange_thumbnails(self, image, selected_images):
         """ defines arrangement of thumbnail, text, date and tools
         @param idx: index positionn of corresponding data
+        @param selected_images: ordered list of selected images 
         """
 
-        image_names = self.arnica_image.keys()
-        index = [self.arnica_image[img][5] for img in image_names]
-        selected_images = [image_names[int(idx)] for idx in index]
-
         title = ""
         if self.album:
             title = '<div class="title">%(n)d images (%(album_title)s)</div>' % {"n": len(self.arnica_image),
@@ -560,7 +557,9 @@
             data.columns.extend([Column('', label=(''))])
         col_count = 1
         result = []
-
+        image_names = self.arnica_image.keys()
+        index = [self.arnica_image[img][5] for img in image_names]
+        selected_images = [image_names[int(idx)] for idx in index]
         if self.album:
             album_image = self.album_image or self.arnica_image.keys()[0] #self.high_resolution_image[0]
             if not album_image in self.arnica_image.keys():
@@ -570,15 +569,12 @@
             else:
                 #self.create_thumbnail_and_webnail_image(image, self.web_key[i], self.thumb_key[i], self.imgtype[i])
                 #self.webnail_image = self.web_key
-                text = self.html_arrange_thumbnails(album_image)
+                text = self.html_arrange_thumbnails(album_image, selected_images)
 
             result.append(''.join(text))
         else:
-            image_names = self.arnica_image.keys()
-            index = [self.arnica_image[img][5] for img in image_names]
-            selected_images = [image_names[int(idx)] for idx in index]
             for image in selected_images:
-                text = self.html_arrange_thumbnails(image)
+                text = self.html_arrange_thumbnails(image, selected_images)
                 if col_count <= cols:
                     result.append(''.join(text))
                 if col_count == cols: