changeset 231:c8897e9950a1

text_x_arnica: renamed get_quotes to get_image_alias
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 02 Sep 2008 10:13:22 +0200
parents 7b71406a5baf
children 646ac5025273
files data/plugin/parser/text_x_arnica.py
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Tue Sep 02 10:07:13 2008 +0200
+++ b/data/plugin/parser/text_x_arnica.py	Tue Sep 02 10:13:22 2008 +0200
@@ -322,16 +322,16 @@
         }
         return html
 
-    def define_thumb_webnails(self, path, files, quotes):
+    def define_thumb_webnails(self, path, files, image_alias):
         """ creates lists for thumbnails and webnails
         @param path: path to attachment
         @param files: file names of images
-        @param quotes: text alias for image file
+        @param image_alias: text alias for image file
         """
 
         for attfile in files:
             # only files not thumb_key or webnails
-            self.description.append(quotes.get(attfile, attfile))
+            self.description.append(image_alias.get(attfile, attfile))
             self.high_resolution_image.append(attfile)
             fname, ext = os.path.splitext(attfile)
             key = cache.key(self.request, itemname=self.pagename, attachname=attfile)
@@ -358,9 +358,9 @@
         from MoinMoin.parser.text_moin_wiki import Parser as WikiParser
         return wikiutil.renderText(self.request, WikiParser, text)
 
-    def get_quotes(self):
-        """  gets the quotes from the item list  """
-        # ToDo make this more generic and use common libs of similar modules
+    def get_image_alias(self):
+        """  gets the quotes from the item list and returns a dictionary of image and alias"""        
+
         quotes = self.raw.split('\n')
         quotes = [quote.strip() for quote in quotes]
         quotes = [quote[2:] for quote in quotes if quote.startswith('* ')]
@@ -380,13 +380,13 @@
             self.pagename = self.target_page
         path = AttachFile.getAttachDir(self.request, self.pagename, create=1)
         image_dict = {}
-        quotes = self.get_quotes()
+        image_alias = self.get_image_alias()
         if self.only_items:
-            files = quotes.keys()
+            files = image_alias.keys()
             all_files = [fn for fn in files if wikiutil.isPicture(fn) and
                          AttachFile.exists(self.request, self.pagename, fn)]
             if self.sort_by_alias:
-                alias_text = quotes.values()
+                alias_text = image_alias.values()
                 i = 0
                 for attfile in all_files:
                     image_dict[alias_text[i]] = attfile
@@ -413,7 +413,7 @@
         if self.reverse_sort:
             all_files.reverse()
         if all_files:
-            self.define_thumb_webnails(path, all_files, quotes)
+            self.define_thumb_webnails(path, all_files, image_alias)
         return all_files
 
     def create_thumbnail_and_webnail_image(self, image, webnail, thumbnail, image_type):