changeset 217:1c76b2acd1a5

arnica_slides: simplified and removed some useless comments
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Mon, 01 Sep 2008 17:16:48 +0200
parents 0779bac0e8f4
children cec66eb7315f
files data/plugin/action/arnica_slides.py
diffstat 1 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/arnica_slides.py	Mon Sep 01 17:11:25 2008 +0200
+++ b/data/plugin/action/arnica_slides.py	Mon Sep 01 17:16:48 2008 +0200
@@ -421,24 +421,22 @@
         # only users which are allowed to delete should use this tool
         elif request.user.may.delete(pagename):
             # only POST continues
-            # ToDo simplify
-            if not request.request_method == 'POST':
+            if request.request_method != 'POST':
                 msg = _('Missing parameters or GET method used')
                 request.theme.add_msg(msg, "error")
                 self.page.send_page()
                 return
 
             filename, ext = os.path.splitext(target)
-            # ToDo simplify
+            img_type = "JPEG"
+            thumbfile = "tmp.thumbnail_%s.jpg"  % filename
+            webnail = "tmp.webnail_%s.jpg"  % filename
+
             if ext in ('.gif', '.png'):
                 img_type = 'PNG'
                 thumbfile = "tmp.thumbnail_%s.png" % filename
                 webnail = "tmp.webnail_%s.png" % filename
-            else:
-                img_type = "JPEG"
-                thumbfile = "tmp.thumbnail_%s.jpg"  % filename
-                webnail = "tmp.webnail_%s.jpg"  % filename
-
+            
             if command in ('delete', 'rotate_left', 'rotate_right', ):
                 cache.remove(self.request, webnail)
                 cache.remove(self.request, thumbfile)
@@ -455,12 +453,10 @@
                 AttachFile.move_file(request, pagename, pagename, target, bakfile)
                 msg = _('%(target)s deleted, backup in place') % {'target': target}
 
-            # rotate left
             elif command == 'rotate_left':
                 image_rotate(infile, 90, img_type)
                 msg = _('%(target)s rotated left 90 degrees') % {'target': target}
 
-            # rotate right
             elif command == 'rotate_right':
                 image_rotate(infile, 270, img_type)
                 msg = _('%(target)s rotated right 90 degrees') % {'target': target}