Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df6068d

Browse files
[po] auto sync
1 parent 30919ba commit df6068d

2 files changed

Lines changed: 51 additions & 16 deletions

File tree

extending/embedding.po

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ msgstr ""
212212

213213
#: ../../extending/embedding.rst:141
214214
msgid "The code to run a function defined in a Python script is:"
215-
msgstr ""
215+
msgstr "要运行 Python 脚本中定义的函数,代码如下:"
216216

217217
#: ../../extending/embedding.rst:146
218218
msgid ""
@@ -245,6 +245,8 @@ msgid ""
245245
"argument, which is constructed using the :c:func:`PyUnicode_FromString` data"
246246
" conversion routine. ::"
247247
msgstr ""
248+
"初始化解释器之后,则用 :c:func:`PyImport_Import` 加载脚本。此函数的参数需是个 Python 字符串,一个用 "
249+
":c:func:`PyUnicode_FromString` 数据转换函数构建的字符串。"
248250

249251
#: ../../extending/embedding.rst:191
250252
msgid ""
@@ -254,17 +256,20 @@ msgid ""
254256
"program then proceeds by constructing a tuple of arguments as normal. The "
255257
"call to the Python function is then made with::"
256258
msgstr ""
259+
"脚本一旦加载完毕,就会用 :c:func:`PyObject_GetAttrString` "
260+
"查找属性名称。如果名称存在,并且返回的是可调用对象,即可安全地视其为函数。然后程序继续执行,照常构建由参数组成的元组。然后用以下方式调用 Python "
261+
"函数:"
257262

258263
#: ../../extending/embedding.rst:199
259264
msgid ""
260265
"Upon return of the function, ``pValue`` is either ``NULL`` or it contains a "
261266
"reference to the return value of the function. Be sure to release the "
262267
"reference after examining the value."
263-
msgstr ""
268+
msgstr "当函数返回时,``pValue`` 要么为 ``NULL``,要么包含对函数返回值的引用。请确保用完后释放该引用。"
264269

265270
#: ../../extending/embedding.rst:207
266271
msgid "Extending Embedded Python"
267-
msgstr ""
272+
msgstr "对嵌入 Python 功能进行扩展"
268273

269274
#: ../../extending/embedding.rst:209
270275
msgid ""
@@ -277,25 +282,30 @@ msgid ""
277282
"and write some glue code that gives Python access to those routines, just "
278283
"like you would write a normal Python extension. For example::"
279284
msgstr ""
285+
"到目前为止,嵌入的 Python 解释器还不能访问应用程序本身的功能。Python API 通过扩展嵌入解释器实现了这一点。 "
286+
"也就是说,用应用程序提供的函数对嵌入的解释器进行扩展。虽然听起来有些复杂,但也没那么糟糕。只要暂时忘记是应用程序启动了 Python "
287+
"解释器。而把应用程序看作是一堆子程序,然后写一些胶水代码让 Python 访问这些子程序,就像编写普通的 Python 扩展程序一样。 例如:"
280288

281289
#: ../../extending/embedding.rst:246
282290
msgid ""
283291
"Insert the above code just above the :c:func:`main` function. Also, insert "
284292
"the following two statements before the call to :c:func:`Py_Initialize`::"
285-
msgstr ""
293+
msgstr "在 :c:func:`main` 函数之前插入上述代码。并在调用 :c:func:`Py_Initialize` 之前插入以下两条语句:"
286294

287295
#: ../../extending/embedding.rst:252
288296
msgid ""
289297
"These two lines initialize the ``numargs`` variable, and make the "
290298
":func:`emb.numargs` function accessible to the embedded Python interpreter. "
291299
"With these extensions, the Python script can do things like"
292300
msgstr ""
301+
"这两行代码初始化了 ``numargs`` 变量,并让 :func:`emb.numargs` 函数能被嵌入的 Python "
302+
"解释器访问到。有了这些扩展,Python 脚本可以执行类似以下功能:"
293303

294304
#: ../../extending/embedding.rst:261
295305
msgid ""
296306
"In a real application, the methods will expose an API of the application to "
297307
"Python."
298-
msgstr ""
308+
msgstr "在真实的应用程序中,这种方法将把应用的 API 暴露给 Python 使用。"
299309

300310
#: ../../extending/embedding.rst:271
301311
msgid "Embedding Python in C++"
@@ -309,6 +319,8 @@ msgid ""
309319
"and link your program. There is no need to recompile Python itself using "
310320
"C++."
311321
msgstr ""
322+
"还可以将 Python 嵌入到 C++ 程序中去;确切地说,实现方式将取决于 C++ 系统的实现细节;一般需用 C++ 编写主程序,并用 C++ "
323+
"编译器来编译和链接 程序。不需要用 C++ 重新编译 Python 本身。"
312324

