]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
use print function insted of stetement at doc-string
authorAkihiro Yamazaki <yamazaki@iij.ad.jp>
Fri, 2 Sep 2016 05:52:06 +0000 (14:52 +0900)
committerAkihiro Yamazaki <yamazaki@iij.ad.jp>
Fri, 2 Sep 2016 05:52:06 +0000 (14:52 +0900)
tornado/httpclient.py
tornado/locale.py
tornado/template.py

index 762919ee8779c9b744cae7ec0b00b86cfffb92d9..59dcdf659a4ac3c56d6428e2c9003094d46b71e3 100644 (file)
@@ -61,7 +61,7 @@ class HTTPClient(object):
         http_client = httpclient.HTTPClient()
         try:
             response = http_client.fetch("http://www.google.com/")
-            print response.body
+            print(response.body)
         except httpclient.HTTPError as e:
             # HTTPError is raised for non-200 responses; the response
             # can be found in e.response.
@@ -110,9 +110,9 @@ class AsyncHTTPClient(Configurable):
 
         def handle_response(response):
             if response.error:
-                print "Error:", response.error
+                print("Error:", response.error)
             else:
-                print response.body
+                print(response.body)
 
         http_client = AsyncHTTPClient()
         http_client.fetch("http://www.google.com/", handle_response)
index 4f80fd366382923c410cb71d946e645d25bebf33..c1cb6792b84fd25efad094b1f9da5a9396ced8bb 100644 (file)
@@ -19,7 +19,7 @@
 To load a locale and generate a translated string::
 
     user_locale = tornado.locale.get("es_LA")
-    print user_locale.translate("Sign out")
+    print(user_locale.translate("Sign out"))
 
 `tornado.locale.get()` returns the closest matching locale, not necessarily the
 specific locale you requested. You can support pluralization with
@@ -28,7 +28,7 @@ additional arguments to `~Locale.translate()`, e.g.::
     people = [...]
     message = user_locale.translate(
         "%(list)s is online", "%(list)s are online", len(people))
-    print message % {"list": user_locale.list(people)}
+    print(message % {"list": user_locale.list(people)})
 
 The first string is chosen if ``len(people) == 1``, otherwise the second
 string is chosen.
index cbb296a3a8b388895687fd2d9ff6e5a8e2f11f0b..67c61e6b5f985cb1ba146ddb82df1256945ea7b4 100644 (file)
 Basic usage looks like::
 
     t = template.Template("<html>{{ myvalue }}</html>")
-    print t.generate(myvalue="XXX")
+    print(t.generate(myvalue="XXX"))
 
 `Loader` is a class that loads templates from a root directory and caches
 the compiled templates::
 
     loader = template.Loader("/home/btaylor")
-    print loader.load("test.html").generate(myvalue="XXX")
+    print(loader.load("test.html").generate(myvalue="XXX"))
 
 We compile all templates to raw Python. Error-reporting is currently... uh,
 interesting. Syntax for the templates::