changeset 28:e71bbef3a837

PEP8 whitespace fix to satisfy test_sourcecode
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Fri, 23 May 2008 22:06:05 +0200
parents 76bf4fe40f33
children af82335acd58
files data/plugin/action/arnica_slides.py data/plugin/parser/text_x_arnica.py
diffstat 2 files changed, 51 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/arnica_slides.py	Fri May 23 15:36:03 2008 +0200
+++ b/data/plugin/action/arnica_slides.py	Fri May 23 22:06:05 2008 +0200
@@ -4,7 +4,7 @@
     This action macro is used to rotate, move to bak or to slide through the images from arnica
 
     based on gallery2image by ReimarBauer 2005-2008
-    
+
     @copyright: 2008 by MoinMoin:ReimarBauer
     @license: GNU GPL, see COPYING for details.
 """
@@ -29,7 +29,7 @@
 action_name = __name__.split('.')[-1]
 
 def html_js(request, counter):
-    """ javscript for the slides 
+    """ javscript for the slides
     @param request: request object
     @param this_image:  url of image to start
     @param counter: index position of this_image
@@ -49,7 +49,7 @@
 <!-- Some code added and replaced for the MoinMoin:arnica parser-->
 
 
-<!-- Begin 
+<!-- Begin
 
 var rotate_delay = 5; // delay in milliseconds (5000 = 5 secs)
 var current = %(counter)s;
@@ -58,25 +58,25 @@
 
 function arnica_preload() {
    var list = document.slideform.webnail_list.value;
-   var value = list.split(","); 
+   var value = list.split(",");
    var n = value.length;
-   
+
    for (i = 0; i <  n-1; i++){
        theImages[i] = new Image();
        theImages[i].src = value[i];
-   }   
+   }
    thewebImages = theImages;
-} 
+}
 
 function arnica_getserver() {
      var value = document.URL;
      var text = value.split("/");
      return text[0]+'//'+text[2];
-}     
+}
 
 function arnica_show_image(image) {
     return arnica_getserver() + '%(htdocs)s' + '/common/arnica/' + image;
-} 
+}
 
 function arnica_add_comments() {
   var alias_text = document.slideform.alias.value;
@@ -101,9 +101,9 @@
 
 function arnica_previous_slide() {
    if (current-1 >= 0) {
-      document.images.show.src = theImages[current-1].src;  
+      document.images.show.src = theImages[current-1].src;
       document.slideform.slide.selectedIndex = --current;
-      arnica_add_comments(); 
+      arnica_add_comments();
    }
    else arnica_last_slide();
    document.getElementById("arnica_first_slide").innerHTML = '<img src="'+arnica_show_image('arnica_first.png')+'" onclick="arnica_first_slide();" name="fs"  title="first slide" >';
@@ -112,7 +112,7 @@
 
 function arnica_first_slide() {
    current = 0;
-   document.images.show.src = theImages[0].src;  
+   document.images.show.src = theImages[0].src;
    document.slideform.slide.selectedIndex = 0;
    arnica_add_comments();
    document.getElementById("arnica_first_slide").innerHTML = '<img src="'+arnica_show_image('arnica_first_disabled.png')+'" title="first slide" >';
@@ -121,7 +121,7 @@
 
 function arnica_last_slide() {
    current = document.slideform.slide.length-1;
-   document.images.show.src = theImages[current].src; 
+   document.images.show.src = theImages[current].src;
    document.slideform.slide.selectedIndex = current;
    arnica_add_comments();
    document.getElementById("arnica_first_slide").innerHTML = '<img src="'+arnica_show_image('arnica_first.png')+'" onclick="arnica_first_slide();" name="fs"  title="first slide" >';
@@ -135,8 +135,8 @@
 
 function arnica_change() {
    current = document.slideform.slide.selectedIndex;
-   document.images.show.src = theImages[current].src; 
-   arnica_add_comments(); 
+   document.images.show.src = theImages[current].src;
+   arnica_add_comments();
    document.getElementById("arnica_first_slide").innerHTML = '<img src="'+arnica_show_image('arnica_first.png') +'" onclick="arnica_first_slide();" name="fs"  title="first slide" >';
    document.getElementById("arnica_last_slide").innerHTML = '<img src="'+arnica_show_image('arnica_last.png')+'" onclick="arnica_last_slide();" name="fs"  title="last slide" >';
 }
@@ -144,9 +144,9 @@
 function arnica_rotate() {
    if (document.slideform.slidebutton.value == "Stop") {
       current = (current == document.slideform.slide.length-1) ? 0 : current+1;
-      document.images.show.src = theImages[current].src; 
+      document.images.show.src = theImages[current].src;
       document.slideform.slide.selectedIndex = current;
-      arnica_add_comments(); 
+      arnica_add_comments();
       document.getElementById("arnica_first_slide").innerHTML = '<img src="'+arnica_show_image('arnica_first.png')+'" onclick="arnica_first_slide();" name="fs"  title="first slide" >';
       document.getElementById("arnica_last_slide").innerHTML = '<img src="'+arnica_show_image('arnica_last.png')+'" onclick="arnica_last_slide();" name="fs"  title="last slide" >';
       rotate_delay = document.slideform.duration.value * 1000.;
@@ -164,12 +164,12 @@
     """ html code for the slideform
     @param request: request object
     @param pagename: pagename where the attachments are located
