changeset 60:d88a6a086d04

text_x_arnica.format: simplified if / else
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 04 Jun 2008 15:16:31 +0200
parents 3406d23a01f2
children 6ab80d79e924
files data/plugin/parser/text_x_arnica.py
diffstat 1 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Wed Jun 04 15:00:47 2008 +0200
+++ b/data/plugin/parser/text_x_arnica.py	Wed Jun 04 15:16:31 2008 +0200
@@ -594,23 +594,21 @@
             i = self.full.index(image)
             self.create_thumbnail_and_webnail(image, self.web[i], self.thumb[i], self.imgtype[i])
             if not self.album:
+                self.webimg = self.web
                 if self.image_for_webnail:
                     self.webimg = self.full
-                else:
-                    self.webimg = self.web
 
-                if self.mode == 1:
-                    text = self.mode1_html(i)
-
-                if self.mode == 2:
+                text = self.mode1_html(i)
+                if self.mode != 1:
                     text = self.mode2_html(i)
 
                 if col_count <= COLUMNS:
                     result.append(''.join(text))
 
-                if col_count == COLUMNS and not self.album:
+                if col_count == COLUMNS:
                     col_count = 0
                     data.addRow(tuple(result))
+                    # resets the result list after the row is added
                     result = []
 
                 col_count += 1
@@ -624,16 +622,15 @@
             try:
                 i = self.full.index(front_image)
                 self.create_thumbnail_and_webnail(image, self.web[i], self.thumb[i], self.imgtype[i])
+                self.webimg = self.web
                 if self.image_for_webnail:
                     self.webimg = self.full
-                else:
-                    self.webimg = self.web
-
                 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))
 
+        # adds the last row if it is not filled up
         if result:
             data.addRow(tuple(result))