changeset 170:a489fd432404

text_x_arnica: create key only once
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Mon, 14 Jul 2008 19:15:35 +0200
parents 5ad37eeecc76
children 6c5af220a85a
files data/plugin/parser/text_x_arnica.py
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Mon Jul 14 19:05:14 2008 +0200
+++ b/data/plugin/parser/text_x_arnica.py	Mon Jul 14 19:15:35 2008 +0200
@@ -394,18 +394,13 @@
             self.description.append(ddict.get(attfile, attfile))
             self.full.append(attfile)
             fname, ext = os.path.splitext(attfile)
+            key = cache.key(self.request, itemname=self.pagename, attachname=attfile) 
+            webnail = 'W' + key
+            thumbfile = 'T' + key
             if ext in ('.gif', '.png'):
                 self.imgtype.append('PNG')
-                file_name = 'tmp.webnail_%s.png' % fname
-                webnail = cache.key(self.request, itemname=self.pagename, attachname=attfile) + 'W'
-                file_name = 'tmp.thumbnail_%s.png' % fname
-                thumbfile = cache.key(self.request, itemname=self.pagename, attachname=attfile) + 'T'
             else:
                 self.imgtype.append("JPEG")
-                file_name = 'tmp.webnail_%s.jpg' % fname
-                webnail = cache.key(self.request, itemname=self.pagename, attachname=attfile) + 'W'
-                file_name = 'tmp.thumbnail_%s.jpg' % fname
-                thumbfile = cache.key(self.request, itemname=self.pagename, attachname=attfile) + 'T'
 
             att_file = os.path.join(path, attfile)
             if os.path.exists(att_file):