-    @param url_wiki_page: 
+    @param url_wiki_page:
     @param alias: text alias for filename
-    @param exif_date:  date information 
-    @param target: all images 
-    @param idx:  index position of the image
-    @param image_for_webnail:  identifier for AttchFile or arnica_slides
+    @param exif_date: date information
+    @param target: all images
+    @param idx: index position of the image
+    @param image_for_webnail: identifier for AttchFile or arnica_slides
     """
     if not image_for_webnail:
         url = getAttachUrl(request.getScriptname(), pagename, "")
@@ -179,7 +179,7 @@
     option_webnail = option_list(url + target[idx], pagename, target, request, image_for_webnail)
 
     inner_table_style = ' style="border-style:none; margin:10px;"'
-        
+
     this_webnail_list = ''
     for name in target:
         this_webnail_list += url + name + ','
@@ -228,7 +228,7 @@
      <P><SPAN id="arnica_alias_text">%(this_alias_text)s</SPAN></P>
     </td></tr>
    <tr valign="center">
-    <td style="border-style:none" colspan="5" bgcolor="#C0C0C0" align="left">  
+    <td style="border-style:none" colspan="5" bgcolor="#C0C0C0" align="left">
      <P><SPAN id="arnica_exif_date_text">%(this_exif_date_text)s</SPAN></P>
     </td>
   </tr>
@@ -317,7 +317,7 @@
 
     def image_rotate(self, file_name, webf, thumbf, angle, img_type):
         """ rotates the image and dependent images
-        
+
         @param file: the name of the attachment
         @param webf: the name of the webnail
         @param thumbf: the name of the thumbnail
@@ -479,22 +479,22 @@
                 cache_thumb.remove()
 
                 msg = _('%(target)s deleted, backup in place' % {
-                      'target':target})
+                      'target': target})
             # rotate left
             elif command == 'RL':
                 self.image_rotate(infile, webf, thumbf, 90, img_type)
-                msg = _('%(target)s rotated to left 90 degrees' % {'target':target})
+                msg = _('%(target)s rotated to left 90 degrees' % {'target': target})
 
             # rotate right
             elif command == 'RR':
                 self.image_rotate(infile, webf, thumbf, 270, img_type)
-                msg = _('%(target)s rotated to right 90 degrees' % {'target':target})
+                msg = _('%(target)s rotated to right 90 degrees' % {'target': target})
 
             else:
                 # fallback
                 msg = _('action not implemented: %s') % (command, )
         else:
-            msg = _('Your are not allowed to change attachments on this page: %s') % (pagename,)
+            msg = _('Your are not allowed to change attachments on this page: %s') % (pagename, )
 
         if msg:
             request.theme.add_msg(msg, "info")
