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

Skip to content

Commit 7bcc3b5

Browse files
[po] auto sync
1 parent 2124b0d commit 7bcc3b5

2 files changed

Lines changed: 38 additions & 9 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: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,13 @@ msgstr ""
255255

256256
#: ../../library/imaplib.rst:185
257257
msgid "IMAP4 Objects"
258-
msgstr ""
258+
msgstr "IMAP4 对象"
259259

260260
#: ../../library/imaplib.rst:187
261261
msgid ""
262262
"All IMAP4rev1 commands are represented by methods of the same name, either "
263263
"upper-case or lower-case."
264-
msgstr ""
264+
msgstr "所有 IMAP4rev1 命令都表示为同名的方法,可以为大写或小写形式。"
265265

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

278282
#: ../../library/imaplib.rst:198
279283
msgid ""
@@ -283,6 +287,9 @@ msgid ""
283287
"``bytes``, or a tuple. If a tuple, then the first part is the header of the "
284288
"response, and the second part contains the data (ie: 'literal' value)."
285289
msgstr ""
290+
"每条命令均返回一个元组: ``(type, [data, ...])`` 其中 *type* 通常为 ``'OK'`` 或 ``'NO'``,而 "
291+
"*data* 为来自命令响应的文本,或为来自命令的规定结果。 每个 *data* 均为 ``bytes`` 或者元组。 "
292+
"如果为元组,则其第一部分是响应的标头,而第二部分将包含数据 (例如: 'literal' 值)。"
286293

287294
#: ../../library/imaplib.rst:204
288295
msgid ""

0 commit comments

Comments
 (0)