changeset 26:7cf17d755657

text_x_arnica: fixed some pylints suggestions
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Fri, 23 May 2008 15:13:17 +0200
parents 294c4312845a
children 76bf4fe40f33
files data/plugin/parser/text_x_arnica.py
diffstat 1 files changed, 45 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Fri May 23 14:55:06 2008 +0200
+++ b/data/plugin/parser/text_x_arnica.py	Fri May 23 15:13:17 2008 +0200
@@ -5,19 +5,21 @@
     This parser is used to visualize a couple of images as a thumbnail gallery.
     Optional a description of an image could be added including WikiName.
     On default the image name and it's creation date is shown.
-    If you click on a thumbnail you get the webnails shown. By a menue you are able to toggle between the slides.
+    If you click on a thumbnail you get the webnails shown. 
+    By a menue you are able to toggle between the slides.
 
     Syntax:
       {{{
       #!arnica [target_page=target_page]
                [columns=columns],[filter=filter],[mode=mode],
-               [show_text=show_text],[show_date=show_date], [show_tools=show_tools],
-               [sort_by_name=sort_by_name],[sort_by_date=sort_by_date], [sort_by_alias=sort_by_alias],
+               [show_text=show_text],[show_date=show_date], 
+               [show_tools=show_tools], [sort_by_name=sort_by_name],
+               [sort_by_date=sort_by_date], [sort_by_alias=sort_by_alias],
                [reverse_sort=reverse_sort],
                [only_items=only_items],[template_itemlist=template_itemlist],
                [album=album],[album_name=album_name],[front_image=front_image],
-               [thumbnail_width=thumbnail_width],[webnail_width=webnail_width],[text_width=text_width],
-               [image_for_webnail=image_for_webnail],
+               [thumbnail_width=thumbnail_width],[webnail_width=webnail_width],
+               [text_width=text_width], [image_for_webnail=image_for_webnail],
                [sequence_name=sequence_name], [sequence_fps=sequence_fps],
                [border_thick=border_thick],[renew=renew],[help=help]
       * [[image1.jpg|alias]]
@@ -30,34 +32,49 @@
         filter:            regex to select images
         show_text:         default is 1 description is shown
                            any other means no description
-        show_date:         default is 1 date info from exif header if available is shown
-        show_tools:        default is 1 icon toolbar is show any other disables this
-        sort_by_name:      default is 1, the images are sorted by name, but not if only_items is 1
-        sort_by_date:      default is 0, if set to 1 the images are sorted to the modification time
-                           if they do have all the same time then the result is random
-        sort_by_alias      default is 0, if set to 1 and only_items set to 1 it is used to order the images by the alias name
+        show_date:         default is 1 date info from exif header if
+                           available is shown
+        show_tools:        default is 1 icon toolbar is show any other
+                           disables this
+        sort_by_name:      default is 1, the images are sorted by name,
+                           but not if only_items is 1
+        sort_by_date:      default is 0, if set to 1 the images are sorted
+                           to the modification time if they do have
+                           all the same time then the result is random
+        sort_by_alias      default is 0, if set to 1 and only_items set to 1
+                           it is used to order the images by the alias name
         reverse_sort:      default is 0, if set to 1 the file list is reversed
                            any other means no description
         mode:              default is 1 this means description below the image
                            any other number means description right of image
-        only_items:        default is 0 if it is set to 1 only images which are described in listitem are shown
+        only_items:        default is 0 if it is set to 1 only images which
+                           are described in listitem are shown
                            dependend on the order of the items
-        template_itemlist: default is 0, if set to 1 an item list is shown which could be copied into the script. 
-        album:             default is 0 if set to 1 only the first image of a series is shown but slideshow over all images 
-        album_name:        useful for album. default is 'album' use it as short name for the album. 
-        front_image:       Useful for album.  default is ''. The first image is shown in front of the album and slideshow.
-                           If set to an existing image name this is shown in front of album and slideshow. 
+        template_itemlist: default is 0, if set to 1 an item list is shown which
+                           could be copied into the script.
+        album:             default is 0 if set to 1 only the first image of
+                           a series is shown but slideshow over all images
+        album_name:        useful for album. default is 'album' use it as
+                           short name for the album.
+        front_image:       Useful for album.  default is ''. The first image
+                           is shown in front of the album and slideshow.
+                           If set to an existing image name this is shown in
+                           front of album and slideshow.
                            The slide show could start by this somewhere.
-        border_thick:      default is 1 this is the thickness in pixeln of the outer frame
-        renew:             default is 0 if set to 1 then all selected thumbnails_* and webnails_* removed.
+        border_thick:      default is 1 this is the thickness in pixeln of
+                           the outer frame
+        renew:             default is 0 if set to 1 then all selected
+                           thumbnails_* and webnails_* removed.
                            Afterwards they are new created.
         thumbnail_width:   default is 128
         webnail_width:     default is 640
-        text_width:        default is 140		   
-        image_for_webnail  default is 0 if set to 1 then the image is shown as preview and not the webnail
-        help:              default is 0 if set a copy of the CALLING SEQUENCE is shown, 
-                           (there are some new ideas around to show help to an user so this will be later replaced)
-                           
+        text_width:        default is 140
+        image_for_webnail  default is 0 if set to 1 then the image is shown as
+                           preview and not the webnail
+        help:              default is 0 if set a copy of the CALLING SEQUENCE
+                           is shown, (there are some new ideas around to show
+                           help to an user so this will be later replaced)
+
 
     OPTIONAL INPUTS:
         itemlist : if it is used and only_items is 1 then only the images in this list are ahown.
@@ -74,7 +91,6 @@
 Dependencies = ['time'] # do not cache
 
 import os, re
-from StringIO import StringIO
 from random import randint
 from MoinMoin import caching, wikiutil
 from MoinMoin.action import AttachFile
@@ -567,7 +583,6 @@
     def format(self, formatter):
         """ does the format """
         _ = self._
-        page = formatter.page
         if self.help == '1':
             self.print_help()
             return
@@ -581,7 +596,10 @@
             return
 
         if self.template_itemlist == '1':
-            self.request.write(_("Copy the following listitems into the script. Replace alias with the label you want. Afterwards disable template_itemlist by setting it to 0:"))
+            self.request.write(_("""
+            Copy the following listitems into the script. 
+            Replace alias with the label you want. 
+            Afterwards disable template_itemlist by setting it to 0:"""))
             self.request.write('<br>')
             for image in self.full:
                 self.request.write(' * [[%(image)s|%(alias)s]]<br>\n' % {