diff MoinMoin/action/info.py @ 1911:0b2ad3099fcf

AttachFile.size to reduce code duplication, fixed docstring
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 25 Mar 2007 23:14:29 +0200
parents b07b4c102d3d
children eb68960b1dfb
line wrap: on
line diff
--- a/MoinMoin/action/info.py	Sun Mar 25 22:37:45 2007 +0200
+++ b/MoinMoin/action/info.py	Sun Mar 25 23:14:29 2007 +0200
@@ -133,12 +133,7 @@
                 size = 0
                 if line.action != 'ATTDEL':
                     from MoinMoin.action import AttachFile
-                    page_dir = AttachFile.getAttachDir(request, pagename)
-                    filepath = os.path.join(page_dir, filename.encode(config.charset))
-                    try:
-                        size = os.path.getsize(filepath)
-                    except:
-                        pass
+                    size = AttachFile.size(request, pagename, filename)
                     if line.action == 'ATTNEW':
                         actions.append(render_action(_('view'), {'action': 'AttachFile', 'do': 'view', 'target': '%s' % filename}))
                     elif line.action == 'ATTDRW':