diff MoinMoin/util/send_file.py @ 969:5bf6d7a2ffcf

Convert all %r, %s, %x, %d, %i, %o to new Format String Syntax
author Vedran Mileti? <rivanvx@gmail.com>
date Sun, 16 Oct 2011 02:26:35 +0200
parents 1e9ec607913d
children e61194bb558e
line wrap: on
line diff
--- a/MoinMoin/util/send_file.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/send_file.py	Sun Oct 16 02:26:35 2011 +0200
@@ -36,7 +36,7 @@
     :param coding: the coding (charset) to use. it is a good idea to use 'UTF-8'.
     :param lang: the language to use. defaults to empty string (no language given).
     """
-    return "%s'%s'%s" % (coding, lang, url_quote(value, charset=coding))
+    return "{0}'{1}'{2}".format(coding, lang, url_quote(value, charset=coding))
 
 
 def send_file(filename=None, file=None,
@@ -121,7 +121,7 @@
         # Note: we only give filename* param, not filename param, hoping that a user agent that
         # does not support filename* then falls back into using the last URL fragment (and decodes
         # that correctly). See there for details: http://greenbytes.de/tech/tc2231/
-        headers.add('Content-Disposition', 'attachment; filename*=%s'% encode_rfc2231(attachment_filename))
+        headers.add('Content-Disposition', 'attachment; filename*={0}'.format(encode_rfc2231(attachment_filename)))
 
     if current_app.use_x_sendfile and filename:
         if file:
@@ -154,7 +154,7 @@
 
     if add_etags:
         if etag is None and filename:
-            etag = 'flask-%s-%s-%s' % (
+            etag = 'flask-{0}-{1}-{2}'.format(
                 mtime or os.path.getmtime(filename),
                 os.path.getsize(filename),
                 adler32(filename) & 0xffffffff