313325
#: ../../extending/embedding.rst:282
314326
msgid "Compiling and Linking under Unix-like systems"
@@ -321,6 +333,8 @@ msgid ""
321333
"application, particularly because Python needs to load library modules "
322334
"implemented as C dynamic extensions (:file:`.so` files) linked against it."
323335
msgstr ""
336+
"为了将 Python 解释器嵌入应用程序,找到正确的编译参数传给编译器 (和链接器) 并非易事,特别是因为 Python 加载的库模块是以 C "
337+
"动态扩展(:file:`.so` 文件)的形式实现的。"
324338

325339
#: ../../extending/embedding.rst:290
326340
msgid ""
@@ -330,18 +344,20 @@ msgid ""
330344
"available). This script has several options, of which the following will be"
331345
" directly useful to you:"
332346
msgstr ""
347+
"为了得到所需的编译器和链接器参数,可执行 :file:`python{X.Y}-config` 脚本,它是在安装 Python 时生成的(也可能存在 "
348+
":file:`python3-config` 脚本)。该脚本有几个参数,其中以下几个参数会直接有用:"
333349

334350
#: ../../extending/embedding.rst:296
335351
msgid ""
336352
"``pythonX.Y-config --cflags`` will give you the recommended flags when "
337353
"compiling:"
338-
msgstr ""
354+
msgstr "``pythonX.Y-config --cflags`` 将给出建议的编译参数。"
339355

340356
#: ../../extending/embedding.rst:304
341357
msgid ""
342358
"``pythonX.Y-config --ldflags`` will give you the recommended flags when "
343359
"linking:"
344-
msgstr ""
360+
msgstr "``pythonX.Y-config --ldflags`` 将给出建议的链接参数。"
345361

346362
#: ../../extending/embedding.rst:313
347363
msgid ""
@@ -350,6 +366,8 @@ msgid ""
350366
"that you use the absolute path to :file:`python{X.Y}-config`, as in the "
351367
"above example."
352368
msgstr ""
369+
"为了避免多个 Python 安装版本引发混乱(特别是在系统安装版本和自己编译版本之间),建议用 :file:`python{X.Y}-config` "
370+
"指定绝对路径,如上例所述。"
353371

354372
#: ../../extending/embedding.rst:318
355373
msgid ""
@@ -362,3 +380,7 @@ msgid ""
362380
"tool to programmatically extract the configuration values that you will want"
363381
" to combine together. For example:"
364382
msgstr ""
383+
"如果上述方案不起作用(不能保证对所有 Unix 类平台都生效;欢迎提出 :ref:`bug 报告<reporting-"
384+
"bugs>`),就得阅读系统关于动态链接的文档,并检查 Python 的 :file:`Makefile` (用 "
385+
":func:`sysconfig.get_makefile_filename` 找到所在位置)和编译参数。这时 :mod:`sysconfig` "
386+
"模块会是个有用的工具,可用编程方式提取需组合在一起的配置值。比如:"

library/imaplib.po

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,13 @@ msgstr ""
236236

237237
#: ../../library/imaplib.rst:174
238238
msgid "IMAP4 Objects"
239-
msgstr ""
239+
msgstr "IMAP4 对象"
240240

241241
#: ../../library/imaplib.rst:176
242242
msgid ""
243243
"All IMAP4rev1 commands are represented by methods of the same name, either "
244244
"upper-case or lower-case."
245-
msgstr ""
245+
msgstr "所有 IMAP4rev1 命令都表示为同名的方法,可以为大写或小写形式。"
246246

247247
#: ../../library/imaplib.rst:179
248248
msgid ""
@@ -255,6 +255,10 @@ msgid ""
255255
"(eg: the *flags* argument to ``STORE``) then enclose the string in "
256256
"parentheses (eg: ``r'(\\Deleted)'``)."
257257
msgstr ""
258+
"命令的所有参数都会被转换为字符串,只有 ``AUTHENTICATE`` 例外,而, and the last argument to "
259+
"``APPEND`` 的最后一个参数会被作为 IMAP4 字面值传入。 如有必要 (字符串包含 IMAP4 协议中的敏感字符并且未加圆括号或双引号) "
260+
"每个字符串都会被转码。 但是,``LOGIN`` 命令的 *password* 参数总是会被转码。 如果你想让某个参数字符串免于被转码 (例如: "
261+
"``STORE`` 的 *flags* 参数) 则要为该字符串加上圆括号 (例如: ``r'(\\Deleted)'``)。"
258262

