changeset 226:9faa8f0e9f86

fixed docstrings and removed some whitespaces
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Mon, 01 Sep 2008 18:57:06 +0200
parents c34794a7962b
children a16b7c703fd3
files data/plugin/action/arnica_slides.py data/plugin/parser/text_x_arnica.py
diffstat 2 files changed, 6 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/arnica_slides.py	Mon Sep 01 18:47:59 2008 +0200
+++ b/data/plugin/action/arnica_slides.py	Mon Sep 01 18:57:06 2008 +0200
@@ -29,7 +29,7 @@
 
 
 def image_rotate(file_name, angle, img_type):
-    """ rotates the image and dependent images
+    """ rotates the image
 
     @param file_name: the name of the attachment
     @param angle: rotation angle
@@ -38,7 +38,7 @@
     # only image needs to be rotated, webnail and thumbnail
     # will be recreated by the arnica parser
     image_object = Image.open(file_name)
-    # we save the old file (don't use .bak here)
+    # we save the old file (don't use .bak here. bak is used for image delete.)
     tmp_file = file_name + '.tmp'
     os.rename(file_name, tmp_file)
     try:
@@ -196,7 +196,6 @@
     }
     return html
 
-
 def html_slideform(request, pagename, alias, exif_date, images, original_images, idx, image_for_webnail):
     """ html code for the slideform
 
@@ -273,7 +272,6 @@
     }
     return html
 
-
 def option_list(this_image, pagename, filenames, original_images, request, image_for_webnail):
     """ generates the pulldown option list
 
@@ -304,7 +302,6 @@
         i += 1
     return ''.join(options)
 
-
 class arnica_slides(ActionBase):
     """ arnica_slides page action
 
@@ -471,7 +468,6 @@
             request.theme.add_msg(msg, "info")
             self.page.send_page()
 
-
 def execute(pagename, request):
     """ Main dispatcher for the arnica_slides action. """
     _ = request.getText
--- a/data/plugin/parser/text_x_arnica.py	Mon Sep 01 18:47:59 2008 +0200
+++ b/data/plugin/parser/text_x_arnica.py	Mon Sep 01 18:57:06 2008 +0200
@@ -82,9 +82,6 @@
             webnail_width = '%g%s' % webnail_width
     return locals()
 
-
-
-
 def _get_files(request, pagename):
     # get files dependent on isPicture and ignores tmp. files
     # ToDo remove tmp. files check later
@@ -92,7 +89,6 @@
     files = [fn for fn in files if wikiutil.isPicture(fn) and not fn.startswith('tmp.')]
     return files
 
-
 class Parser:
     """ arnica parser """
 
@@ -207,7 +203,7 @@
     def html_tools(self, idx):
         """ html code of thumbnails view with contol
 
-        @param idx: index postion of corresponding data
+        @param idx: index position of corresponding data
         """
 
         this_image = self.high_resolution_image[idx]
@@ -481,7 +477,7 @@
                     try:
                         im_obj.thumbnail((int(self.webnail_width.strip('px')), int(self.webnail_width.strip('px'))), Image.ANTIALIAS)
                     except IOError:
-                        # image file is truncated
+                        #  one reason can be that the image file is truncated
                         return
                     if exif:
                         try:
@@ -509,7 +505,7 @@
                 try:
                     im_obj.thumbnail((int(self.thumbnail_width.strip('px')), int(self.thumbnail_width.strip('px'))), Image.ANTIALIAS)
                 except IOError:
-                    # image file is truncated
+                    # one reason can be that the image file is truncated
                     return
                 buf = StringIO.StringIO()
                 im_obj.save(buf, image_type)
@@ -554,7 +550,7 @@
             self.request.write(self.formatter.preformatted(0))
             self.request.write(self.formatter.div(0))
             self.request.write(self.formatter.div(0))
-        # ToDo lowercase COLUMNS
+
         cols = min([self.columns, len(self.high_resolution_image)])
         if self.album:
             cols = 1