summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQingPeng Zhan <scau.myzhan@gmail.com>2013-02-17 01:44:35 +0800
committerQingPeng Zhan <scau.myzhan@gmail.com>2013-02-17 01:44:35 +0800
commit0ba22fadaeb0e1909fdde4ead11d1f05b6ee5a39 (patch)
tree26bf3a8b89ade0a0f56b6b8f809e42aa6106d48d
parent404471131f26ca144056241e7d327ad3a62f0e4f (diff)
downloadbottle-0ba22fadaeb0e1909fdde4ead11d1f05b6ee5a39.tar.gz
new 'Request Data' section translated
-rw-r--r--docs/_locale/zh_CN/tutorial.po626
1 files changed, 447 insertions, 179 deletions
diff --git a/docs/_locale/zh_CN/tutorial.po b/docs/_locale/zh_CN/tutorial.po
index ebdf5cf..64fb9cd 100644
--- a/docs/_locale/zh_CN/tutorial.po
+++ b/docs/_locale/zh_CN/tutorial.po
@@ -7,14 +7,15 @@ msgid ""
msgstr ""
"Project-Id-Version: Bottle 0.12-dev\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-11-09 18:23\n"
-"PO-Revision-Date: 2012-11-09 19:10+0800\n"
+"POT-Creation-Date: 2013-02-17 01:11\n"
+"PO-Revision-Date: 2013-02-17 01:38+0800\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.5.4\n"
# 2cfce930fec043468539792502c72326
#: ../../tutorial.rst:24
@@ -581,6 +582,11 @@ msgstr ""
"加 `Content-Length` 字段和自动转换unicode编码。下面列出了所有你能返回的内容类"
"型,以及框架处理方式的一个简述。"
+# cd50167d8d094ecf947bb272905d75b7
+#: ../../tutorial.rst:285
+msgid "Dictionaries"
+msgstr ""
+
# 05aa98461f2e434f81e050cbcc756f6a
#: ../../tutorial.rst:285
msgid ""
@@ -595,12 +601,22 @@ msgstr ""
"json`` 。可十分简单地实现基于JSON的API。Bottle同时支持json之外的数据类型,详"
"见 :ref:`tutorial-output-filter` 。"
+# fef9f9cdcf174200a8c9d34fe40ec6a8
+#: ../../tutorial.rst:288
+msgid "Empty Strings, ``False``, ``None`` or other non-true values:"
+msgstr ""
+
# 947fe77a24c4436f92b3de6ac018bfb8
#: ../../tutorial.rst:288
msgid ""
"These produce an empty output with the ``Content-Length`` header set to 0."
msgstr "输出为空, ``Content-Length`` 设为0。"
+# 53831a3d134a4bcc8b1553ff0e8ef190
+#: ../../tutorial.rst:291
+msgid "Unicode strings"
+msgstr "Unicode的问题"
+
# 6b454d4e4ee04af1809c42870727aeab
#: ../../tutorial.rst:291
msgid ""
@@ -611,6 +627,11 @@ msgstr ""
"Unicode字符串 (or iterables yielding unicode strings) 被自动转码, ``Content-"
"Type`` 被默认设置为utf8,接着视之为普通字符串(见下文)。"
+# e8ae5fa61f0942cd9fe48e03fa9351e9
+#: ../../tutorial.rst:294
+msgid "Byte strings"
+msgstr ""
+
# e20b8cfb4e7a434c9a95dc125561a7f0
#: ../../tutorial.rst:294
msgid ""
@@ -625,6 +646,11 @@ msgstr ""
"字符串不会被合并,因为它们也许太大来,耗内存。在这种情况下, ``Content-"
"Length`` 字段不会被设置。"
+# c0b5bc13bd1f456ea06c9ec8c0ae332e
+#: ../../tutorial.rst:297
+msgid "Instances of :exc:`HTTPError` or :exc:`HTTPResponse`"
+msgstr ""
+
# 4b231556398548d6804429d660fe8f90
#: ../../tutorial.rst:297
msgid ""
@@ -635,6 +661,11 @@ msgstr ""
"返回它们和直接raise出来有一样的效果。对于 :exc:`HTTPError` 来说,会调用错误处"
"理程序。详见 :ref:`tutorial-errorhandling` 。"
+# 8ec78edc24634cb19d9d3fe68fff214f
+#: ../../tutorial.rst:300
+msgid "File objects"
+msgstr ""
+
# 84bf9373fcf148a0b17af9a22e9473d7
#: ../../tutorial.rst:300
msgid ""
@@ -652,6 +683,11 @@ msgstr ""
"的HTTP头,例如 ``Content-Length`` 和 ``Content-Type`` 不会被自动设置。尽可能"
"使用 :func:`send_file` 。详见 :ref:`tutorial-static-files` 。"
+# 5a4011401e1b4adfa5dc9114b1491c26
+#: ../../tutorial.rst:303
+msgid "Iterables and generators"
+msgstr ""
+
# 134e34ab7165436b8232fe79d85d695e
#: ../../tutorial.rst:303
msgid ""
@@ -895,7 +931,7 @@ msgstr ""
# 1ffb76e4eada4039b6633e13cdb49c6a
# 35303652d16f422bacde561fb6912852
-#: ../../tutorial.rst:418 ../../tutorial.rst:499
+#: ../../tutorial.rst:418 ../../tutorial.rst:547
msgid "Cookies"
msgstr ""
@@ -1052,179 +1088,411 @@ msgstr "请求数据 (Request Data)"
# 5bf5d62b2bae4266b7c48345f157eda7
#: ../../tutorial.rst:487
msgid ""
-"Bottle provides access to HTTP-related metadata such as cookies, headers and "
-"POST form data through a global ``request`` object. This object always "
-"contains information about the *current* request, as long as it is accessed "
-"from within a callback function. This works even in multi-threaded "
-"environments where multiple requests are handled at the same time. For "
-"details on how a global object can be thread-safe, see :doc:`contextlocal`."
+"Cookies, HTTP header, HTML ``<form>`` fields and other request data is "
+"available through the global :data:`request` object. This special object "
+"always refers to the *current* request, even in multi-threaded environments "
+"where multiple client connections are handled at the same time::"
+msgstr ""
+"可通过全局的 :data:`request` 对象来访问Cookies,HTTP头,HTML的 ``<form>`` 字"
+"段,以及其它的请求数据。这个特殊的对象总是指向 *当前* 的请求,即使在同时处理"
+"多个客户端连接的多线程情况下。"
+
+# 8466f755a5544bdd95621e346d6c0a60
+#: ../../tutorial.rst:496
+msgid ""
+"The :data:`request` object is a subclass of :class:`BaseRequest` and has a "
+"very rich API to access data. We only cover the most commonly used features "
+"here, but it should be enough to get started."
+msgstr ""
+":data:`request` 对象继承自 :class:`BaseRequest` ,提供了丰富的API来访问数据。"
+"虽然我们只介绍最常用的特性,也足够入门了。"
+
+# 0ca3e35753434dba85029c1e93ea2bde
+#: ../../tutorial.rst:501
+msgid "Introducing :class:`FormsDict`"
+msgstr "介绍 :class:`FormsDict` "
+
+# d1385d18bbf148fc9547cfeadc3fe627
+#: ../../tutorial.rst:503
+msgid ""
+"Bottle uses a special type of dictionary to store form data and cookies. :"
+"class:`FormsDict` behaves like a normal dictionary, but has some additional "
+"features to make your life easier."
msgstr ""
-"Bottle通过 ``request`` 对象来提供对HTTP相关元数据的访问,例如cookie,HTTP头,"
-"通过POST方法提交的表单。只要在回调函数中使用,该对象总是包含当前这次浏览器请"
-"求的信息。即使在多线程环境中,多个请求同时被响应,这依然有效。关于全局对象是"
-"如何做到线程安全的,详见 :doc:`contextlocal` 。"
+"Bottle使用了一个特殊的字典来储存表单数据和cookies。 :class:`FormsDict` 表现得"
+"像一个普通的字典,但提供了更方便的额外功能。"
# 36ea0be70fe44886bfec49f8263868e1
-#: ../../tutorial.rst:491
+#: ../../tutorial.rst:505
msgid ""
-"Bottle stores most of the parsed HTTP metadata in :class:`FormsDict` "
-"instances. These behave like normal dictionaries, but have some additional "
-"features: All values in the dictionary are available as attributes. These "
-"virtual attributes always return a unicode string, even if the value is "
-"missing. In that case, the string is empty."
+"**Atribute access**: All values in the dictionary are also accessible as "
+"attributes. These virtual attributes return unicode strings, even if the "
+"value is missing or unicode decoding fails. In that case, the string is "
+"empty, but still present::"
msgstr ""
-"Bottle在 :class:`FormsDict` 类的一个实例里(译者注:参见源码1763行左右),存储"
-"大多数解析后的HTTP元数据。其行为和普通的字典类似,但有一些额外的特性: 所有在"
-"字典中的值都可像访问类的属性那样访问。这类虚拟的属性总是返回一个unicode字符"
-"串,如果缺失该属性,将返回一个空字符串。"
+"Bottle在 :class:`FormsDict` 类的一个实例里,存储大多数解析后的HTTP元数据。其"
+"行为和普通的字典类似,但有一些额外的特性: 所有在字典中的值都可像访问类的属性"
+"那样访问。这类虚拟的属性总是返回一个unicode字符串,如果缺失该属性,将返回一个"
+"空字符串。"
# c6d66b38537f4c93a5aea83e2d90096d
-#: ../../tutorial.rst:493
+#: ../../tutorial.rst:520
msgid ""
-":class:`FormsDict` is a subclass of :class:`MultiDict` and can store more "
-"than one value per key. The standard dictionary access methods will only "
-"return a single value, but the :meth:`MultiDict.getall` method returns a "
-"(possibly empty) list of all values for a specific key."
+"**Multiple values per key:** :class:`FormsDict` is a subclass of :class:"
+"`MultiDict` and can store more than one value per key. The standard "
+"dictionary access methods will only return a single value, but the :meth:"
+"`~MultiDict.getall` method returns a (possibly empty) list of all values for "
+"a specific key::"
msgstr ""
":class:`FormsDict` 类继承自 :class:`MultiDict` 类,一个key可存储多个值。标准"
"的字典访问方法只会返回一个值,但可通过 :meth:`MultiDict.getall` 方法来获取一"
"个包含所有值的list (或许为空)。"
-# 63fcd58f336944cfa419e2abe8ffe4ff
-#: ../../tutorial.rst:495
+# bc6adb59e0714314b37551f7db353571
+#: ../../tutorial.rst:525
msgid ""
-"The full API and feature list is described in the API section (see :class:"
-"`Request`), but the most common use cases and features are covered here, too."
-msgstr "在API的章节,有关于API和特性的完整描述,这里我们只谈常见的用例和特性。"
+"**WTForms support:** Some libraries (e.g. `WTForms <http://wtforms."
+"simplecodes.com/>`_) want all-unicode dictionaries as input. :meth:"
+"`FormsDict.decode` does that for you. It decodes all values and returns a "
+"copy of itself, while preserving multiple values per key and all the other "
+"features."
+msgstr ""
+"**WTForms支持:** 一些第三方库(例如 `WTForms <http://wtforms.simplecodes."
+"com/>`_ )希望输入中的所有字典都是unicode的。 :meth:`FormsDict.decode` 帮你做"
+"了这件事情。它将所有value重新编码,并返回原字典的一个拷贝,同时保留所有特性,"
+"例如一个key对应多个value。"
+
+# 424fca94acab45129e4592ae1c4c5fee
+#: ../../tutorial.rst:529
+msgid ""
+"In **Python 2** all keys and values are byte-strings. If you need unicode, "
+"you can call :meth:`FormsDict.getunicode` or fetch values via attribute "
+"access. Both methods try to decode the string (default: utf8) and return an "
+"empty string if that fails. No need to catch :exc:`UnicodeError`::"
+msgstr ""
+"在 **Python2** 中,所有的key和value都是byte-string。如果你需要unicode,可使"
+"用 :meth:`FormsDict.getunicode` 方法或像访问属性那样访问。这两种方法都试着将"
+"字符串转码(默认: utf8),如果失败,将返回一个空字符串。无需捕获 :exc:"
+"`UnicodeError` 异常。"
+
+# 16daaaa718454e58a8a143d05119bac1
+#: ../../tutorial.rst:536
+msgid ""
+"In **Python 3** all strings are unicode, but HTTP is a byte-based wire "
+"protocol. The server has to decode the byte strings somehow before they are "
+"passed to the application. To be on the safe side, WSGI suggests ISO-8859-1 "
+"(aka latin1), a reversible single-byte codec that can be re-encoded with a "
+"different encoding later. Bottle does that for :meth:`FormsDict.getunicode` "
+"and attribute access, but not for the dict-access methods. These return the "
+"unchanged values as provided by the server implementation, which is probably "
+"not what you want."
+msgstr ""
+"在 **Python3** 中,所有的字符串都是unicode。但HTTP是基于字节的协议,在byte-"
+"string被传给应用之前,服务器必须将其转码。安全起见,WSGI协议建议使用"
+"ISO-8859-1 (即是latin1),一个可反转的单字节编码,可被转换为其他编码。Bottle通"
+"过 :meth:`FormsDict.getunicode` 和属性访问实现了转码,但不支持字典形式的访"
+"问。通过字典形式的访问,将直接返回服务器返回的字符串,未经处理,这或许不是你"
+"想要的。"
+
+# eaa8c0117ce043d3a561cedacf73885d
+#: ../../tutorial.rst:543
+msgid ""
+"If you need the whole dictionary with correctly decoded values (e.g. for "
+"WTForms), you can call :meth:`FormsDict.decode` to get a re-encoded copy."
+msgstr ""
+"如果你整个字典包含正确编码后的值(e.g. for WTForms),可通过 :meth:`FormsDict."
+"decode` 方法来获取一个转码后的拷贝(译者注:一个新的实例)。"
+
+# 8dc1b5cc26104144bb0774207d410442
+#: ../../tutorial.rst:549
+msgid ""
+"Cookies are small pieces of text stored in the clients browser and sent back "
+"to the server with each request. They are useful to keep some state around "
+"for more than one request (HTTP itself is stateless), but should not be used "
+"for security related stuff. They can be easily forged by the client."
+msgstr ""
+"Cookie是客户端浏览器存储的一些文本数据,在每次请求的时候发送回给服务器。"
+"Cookie被用于在多次请求间保留状态信息(HTTP本身是无状态的),但不应该用于保存"
+"安全相关信息。因为客户端很容易伪造Cookie。"
# 7e7760b24bf44ea38c8234dba8b229bd
-#: ../../tutorial.rst:501
+#: ../../tutorial.rst:551
msgid ""
-"Cookies are stored in :attr:`BaseRequest.cookies` as a :class:`FormsDict`. "
-"The :meth:`BaseRequest.get_cookie` method allows access to :ref:`signed "
-"cookies <tutorial-signed-cookies>` as described in a separate section. This "
-"example shows a simple cookie-based view counter::"
+"All cookies sent by the client are available through :attr:`BaseRequest."
+"cookies` (a :class:`FormsDict`). This example shows a simple cookie-based "
+"view counter::"
+msgstr ""
+"可通过 :attr:`BaseRequest.cookies` (一个 :class:`FormsDict`) 来访问所有客户端"
+"发来的Cookie。下面的是一个基于Cookie的访问计数。"
+
+# 7e7760b24bf44ea38c8234dba8b229bd
+#: ../../tutorial.rst:561
+msgid ""
+"The :meth:`BaseRequest.get_cookie` method is a different way do access "
+"cookies. It supports decoding :ref:`signed cookies <tutorial-signed-"
+"cookies>` as described in a separate section."
msgstr ""
"cookie存储在 :attr:`BaseRequest.cookie` 中,是 :class:`FormsDict` 类的一个实"
"例。 :meth:`BaseRequest.get_cookie` 方法提供了对 :ref:`签名cookie <tutorial-"
"signed-cookies>` 的访问。下面是一个基于cookie的计数器例子。"
# 100ecfb0ffa34da8a18ba10859ec5203
-#: ../../tutorial.rst:513
+#: ../../tutorial.rst:564
msgid "HTTP Headers"
msgstr "HTTP头"
# 2883f57c0e824a8a9b8d2213e2ff5cf5
-#: ../../tutorial.rst:515
+#: ../../tutorial.rst:566
msgid ""
"All HTTP headers sent by the client (e.g. ``Referer``, ``Agent`` or ``Accept-"
-"Language``) are stored in a :class:`WSGIHeaderDict` and accessible through :"
-"attr:`BaseRequest.headers`. A :class:`WSGIHeaderDict` is basically a "
-"dictionary with case-insensitive keys::"
+"Language``) are stored in a :class:`WSGIHeaderDict` and accessible through "
+"the :attr:`BaseRequest.headers` attribute. A :class:`WSGIHeaderDict` is "
+"basically a dictionary with case-insensitive keys::"
msgstr ""
"所有发送到客户端的HTTP头(例如 ``Referer``, ``Agent`` 和 ``Accept-Language``)"
"存储在一个 :class:`WSGIHeaderDict` 中,可通过 :attr:`BaseRequest.headers` 访"
-"问。 :class:`WSGIHeaderDict` 是一个字典,其key大小写敏感::"
+"问。 :class:`WSGIHeaderDict` 是一个字典,其key大小写敏感。"
# a04a46af8ede416dbc96fa3067dce003
-#: ../../tutorial.rst:527
+#: ../../tutorial.rst:578
msgid "Query Variables"
msgstr "查询变量"
# 3c909f2249c94ee3b61c99e1ac5d8fa7
-#: ../../tutorial.rst:529
+#: ../../tutorial.rst:580
msgid ""
"The query string (as in ``/forum?id=1&page=5``) is commonly used to transmit "
"a small number of key/value pairs to the server. You can use the :attr:"
-"`BaseRequest.query` (a :class:`FormsDict`) to access these values and the :"
-"attr:`BaseRequest.query_string` attribute to get the whole string."
+"`BaseRequest.query` attribute (a :class:`FormsDict`) to access these values "
+"and the :attr:`BaseRequest.query_string` attribute to get the whole string."
msgstr ""
"查询字符串(例如 ``/forum?id=1&page=5`` 中的 id=5和page=5)一般用于向服务器传输"
"键值对。你可通过 :attr:`BaseRequest.query` ( :class:`FormsDict` 类的实例) 来"
"访问,和通过 :attr:`BaseRequest.query_string` 来获取整个字符串。"
+# 25526928151e427cab403bbea63ec097
+#: ../../tutorial.rst:593
+msgid "HTML `<form>` Handling"
+msgstr "处理HTML的 `<form>` 标签"
+
+# 0c4a8b2fc4ea421bb0d7726d2760fe1d
+#: ../../tutorial.rst:595
+msgid ""
+"Let us start from the beginning. In HTML, a typical ``<form>`` looks "
+"something like this:"
+msgstr "让我们从头开始。在HTML中,一个典型的 ``<form>`` 标签看起来是这样的。"
+
+# 7c5b1ec7c6254562abeca801783f66fb
+#: ../../tutorial.rst:605
+msgid ""
+"The ``action`` attribute specifies the URL that will receive the form data. "
+"``method`` defines the HTTP method to use (``GET`` or ``POST``). With "
+"``method=\"get\"`` the form values are appended to the URL and available "
+"through :attr:`BaseRequest.query` as described above. This is considered "
+"insecure and has other limitations, so we use ``method=\"post\"`` here. If "
+"in doubt, use ``POST`` forms."
+msgstr ""
+"``action`` 属性指定了用于接收表单数据的URL, ``method`` 定义了使用的HTTP方法"
+"( ``GET`` 或 ``POST`` )。如果使用GET方法,表单中的数据会附加到URL后面,可通"
+"过 :attr:`BaseRequest.query` 来访问。这被认为是不安全的,且有其它限制。所以这"
+"里我们使用POST方法。如果有疑惑,就使用 ``POST`` 吧。"
+
+# c4f2495ac4dd45d3bbc265d8a9d002a9
+#: ../../tutorial.rst:607
+msgid ""
+"Form fields transmitted via ``POST`` are stored in :attr:`BaseRequest.forms` "
+"as a :class:`FormsDict`. The server side code may look like this::"
+msgstr ""
+"通过POST方法传输的表单字段,作为一个 :class:`FormsDict` 存储在 :attr:"
+"`BaseRequest.forms` 中。服务器端的代码看起来是这样的。"
+
+# 3632962199094482870c7ba2f03610d6
+#: ../../tutorial.rst:630
+msgid ""
+"There are several other attributes used to access form data. Some of them "
+"combine values from different sources for easier access. The following table "
+"should give you a decent overview."
+msgstr ""
+"有其它一些属性也可以用来访问表单数据。为了方便,一些属性包含了多个来源的数"
+"据。下面的表格可给你一个直观的印象。"
+
+# 65f70c00c85047bf916aa04636146b14
+#: ../../tutorial.rst:633
+msgid "Attribute"
+msgstr ""
+
+# 62ba54597de54af58b7f60aa96fee29a
+#: ../../tutorial.rst:633
+msgid "GET Form fields"
+msgstr ""
+
# 62ba54597de54af58b7f60aa96fee29a
-#: ../../tutorial.rst:542
-msgid "POST Form Data and File Uploads"
+#: ../../tutorial.rst:633
+msgid "POST Form fields"
msgstr "POST表单数据和文件上传"
-# b8a5e3a6ab134eb18f055e27693c5902
-#: ../../tutorial.rst:544
-msgid ""
-"The request body of ``POST`` and ``PUT`` requests may contain form data "
-"encoded in various formats. The :attr:`BaseRequest.forms` dictionary "
-"contains parsed textual form fields, :attr:`BaseRequest.files` stores file "
-"uploads and :attr:`BaseRequest.POST` combines both dictionaries into one. "
-"All three are :class:`FormsDict` instances and are created on demand. File "
-"uploads are saved as special :class:`cgi.FieldStorage` objects along with "
-"some metadata. Finally, you can access the raw body data as a file-like "
-"object via :attr:`BaseRequest.body`."
-msgstr ""
-"通过 ``POST`` 和 ``PUT`` 方式提交的请求也许会包含经过编码的表单数据。 :attr:"
-"`BaseRequest.forms` 字典包含了解析过后的文本字段, :attr:`BaseRequest.files` "
-"字典存储上传的文件, :attr:`BaseRequest.POST` 同时包含两者。这三个都是 :"
-"class:`FormsDict` 类的实例,在你使用它们的时候才会被创建。上传的文件保存为一"
-"个包含其他元数据的 :class:`cgi.FieldStorage` 对象。最后,你可像访问文件一样,"
-"通过 :attr:`BaseRequest.body` 访问未经处理的请求内容。"
-
-# a2b39d82657d485e8f0f5fb4e6096438
-#: ../../tutorial.rst:546
-msgid "Here is an example for a simple file upload form:"
-msgstr "下面是一个简单的文件上传例子。"
+# 62ba54597de54af58b7f60aa96fee29a
+#: ../../tutorial.rst:633
+msgid "File Uploads"
+msgstr ""
-# 53831a3d134a4bcc8b1553ff0e8ef190
-#: ../../tutorial.rst:570
-msgid "Unicode issues"
-msgstr "Unicode的问题"
+# fbb89b2e85a64af5bf161bc80547f380
+#: ../../tutorial.rst:635
+msgid ":attr:`BaseRequest.query`"
+msgstr ""
-# 424fca94acab45129e4592ae1c4c5fee
-#: ../../tutorial.rst:572
+# 3fa195bb296e4164898b421bf4ab5beb
+# c6d6540237ad435093a041f8e4b572fa
+# 62d96ea440a94a76bea224714c15b2e0
+# 125f34a989e74405b622c1b4cc5b9187
+# 8dfdfc246dea4016a058c8ca3280bd17
+# 4128d67e776043cebf97371702197b62
+# 60adb7f041ff490bbd446b0ea9a3d1ad
+# c34b8f3630e84e4ebdfec44f28b10ef2
+#: ../../tutorial.rst:635 ../../tutorial.rst:636 ../../tutorial.rst:637
+#: ../../tutorial.rst:638 ../../tutorial.rst:639 ../../tutorial.rst:640
+msgid "yes"
+msgstr ""
+
+# 240b3fdc10284f7b9f59a74491c83ab3
+# 572c131bbc5642af91df787f99052a9a
+# 92b9d86b3b2449b48eb7a3c321c67fa5
+# 19810dec53b741b2ba22f75f80c0bfb1
+# 3e17dd823315419cab1bef1f88a67ad5
+# 439f7330871b4aaf8397140cf3dd2804
+# 56c8061c0c4043bda4e634c7e76185fc
+# 90bfbc27826a43619a7cf39cc6f4ab1b
+# b3b34c96477e42fc9eab9cbf0239d94e
+# 24bb8d5dda2e436b9f3b007fa342124a
+#: ../../tutorial.rst:635 ../../tutorial.rst:636 ../../tutorial.rst:637
+#: ../../tutorial.rst:638 ../../tutorial.rst:639 ../../tutorial.rst:640
+msgid "no"
+msgstr ""
+
+# 1f5cb4f69ac34c82bc39345f183c3fff
+#: ../../tutorial.rst:636
+msgid ":attr:`BaseRequest.forms`"
+msgstr ""
+
+# 09e1fea933664ebea0954efe295a1184
+#: ../../tutorial.rst:637
+msgid ":attr:`BaseRequest.files`"
+msgstr ""
+
+# 1f5cb4f69ac34c82bc39345f183c3fff
+#: ../../tutorial.rst:638
+msgid ":attr:`BaseRequest.params`"
+msgstr ""
+
+# d6ac10bbc1db4db5aff2ff6fcf62265e
+#: ../../tutorial.rst:639
+msgid ":attr:`BaseRequest.GET`"
+msgstr ""
+
+# d6ac10bbc1db4db5aff2ff6fcf62265e
+#: ../../tutorial.rst:640
+msgid ":attr:`BaseRequest.POST`"
+msgstr ""
+
+# 633e196fad4e4e8298aa83a76d0a7caf
+#: ../../tutorial.rst:645
+msgid "File uploads"
+msgstr "文件上传"
+
+# 6792263598664f43ac6070fef7d4d55f
+#: ../../tutorial.rst:647
msgid ""
-"In **Python 2** all keys and values are byte-strings. If you need unicode, "
-"you can call :meth:`FormsDict.getunicode` or fetch values via attribute "
-"access. Both methods try to decode the string (default: utf8) and return an "
-"empty string if that fails. No need to catch :exc:`UnicodeError`::"
+"To support file uploads, we have to change the ``<form>`` tag a bit. First, "
+"we tell the browser to encode the form data in a different way by adding an "
+"``enctype=\"multipart/form-data\"`` attribute to the ``<form>`` tag. Then, "
+"we add ``<input type=\"file\" />`` tags to allow the user to select a file. "
+"Here is an example:"
msgstr ""
-"在 **Python2** 中,所有的key和value都是byte-string。如果你需要unicode,可使"
-"用 :meth:`FormsDict.getunicode` 方法或像访问属性那样访问。这两种方法都试着将"
-"字符串转码(默认: utf8),如果失败,将返回一个空字符串。无需捕获 :exc:"
-"`UnicodeError` 异常。"
+"为了支持文件上传,我们需要小改一下上面 ``<form>`` 标签,加上 ``enctype="
+"\"multipart/form-data\"`` 属性,告诉浏览器用另一种方式编码表单数据。接下来,"
+"我们添加 ``<input type=\"file\" />`` 标签,让用户可以选择需要上传的文件。例子"
+"如下。"
-# 16daaaa718454e58a8a143d05119bac1
-#: ../../tutorial.rst:579
+# 3c68df7ebfa84e12b277facd8dafc58d
+#: ../../tutorial.rst:657
msgid ""
-"In **Python 3** all strings are unicode, but HTTP is a byte-based wire "
-"protocol. The server has to decode the byte strings somehow before they are "
-"passed to the application. To be on the safe side, WSGI suggests ISO-8859-1 "
-"(aka latin1), a reversible single-byte codec that can be re-encoded with a "
-"different encoding later. Bottle does that for :meth:`FormsDict.getunicode` "
-"and attribute access, but not for the dict-access methods. These return the "
-"unchanged values as provided by the server implementation, which is probably "
-"not what you want."
+"Bottle stores file uploads in :attr:`BaseRequest.files` as :class:"
+"`FileUpload` instances, along with some metadata about the upload. Let us "
+"assume you just want to save the file to disk::"
msgstr ""
-"在 **Python3** 中,所有的字符串都是unicode。但HTTP是基于字节的协议,在byte-"
-"string被传给应用之前,服务器必须将其转码。安全起见,WSGI协议建议使用"
-"ISO-8859-1 (即是latin1),一个可反转的单字节编码,可被转换为其他编码。Bottle通"
-"过 :meth:`FormsDict.getunicode` 和属性访问实现了转码,但不支持字典形式的访"
-"问。通过字典形式的访问,将直接返回服务器返回的字符串,未经处理,这或许不是你"
-"想要的。"
+"Bottle将上传的文件当做一个 :class:`FileUpload` 实例存储在 :attr:`BaseRequest."
+"files` 中,伴随着一些这次上传的元数据。我们假设你仅是想把上传的文件保存到磁盘"
+"中。"
-# eaa8c0117ce043d3a561cedacf73885d
-#: ../../tutorial.rst:586
+# 3a1c322545d341d7b32789db4fe0e9ef
+#: ../../tutorial.rst:671
msgid ""
-"If you need the whole dictionary with correctly decoded values (e.g. for "
-"WTForms), you can call :meth:`FormsDict.decode` to get a re-encoded copy."
+":attr:`FileUpload.filename` contains the name of the file on the clients "
+"file system, but is cleaned up and normalized to prevent bugs caused by "
+"unsupported characters or path segments in the filename. If you need the "
+"unmodified name as send by the client, have a look at :attr:`FileUpload."
+"raw_filename`."
msgstr ""
-"如果你整个字典包含正确编码后的值(e.g. for WTForms),可通过 :meth:`FormsDict."
-"decode` 方法来获取一个转码后的拷贝(译者注:一个新的实例)。"
+":attr:`FileUpload.filename` 包含客户端传上来的文件的文件名,但为了防止异常字"
+"符带来的bug,这里的文件名已经被处理过。如果你需要未经改动的文件名,看看 :"
+"attr:`FileUpload.raw_filename` 。"
+
+# 0edcb379b65c4a3da31b48439db2d3ec
+#: ../../tutorial.rst:673
+msgid ""
+"The :attr:`FileUpload.save` method is highly recommended if you want to "
+"store the file to disk. It prevents some common errors (e.g. it does not "
+"overwrite existing files unless you tell it to) and stores the file in a "
+"memory efficient way. You can access the file object directly via :attr:"
+"`FileUpload.file`. Just be careful."
+msgstr ""
+"如果你想将文件保存到磁盘,强烈建议你使用 :attr:`FileUpload.save` 方法。它避免"
+"了一些常见的错误(例如,它不会覆盖已经存在的文件,除非你告诉它可以覆盖),并"
+"且更有效地使用内存。你可以通过 :attr:`FileUpload.file` 来直接访问文件对象,但"
+"是要谨慎。"
# 00ebd6fbc91944adbb2f8ed5eba530c9
-#: ../../tutorial.rst:590
+#: ../../tutorial.rst:677
+msgid "JSON Content"
+msgstr "JSON内容"
+
+# 2b4bc0434c3647aab955774d47087a57
+#: ../../tutorial.rst:679
+msgid ""
+"Some JavaScript or REST clients send ``application/json`` content to the "
+"server. The :attr:`BaseRequest.json` attribute contains the parsed data "
+"structure, if available."
+msgstr ""
+"一些JavaScript或支持REST的客户端会发送 ``application/json`` 内容给服务器。如"
+"果可用(合法的JSON), :attr:`BaseRequest.json` 会包含解析后的数据结构。"
+
+# 04eb97e955474ed785db0dc3ef77ad21
+#: ../../tutorial.rst:683
+msgid "The raw request body"
+msgstr "原始的请求数据"
+
+# 1cc8541629fd442d829484ac6676626a
+#: ../../tutorial.rst:685
+msgid ""
+"You can access the raw body data as a file-like object via :attr:"
+"`BaseRequest.body`. This is a :class:`BytesIO` buffer or a temporary file "
+"depending on the content length and :attr:`BaseRequest.MEMFILE_MAX` setting. "
+"In both cases the body is completely buffered before you can access the "
+"attribute. If you expect huge amounts of data and want to get direct "
+"unbuffered access to the stream, have a look at ``request['wsgi.input']``."
+msgstr ""
+"你可以把 :attr:`BaseRequest.body` 当做一个file-like 对象来访问。根据内容的长"
+"度,以及 :attr:`BaseRequest.MEMFILE_MAX` 中的设置,它可以是一个 :class:"
+"`BytesIO` 缓存或一个磁盘上的临时文件。无论如何,它都是被缓存的。如果你无需缓"
+"存,想直接访问文件流,可看看 ``request['wsgi.input']`` 。"
+
+# 00ebd6fbc91944adbb2f8ed5eba530c9
+#: ../../tutorial.rst:690
msgid "WSGI Environment"
msgstr "WSGI环境"
# 02742224d5ad42bb8ff01b10de6ab5e7
-#: ../../tutorial.rst:592
+#: ../../tutorial.rst:692
msgid ""
"Each :class:`BaseRequest` instance wraps a WSGI environment dictionary. The "
"original is stored in :attr:`BaseRequest.environ`, but the request object "
@@ -1238,12 +1506,12 @@ msgstr ""
"specification>`_ ,可以这样做::"
# c12824d94b3a4fbdbcaebc6618897d10
-#: ../../tutorial.rst:610
+#: ../../tutorial.rst:710
msgid "Templates"
msgstr "模板"
# 3ee2e726eac14d9c994dde9fdaee5b39
-#: ../../tutorial.rst:612
+#: ../../tutorial.rst:712
msgid ""
"Bottle comes with a fast and powerful built-in template engine called :doc:"
"`stpl`. To render a template you can use the :func:`template` function or "
@@ -1256,7 +1524,7 @@ msgstr ""
"给模板的变量。下面是一个渲染模板的简单例子::"
# a262870d7851494299ca7357419668b0
-#: ../../tutorial.rst:619
+#: ../../tutorial.rst:719
msgid ""
"This will load the template file ``hello_template.tpl`` and render it with "
"the ``name`` variable set. Bottle will look for templates in the ``./views/"
@@ -1267,7 +1535,7 @@ msgstr ""
"TEMPLATE_PATH`` 这个列表中添加更多的模板路径。"
# ed78b45085864fe7b5a0f6f708355177
-#: ../../tutorial.rst:621
+#: ../../tutorial.rst:721
msgid ""
"The :func:`view` decorator allows you to return a dictionary with the "
"template variables instead of calling :func:`template`::"
@@ -1276,12 +1544,12 @@ msgstr ""
"func:`template` 函数做同样的事情。"
# 99ab9dcde99e4d43a3990c3ad34f5c59
-#: ../../tutorial.rst:630
+#: ../../tutorial.rst:730
msgid "Syntax"
msgstr "语法"
# 09cd302595e74ff8b713bc4f8bd96577
-#: ../../tutorial.rst:633
+#: ../../tutorial.rst:733
msgid ""
"The template syntax is a very thin layer around the Python language. Its "
"main purpose is to ensure correct indentation of blocks, so you can format "
@@ -1292,17 +1560,17 @@ msgstr ""
"需担心会出现缩进问题。详细的语法描述可看 :doc:`stpl` 。"
# 6bba819ce04040a7a4075b08513d3914
-#: ../../tutorial.rst:635
+#: ../../tutorial.rst:735
msgid "Here is an example template::"
msgstr "简单的模板例子::"
# f4e568a17e6e4a029d785713c1c10e4f
-#: ../../tutorial.rst:646
+#: ../../tutorial.rst:746
msgid "Caching"
msgstr "缓存"
# 6abf5d3fe8704e84a667b3f7b35a92fb
-#: ../../tutorial.rst:647
+#: ../../tutorial.rst:747
msgid ""
"Templates are cached in memory after compilation. Modifications made to the "
"template files will have no affect until you clear the template cache. Call "
@@ -1313,12 +1581,12 @@ msgstr ""
"需手动清除缓存。"
# a23c78bf8a2a4f27925d654bed8a8bb5
-#: ../../tutorial.rst:657
+#: ../../tutorial.rst:757
msgid "Plugins"
msgstr "插件"
# 88060d08b1a949b898df6761368281fe
-#: ../../tutorial.rst:661
+#: ../../tutorial.rst:761
msgid ""
"Bottle's core features cover most common use-cases, but as a micro-framework "
"it has its limits. This is where \"Plugins\" come into play. Plugins add "
@@ -1330,7 +1598,7 @@ msgstr ""
"自动化一些重复性的工作。"
# 38149a02d0a5465da9a9852e284a4f28
-#: ../../tutorial.rst:663
+#: ../../tutorial.rst:763
msgid ""
"We have a growing :doc:`/plugins/index` and most plugins are designed to be "
"portable and re-usable across applications. The chances are high that your "
@@ -1342,7 +1610,7 @@ msgstr ""
"有现成的插件, :doc:`/plugindev` 有介绍如何开发一个插件。"
# f2e682f4d04b4b8ebc16edcb8caf47a4
-#: ../../tutorial.rst:665
+#: ../../tutorial.rst:765
msgid ""
"The effects and APIs of plugins are manifold and depend on the specific "
"plugin. The ``SQLitePlugin`` plugin for example detects callbacks that "
@@ -1355,7 +1623,7 @@ msgstr ""
"使用数据库就非常简单了。"
# 8ba3a92375604cd1bc2c55e8fe88b7c6
-#: ../../tutorial.rst:685
+#: ../../tutorial.rst:785
msgid ""
"Other plugin may populate the thread-safe :data:`local` object, change "
"details of the :data:`request` object, filter the data returned by the "
@@ -1370,12 +1638,12 @@ msgstr ""
"的。"
# 9679a5cc51d944af9e76e1e461c73a0b
-#: ../../tutorial.rst:689
+#: ../../tutorial.rst:789
msgid "Application-wide Installation"
msgstr "整个应用的范围内安装插件"
# 216747200f3146418ab3633e0f2e1e13
-#: ../../tutorial.rst:691
+#: ../../tutorial.rst:791
msgid ""
"Plugins can be installed application-wide or just to some specific routes "
"that need additional functionality. Most plugins can safely be installed to "
@@ -1386,7 +1654,7 @@ msgstr ""
"地安装给所有route,也足够智能,可忽略那些并不需要它们的route。"
# 9764f2ecd5594b57b040ec177c1460da
-#: ../../tutorial.rst:693
+#: ../../tutorial.rst:793
msgid ""
"Let us take the ``SQLitePlugin`` plugin for example. It only affects route "
"callbacks that need a database connection. Other routes are left alone. "
@@ -1397,14 +1665,14 @@ msgstr ""
"它route都被忽略了。正因为如此,我们可以放心地在整个应用的范围内安装这个插件。"
# ffcfd7ecba4841939dade7327353c8dc
-#: ../../tutorial.rst:695
+#: ../../tutorial.rst:795
msgid ""
"To install a plugin, just call :func:`install` with the plugin as first "
"argument::"
msgstr "调用 :func:`install` 函数来安装一个插件::"
# 43812d9787b84f90a4a0102fd4a48431
-#: ../../tutorial.rst:700
+#: ../../tutorial.rst:800
msgid ""
"The plugin is not applied to the route callbacks yet. This is delayed to "
"make sure no routes are missed. You can install plugins first and add routes "
@@ -1417,19 +1685,19 @@ msgstr ""
"数据库,那么你就需要先安装操作数据库的插件。"
# a24315f350254ca1b76d8cef343326c3
-#: ../../tutorial.rst:704
+#: ../../tutorial.rst:804
msgid "Uninstall Plugins"
msgstr "卸载插件"
# 74aefe2ba5704f2d86ec09a12d1e8c93
-#: ../../tutorial.rst:705
+#: ../../tutorial.rst:805
msgid ""
"You can use a name, class or instance to :func:`uninstall` a previously "
"installed plugin::"
msgstr "调用 :func:`uninstall` 函数来卸载已经安装的插件"
# a8e7d4f099d1483d9e837c9ebae15229
-#: ../../tutorial.rst:715
+#: ../../tutorial.rst:815
msgid ""
"Plugins can be installed and removed at any time, even at runtime while "
"serving requests. This enables some neat tricks (installing slow debugging "
@@ -1443,7 +1711,7 @@ msgstr ""
"载。"
# d653b077c8cd432b9dea61f859deaf2a
-#: ../../tutorial.rst:718
+#: ../../tutorial.rst:818
msgid ""
"The module-level :func:`install` and :func:`uninstall` functions affect the :"
"ref:`default-app`. To manage plugins for a specific application, use the "
@@ -1453,24 +1721,24 @@ msgstr ""
"app` 。针对应用来管理插件,可使用 :class:`Bottle` 应用对象的相应方法。"
# 243f252439a14fd980528d11dc2a5ef3
-#: ../../tutorial.rst:722
+#: ../../tutorial.rst:822
msgid "Route-specific Installation"
msgstr "安装给特定的route"
# 838aae12dff54ecca70e4b9929c377a7
-#: ../../tutorial.rst:724
+#: ../../tutorial.rst:824
msgid ""
"The ``apply`` parameter of the :func:`route` decorator comes in handy if you "
"want to install plugins to only a small number of routes::"
msgstr ":func:`route` 修饰器的 ``apply`` 参数可以给指定的route安装插件"
# 9a84759774fe4f40a9ca78198ee213a5
-#: ../../tutorial.rst:734
+#: ../../tutorial.rst:834
msgid "Blacklisting Plugins"
msgstr "插件黑名单"
# 6a0ab06186804e1d8bbe63a231a7c5d0
-#: ../../tutorial.rst:736
+#: ../../tutorial.rst:836
msgid ""
"You may want to explicitly disable a plugin for a number of routes. The :"
"func:`route` decorator has a ``skip`` parameter for this purpose::"
@@ -1479,7 +1747,7 @@ msgstr ""
"``skip`` 参数::"
# 4f2c00ad89e74770be416ad7bbae1bee
-#: ../../tutorial.rst:750
+#: ../../tutorial.rst:850
msgid ""
"The ``skip`` parameter accepts a single value or a list of values. You can "
"use a name, class or instance to identify the plugin that is to be skipped. "
@@ -1489,12 +1757,12 @@ msgstr ""
"要禁用的插件。如果 ``skip`` 的值为True,则禁用所有插件。"
# d87dd978a89d43868cb463a1a2190830
-#: ../../tutorial.rst:753
+#: ../../tutorial.rst:853
msgid "Plugins and Sub-Applications"
msgstr "插件和子应用"
# 3d4b2c7941c849f7909c988ec94594b9
-#: ../../tutorial.rst:755
+#: ../../tutorial.rst:855
msgid ""
"Most plugins are specific to the application they were installed to. "
"Consequently, they should not affect sub-applications mounted with :meth:"
@@ -1504,7 +1772,7 @@ msgstr ""
"mount` 方法挂载上来的子应用。这里有一个例子。"
# 4b73aeba0920406595cca49309022d40
-#: ../../tutorial.rst:766
+#: ../../tutorial.rst:866
msgid ""
"Whenever you mount an application, Bottle creates a proxy-route on the main-"
"application that forwards all requests to the sub-application. Plugins are "
@@ -1517,7 +1785,7 @@ msgstr ""
"了 ``/contact`` route,但不会影响挂载在root上面的 ``/blog`` 。"
# b7358bc6de3141de8ee22c6f437c05e2
-#: ../../tutorial.rst:768
+#: ../../tutorial.rst:868
msgid ""
"This behavior is intended as a sane default, but can be overridden. The "
"following example re-activates all plugins for a specific proxy-route::"
@@ -1526,7 +1794,7 @@ msgstr ""
"件。"
# e3e8120e6e2f4f0caa98e2facc17f5f9
-#: ../../tutorial.rst:772
+#: ../../tutorial.rst:872
msgid ""
"But there is a snag: The plugin sees the whole sub-application as a single "
"route, namely the proxy-route mentioned above. In order to affect each "
@@ -1538,12 +1806,12 @@ msgstr ""
"件。"
# 6a3062e368f74a49bcd5a9aee9c27f1d
-#: ../../tutorial.rst:777
+#: ../../tutorial.rst:877
msgid "Development"
msgstr "开发"
# f171d35ca9c640958adf39b6600ef7d1
-#: ../../tutorial.rst:779
+#: ../../tutorial.rst:879
msgid ""
"So you have learned the basics and want to write your own application? Here "
"are some tips that might help you to be more productive."
@@ -1552,12 +1820,12 @@ msgstr ""
"巧可提高你的生产力。"
# f08de7bd8585473ba505d5471a1f4b95
-#: ../../tutorial.rst:785
+#: ../../tutorial.rst:885
msgid "Default Application"
msgstr "默认应用"
# b08fcbe75c2740baa96374ade2061c40
-#: ../../tutorial.rst:787
+#: ../../tutorial.rst:887
msgid ""
"Bottle maintains a global stack of :class:`Bottle` instances and uses the "
"top of the stack as a default for some of the module-level functions and "
@@ -1569,7 +1837,7 @@ msgstr ""
"meth:`Bottle.route` 方法。"
# 8115e9c107c64e50a46fa7dbbcebafd8
-#: ../../tutorial.rst:793
+#: ../../tutorial.rst:893
msgid ""
"This is very convenient for small applications and saves you some typing, "
"but also means that, as soon as your module is imported, routes are "
@@ -1581,7 +1849,7 @@ msgstr ""
"作用,Bottle提供了另外一种方法,显式地管理应用。"
# 564c8e3eee454f6e99c594739eadda07
-#: ../../tutorial.rst:801
+#: ../../tutorial.rst:901
msgid ""
"Separating the application object improves re-usability a lot, too. Other "
"developers can safely import the ``app`` object from your module and use :"
@@ -1591,7 +1859,7 @@ msgstr ""
"对象,然后通过 :meth:`Bottle.mount` 方法来合并到其它应用中。"
# 8d144a16824c4b9badfac96807f984a3
-#: ../../tutorial.rst:803
+#: ../../tutorial.rst:903
msgid ""
"As an alternative, you can make use of the application stack to isolate your "
"routes while still using the convenient shortcuts::"
@@ -1600,7 +1868,7 @@ msgstr ""
"器。"
# de0c34efbab94c38be0a30cdce342f7a
-#: ../../tutorial.rst:813
+#: ../../tutorial.rst:913
msgid ""
"Both :func:`app` and :func:`default_app` are instance of :class:`AppStack` "
"and implement a stack-like API. You can push and pop applications from and "
@@ -1612,17 +1880,17 @@ msgstr ""
"导入一个第三方模块,但它不提供一个独立的应用对象的时候,尤其有用。"
# ba511473ecbf415392b54d39a5b0f8fa
-#: ../../tutorial.rst:826
+#: ../../tutorial.rst:926
msgid "Debug Mode"
msgstr "调试模式"
# beddc97c3d3a46128d1d358fa9860a4f
-#: ../../tutorial.rst:828
+#: ../../tutorial.rst:928
msgid "During early development, the debug mode can be very helpful."
msgstr "在开发的早期阶段,调试模式非常有用。"
# 4d067f735f6849c69b69f7092ced9f3d
-#: ../../tutorial.rst:836
+#: ../../tutorial.rst:936
msgid ""
"In this mode, Bottle is much more verbose and provides helpful debugging "
"information whenever an error occurs. It also disables some optimisations "
@@ -1633,37 +1901,37 @@ msgstr ""
"妨碍你的优化措施,检查你的错误设置。"
# 88a7c01d66fa4d00a6179489511b3c08
-#: ../../tutorial.rst:838
+#: ../../tutorial.rst:938
msgid "Here is an incomplete list of things that change in debug mode:"
msgstr "下面是调试模式下会发生改变的东西,但这份列表不完整:"
# f198b02a8b9e4bcba922758c41b795a0
-#: ../../tutorial.rst:840
+#: ../../tutorial.rst:940
msgid "The default error page shows a traceback."
msgstr "默认的错误页面会打印出运行栈。"
# 0c8afe5235804e03ba1bfbb6eb3345a9
-#: ../../tutorial.rst:841
+#: ../../tutorial.rst:941
msgid "Templates are not cached."
msgstr "模板不会被缓存。"
# c606f72bfa8d4612baecaa76fa2c6a03
-#: ../../tutorial.rst:842
+#: ../../tutorial.rst:942
msgid "Plugins are applied immediately."
msgstr "插件马上生效。"
# 36c92c3f00344262bb9ec61582c0a45a
-#: ../../tutorial.rst:844
+#: ../../tutorial.rst:944
msgid "Just make sure not to use the debug mode on a production server."
msgstr "请确保不要在生产环境中使用调试模式。"
# 633e196fad4e4e8298aa83a76d0a7caf
-#: ../../tutorial.rst:847
+#: ../../tutorial.rst:947
msgid "Auto Reloading"
msgstr "自动加载"
# 06cefa78a7b0460db417d659b6de9d0c
-#: ../../tutorial.rst:849
+#: ../../tutorial.rst:949
msgid ""
"During development, you have to restart the server a lot to test your recent "
"changes. The auto reloader can do this for you. Every time you edit a module "
@@ -1675,7 +1943,7 @@ msgstr ""
"代码。"
# e1789e3508fc4464bc48179d68195f5d
-#: ../../tutorial.rst:859
+#: ../../tutorial.rst:959
msgid ""
"How it works: the main process will not start a server, but spawn a new "
"child process using the same command line arguments used to start the main "
@@ -1685,7 +1953,7 @@ msgstr ""
"启动服务器。请注意,所有模块级别的代码都被执行了至少两次。"
# 0371ddb9c20e4305af0b378bd25be6a5
-#: ../../tutorial.rst:864
+#: ../../tutorial.rst:964
msgid ""
"The child process will have ``os.environ['BOTTLE_CHILD']`` set to ``True`` "
"and start as a normal non-reloading app server. As soon as any of the loaded "
@@ -1698,7 +1966,7 @@ msgstr ""
"程。更改模板文件不会触发自动重载,请使用debug模式来禁用模板缓存。"
# a0aa2201b61c42e98e5ee42ef24c4190
-#: ../../tutorial.rst:870
+#: ../../tutorial.rst:970
msgid ""
"The reloading depends on the ability to stop the child process. If you are "
"running on Windows or any other operating system not supporting ``signal."
@@ -1712,17 +1980,17 @@ msgstr ""
"不会被执行。"
# f8ff70c41030429b97bbe90c183aa69d
-#: ../../tutorial.rst:878
+#: ../../tutorial.rst:978
msgid "Command Line Interface"
msgstr "命令行接口"
# fffbd64ca6b24cbfaa416c3041d9e0b1
-#: ../../tutorial.rst:882
+#: ../../tutorial.rst:982
msgid "Starting with version 0.10 you can use bottle as a command-line tool:"
msgstr "从0.10版本开始,你可像一个命令行工具那样使用Bottle:"
# a8137a8b8a854600add6c7567b68a739
-#: ../../tutorial.rst:902
+#: ../../tutorial.rst:1002
msgid ""
"The `ADDRESS` field takes an IP address or an IP:PORT pair and defaults to "
"``localhost:8080``. The other parameters should be self-explanatory."
@@ -1731,7 +1999,7 @@ msgstr ""
"都很好地自我解释了。"
# 228d8cb4991f41f4b4d8b33ccde95c44
-#: ../../tutorial.rst:904
+#: ../../tutorial.rst:1004
msgid ""
"Both plugins and applications are specified via import expressions. These "
"consist of an import path (e.g. ``package.module``) and an expression to be "
@@ -1743,12 +2011,12 @@ msgstr ""
"详见 :func:`load` 。"
# 3311bcf9b73946988bec85594383ecc6
-#: ../../tutorial.rst:925
+#: ../../tutorial.rst:1025
msgid "Deployment"
msgstr "部署"
# 2af7083bba10428a97d840be3af4a90f
-#: ../../tutorial.rst:927
+#: ../../tutorial.rst:1027
msgid ""
"Bottle runs on the built-in `wsgiref WSGIServer <http://docs.python.org/"
"library/wsgiref.html#module-wsgiref.simple_server>`_ by default. This non-"
@@ -1761,7 +2029,7 @@ msgstr ""
"发的时候特别有用,但其性能低下,在服务器负载不断增加的时候也许会是性能瓶颈。"
# 3b8f093cb75247ba98703d3f6a53b38e
-#: ../../tutorial.rst:929
+#: ../../tutorial.rst:1029
msgid ""
"The easiest way to increase performance is to install a multi-threaded "
"server library like paste_ or cherrypy_ and tell Bottle to use that instead "
@@ -1769,19 +2037,19 @@ msgid ""
msgstr "最早的解决办法是让Bottle使用 paste_ 或 cherrypy_ 等多线程的服务器。"
# 2dab1b2ba89e4d33992277160d0591bf
-#: ../../tutorial.rst:933
+#: ../../tutorial.rst:1033
msgid ""
"This, and many other deployment options are described in a separate "
"article: :doc:`deployment`"
msgstr "在 :doc:`deployment` 章节中,会介绍更多部署的选择。"
# f6100b0c14874bf28a2fe2009fae3846
-#: ../../tutorial.rst:941
+#: ../../tutorial.rst:1041
msgid "Glossary"
msgstr "词汇表"
# c6dd388daca143bfbebc280aeb9ea3f2
-#: ../../tutorial.rst:946
+#: ../../tutorial.rst:1046
msgid ""
"Programmer code that is to be called when some external action happens. In "
"the context of web frameworks, the mapping between URL paths and application "
@@ -1789,7 +2057,7 @@ msgid ""
msgstr ""
# bea77197d67b495893c30d13330807de
-#: ../../tutorial.rst:952
+#: ../../tutorial.rst:1052
msgid ""
"A function returning another function, usually applied as a function "
"transformation using the ``@decorator`` syntax. See `python documentation "
@@ -1798,7 +2066,7 @@ msgid ""
msgstr ""
# 4e70beaf89764630a38c322f4ae47a54
-#: ../../tutorial.rst:955
+#: ../../tutorial.rst:1055
msgid ""
"A structure where information about all documents under the root is saved, "
"and used for cross-referencing. The environment is pickled after the "
@@ -1807,7 +2075,7 @@ msgid ""
msgstr ""
# b7f08dcc64534616abcba37e70692e71
-#: ../../tutorial.rst:961
+#: ../../tutorial.rst:1061
msgid ""
"A function to handle some specific event or situation. In a web framework, "
"the application is developed by attaching a handler function as callback for "
@@ -1815,7 +2083,7 @@ msgid ""
msgstr ""
# 1693168184a043dc8b28ea6fc35aa2aa
-#: ../../tutorial.rst:966
+#: ../../tutorial.rst:1066
msgid ""
"The directory which, including its subdirectories, contains all source files "
"for one Sphinx project."