Commits

David Chambers committed dc14e6c

Renamed `path_to_file`.

Comments (0)

Files changed (1)

     'alias=>canon': re.compile(r'^(0*(?P<alias>.*?)=>)?(?P<canon>.+)$'),
     'excerpt': re.compile(block % r'\|'),
     'excerpt_pipes': re.compile(match % r'\|'),
-    'filesize': re.compile(r'''{{\s*filesize:(['"])(?P<path>\S+)\1\s*}}'''),
+    'filesize': re.compile(r'''{{\s*filesize:(['"])(?P<filepath>\S+)\1\s*}}'''),
     'fragment': re.compile(r'(?s)(<code>.*?</code>|<pre>.*?</pre>|<skip>.*?</skip>)'),
     'hand-crafted': re.compile(r' {,3}\S+:.*(\n[ \t]*\S+:.*)*\n{2,}(?P<excerpt>(\|(?=[ \n])[^\n]*\n)+)'),
     'heading': re.compile(r'(?m)\s*<(h[1-6])[^>]*>(?P<title>.+?)</\1>$(?P<html>[\s\S]*)'),
                 self.title = match.group('title')
                 self.html = match.group('html')
 
-        def filesize(path_to_file):
-            if not os.path.isabs(path_to_file):
-                path_to_file = os.path.join(PROJECT_PATH, path_to_file)
+        def filesize(filepath):
+            if not os.path.isabs(filepath):
+                filepath = os.path.join(PROJECT_PATH, filepath)
             try:
-                filesize = os.path.getsize(path_to_file)
+                filesize = os.path.getsize(filepath)
             except OSError:
                 return u'' # fail silently
 
             if not re.match(RE['snippet'], fragment):
                 fragment = re.sub(RE['filesize'],
                         lambda match: u'<span class="filesize">%s</span>' % (
-                        filesize(match.group('path'))), fragment)
+                        filesize(match.group('filepath'))), fragment)
                 if REPLACEMENTS:
                     for pattern, replacement in RE['replacements']:
                         fragment = re.sub(pattern, replacement, fragment)