259263
#: ../../library/imaplib.rst:187
260264
msgid ""
@@ -264,6 +268,9 @@ msgid ""
264268
"``bytes``, or a tuple. If a tuple, then the first part is the header of the "
265269
"response, and the second part contains the data (ie: 'literal' value)."
266270
msgstr ""
271+
"每条命令均返回一个元组: ``(type, [data, ...])`` 其中 *type* 通常为 ``'OK'`` 或 ``'NO'``,而 "
272+
"*data* 为来自命令响应的文本,或为来自命令的规定结果。 每个 *data* 均为 ``bytes`` 或者元组。 "
273+
"如果为元组,则其第一部分是响应的标头,而第二部分将包含数据 (例如: 'literal' 值)。"
267274

268275
#: ../../library/imaplib.rst:193
269276
msgid ""
@@ -273,29 +280,33 @@ msgid ""
273280
"contiguous ranges separated by commas (``'1:3,6:9'``). A range can contain "
274281
"an asterisk to indicate an infinite upper bound (``'3:*'``)."
275282
msgstr ""
283+
"以下命令的 *message_set* 选项为指定要操作的一条或多条消息的字符串。 它可以是一个简单的消息编号 (``'1'``),一段消息编号区间 "
284+
"(``'2:4'``),或者一组以逗号分隔的非连续区间 (``'1:3,6:9'``)。 区间可以包含一个星号来表示无限的上界 (``'3:*'``)。"
276285

277286
#: ../../library/imaplib.rst:199
278287
msgid "An :class:`IMAP4` instance has the following methods:"
279-
msgstr ""
288+
msgstr ":class:`IMAP4` 实例具有下列方法:"
280289

281290
#: ../../library/imaplib.rst:204
282291
msgid "Append *message* to named mailbox."
283-
msgstr ""
292+
msgstr "将 *message* 添加到指定的邮箱。"
284293

285294
#: ../../library/imaplib.rst:209
286295
msgid "Authenticate command --- requires response processing."
287-
msgstr ""
296+
msgstr "认证命令 --- 要求对响应进行处理。"
288297

289298
#: ../../library/imaplib.rst:211
290299
msgid ""
291300
"*mechanism* specifies which authentication mechanism is to be used - it "
292301
"should appear in the instance variable ``capabilities`` in the form "
293302
"``AUTH=mechanism``."
294303
msgstr ""
304+
"*mechanism* 指明要使用哪种认证机制 —— 它应当在实例变量 ``capabilities`` 中以 ``AUTH=mechanism`` "
305+
"的形式出现。"
295306

296307
#: ../../library/imaplib.rst:214
297308
msgid "*authobject* must be a callable object::"
298-
msgstr ""
309+
msgstr "*authobject* 必须是一个可调用对象::"
299310

300311
#: ../../library/imaplib.rst:218
301312
msgid ""
@@ -304,22 +315,24 @@ msgid ""
304315
"that will be base64 encoded and sent to the server. It should return "
305316
"``None`` if the client abort response ``*`` should be sent instead."
306317
msgstr ""
318+
"它将被调用以便处理服务器连续响应;传给它的 *response* 参数将为 ``bytes`` 类型。 它应当返回 base64 编码的 "
319+
"``bytes`` *数据* 并发送给服务器。 或者在客户端中止响应时返回 ``None`` 并应改为发送 ``*``。"
307320

308321
#: ../../library/imaplib.rst:223
309322
msgid ""
310323
"string usernames and passwords are now encoded to ``utf-8`` instead of being"
311324
" limited to ASCII."
312-
msgstr ""
325+
msgstr "字符串形式的用户名和密码现在会被执行 ``utf-8`` 编码而不限于 ASCII 字符。"
313326

314327
#: ../../library/imaplib.rst:230
315328
msgid "Checkpoint mailbox on server."
316-
msgstr ""
329+
msgstr "为服务器上的邮箱设置检查点。"
317330

318331
#: ../../library/imaplib.rst:235
319332
msgid ""
320333
"Close currently selected mailbox. Deleted messages are removed from writable"
321334
" mailbox. This is the recommended command before ``LOGOUT``."
322-
msgstr ""
335+
msgstr "关闭当前选定的邮箱。 已删除的消息会从可写邮箱中被移除。 在 ``LOGOUT`` 之前建议执行此命令。"
323336

324337
#: ../../library/imaplib.rst:241
325338
msgid "Copy *message_set* messages onto end of *new_mailbox*."

0 commit comments

Comments
 (0)