--- a/data/plugin/parser/text_x_arnica.py	Fri May 23 15:36:03 2008 +0200
+++ b/data/plugin/parser/text_x_arnica.py	Fri May 23 22:06:05 2008 +0200
@@ -1,18 +1,18 @@
 # -*- coding: iso-8859-1 -*-
 """
-    MoinMoin - arnica parser 
-       
+    MoinMoin - arnica parser
+
     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. 
+    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]
+      #!arnica [target_page=target_page],
                [columns=columns],[filter=filter],[mode=mode],
-               [show_text=show_text],[show_date=show_date], 
+               [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],
@@ -81,10 +81,10 @@
                    The alias text is used as description of the image instead of the file name
 
 
-    
+
     MODIFICATION HISTORY:
     based on Gallery2 by ReimarBauer 2005-2008, ThomasWaldmann 2005, FlorianFesti 2006
-       
+
     @copyright: 2008 by MoinMoin:ReimarBauer
     @license: GNU GPL, see COPYING for details.
 """
@@ -102,10 +102,10 @@
 except ImportError:
     Image = None
 
-# ToDo may be move to wikiutil    
+# ToDo may be move to wikiutil
 def get_exif_info(file_name):
-    """ gets exif info from image file 
-    @param: image file name 
+    """ gets exif info from image file
+    @param: image file name
     """
     date = "--"
     if wikiutil.isPicture(file_name):
@@ -122,7 +122,7 @@
     """ arnica parser """
     extensions = '*.jpg'
     def __init__(self, raw, request, **kw):
-        # list of optional arguments for the parser starts here 
+        # list of optional arguments for the parser starts here
         self.target_page = ''
         self.sort_by_date = '0'
         self.sort_by_name = '1'
@@ -172,12 +172,12 @@
         self.full = [] # array for  images
         self.thumb = [] # array for thumbnails
         self.exif_date = [] # array of exif date description
-        self.imgtype = [] # array of imagetype of full image 
+        self.imgtype = [] # array of imagetype of full image
         self.description = [] # array of description
         self.webimg = [] # array of images for forms
 
     def show_tools_restricted(self, this_target):
-        """ show only tools to users with enough rights 
+        """ show only tools to users with enough rights
         @param this_target: image
         """
         if not self.request.user.may.delete(self.pagename):
@@ -255,7 +255,7 @@
             "target": self.webimg[idx] + ',' + ','.join(self.webimg),
             "this_target": self.full[idx],
             "thumbnail": "%s%s" % (AttachFile.getAttachUrl(self.pagename, '', self.request), self.thumb[idx]),
-            "show_tools_restricted":self.show_tools_restricted(this_image)
+            "show_tools_restricted": self.show_tools_restricted(this_image)
             }
 
         return text
@@ -307,7 +307,7 @@
                 <input type="image" value="submit" src="?action=arnica_slides&do=view&target=%(thumbnail)s">
             </td>
         </form>
-            %(alias_html)s 
+            %(alias_html)s
     </tr>
     <tr>%(tools_html)s%(date_html)s</tr>''' % {
      "tdstyle": self.td_style,
@@ -330,8 +330,8 @@
         """ view mode 1 selection of tools """
         if self.show_tools == '1':
             text = "<tr><td align=""center""%(style)s>%(tools)s </td></tr>" % {
-                "style":self.td_style,
-                "tools":self.tools_html(idx)}
+                "style": self.td_style,
+                "tools": self.tools_html(idx)}
         else:
             text = ''
         return text
@@ -343,7 +343,7 @@
 <tr>
 <td%(style)s>%(this_exif_date)s</td>
 </tr>''' % {
-        "style":self.td_style,
+        "style": self.td_style,
         "this_exif_date": self.exif_date[idx]}
         else:
             return ''
@@ -402,7 +402,7 @@
         return text
 
     def get_files(self, path, files, quotes):
-        """ get files creates lists for thumbnails and webnails 
+        """ get files creates lists for thumbnails and webnails
         @param path: path to attachment
         @param files: file names of images
         @param quotes: text alias for image file
@@ -493,7 +493,7 @@
     def select_files(self, formatter):
         """ select files """
 
-        # we need to take the page_name from the formatter.page otherwise 
+        # we need to take the page_name from the formatter.page otherwise
         # include does not work
         self.pagename = formatter.page.page_name
         if self.target_page:
@@ -597,8 +597,8 @@
 
         if self.template_itemlist == '1':
             self.request.write(_("""
-            Copy the following listitems into the script. 
-            Replace alias with the label you want. 
+            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: