changeset 47:4ff94f1065a4

text_x_arnica: if album is not in only items list show reason
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 03 Jun 2008 10:27:24 +0200
parents 769a97fcdcbe
children 3dfa6a13ba3c
files data/plugin/parser/text_x_arnica.py
diffstat 1 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Tue Jun 03 09:37:45 2008 +0200
+++ b/data/plugin/parser/text_x_arnica.py	Tue Jun 03 10:27:24 2008 +0200
@@ -656,21 +656,26 @@
 
                 col_count += 1
 
+        if result and self.album == '0':
+            for i in range(COLUMNS - col_count + 1):
+                result.append('')
+
         if self.album == '1':
             front_image = self.front_image or self.full[0]
-            i = self.full.index(front_image)
-            self.create_thumbnail_and_webnail(image, self.web[i], self.thumb[i], self.imgtype[i])
-            if self.image_for_webnail == '1':
-                self.webimg = self.full
-            else:
-                self.webimg = self.web
+            try:
+                i = self.full.index(front_image)
+                self.create_thumbnail_and_webnail(image, self.web[i], self.thumb[i], self.imgtype[i])
+                if self.image_for_webnail == '1':
+                    self.webimg = self.full
+                else:
+                    self.webimg = self.web
 
-            text = self.mode1_html(i)
+                text = self.mode1_html(i)
+            except ValueError:
+                text = "You can't use as front image: '%(front_image)s' because it is not listed in only_items!" % {"front_image": front_image, }
             result.append(''.join(text))
 
         if result:
-            for i in range(COLUMNS - col_count + 1):
-                result.append('')
             data.addRow(tuple(result))
 
         browser = DataBrowserWidget(self.request, show_header=False)