changeset 98:edb3aa8208b2

text_x_arnica: removed some whitespaces, moved _get_files below macro_arnica
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Mon, 23 Jun 2008 23:50:00 +0200
parents 477255e09c8c
children 4762bad57dae
files data/plugin/parser/text_x_arnica.py
diffstat 1 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Sun Jun 22 16:21:43 2008 +0200
+++ b/data/plugin/parser/text_x_arnica.py	Mon Jun 23 23:50:00 2008 +0200
@@ -34,13 +34,6 @@
 
 parser_name = __name__.split('.')[-1]
 
-def _get_files(request, pagename):
-    attach_dir = AttachFile.getAttachDir(request, pagename)
-    files = []
-    if os.path.isdir(attach_dir):
-        files = [fn.decode(config.charset) for fn in os.listdir(attach_dir) if wikiutil.isPicture(fn) and not fn.startswith('tmp.')]
-    return files
-
 def macro_arnica(target_page=u'', columns=4, file_regex=u'.',
                  image_for_webnail=False,
                  show_text=True, show_date=True, show_tools=True,
@@ -94,8 +87,15 @@
         if tags.has_key('EXIF DateTimeOriginal'):
             date = str(tags['EXIF DateTimeOriginal'])
             date = date.replace(':', '-', 2)
+    return date
 
-    return date
+def _get_files(request, pagename):
+    attach_dir = AttachFile.getAttachDir(request, pagename)
+    files = []
+    if os.path.isdir(attach_dir):
+        files = [fn.decode(config.charset) for fn in os.listdir(attach_dir) 
+                 if wikiutil.isPicture(fn) and not fn.startswith('tmp.')]
+    return files
 
 class Parser:
     """ arnica parser """
@@ -216,7 +216,6 @@
             "thumbnail": "%s%s" % (AttachFile.getAttachUrl(self.pagename, '', self.request), self.thumb[idx]),
             "html_show_tools_restricted": self.html_show_tools_restricted(this_image)
             }
-
         return text
 
     def html_show_tools(self, idx):
@@ -386,7 +385,6 @@
                 keys = image_dict.keys()
                 keys.sort()
                 all_files = [image_dict[txt] for txt in keys]
-
         else:
             all_files = _get_files(self.request, self.pagename)