forked from python/python-docs-zh-tw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzipimport.po
More file actions
312 lines (274 loc) · 12.7 KB
/
zipimport.po
File metadata and controls
312 lines (274 loc) · 12.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2022, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
# Adrian Liaw <adrianliaw2000@gmail.com>, 2018
# Dr-XYZ <dr.xyz.tw@gmail.com>, 2025
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-23 07:52+0800\n"
"PO-Revision-Date: 2025-06-29 00:00+0800\n"
"Last-Translator: Dr-XYZ <dr.xyz.tw@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../library/zipimport.rst:2
msgid ":mod:`!zipimport` --- Import modules from Zip archives"
msgstr ":mod:`!zipimport` --- 從 Zip 封存檔案匯入模組"
#: ../../library/zipimport.rst:9
msgid "**Source code:** :source:`Lib/zipimport.py`"
msgstr "**原始碼:**\\ :source:`Lib/zipimport.py`"
#: ../../library/zipimport.rst:13
msgid ""
"This module adds the ability to import Python modules (:file:`\\*.py`, :file:"
"`\\*.pyc`) and packages from ZIP-format archives. It is usually not needed "
"to use the :mod:`zipimport` module explicitly; it is automatically used by "
"the built-in :keyword:`import` mechanism for :data:`sys.path` items that are "
"paths to ZIP archives."
msgstr ""
"此模組新增了從 ZIP 格式封存檔案中引入 Python 模組(:file:`\\*.py`、:file:`"
"\\*.pyc`)和套件的能力。通常不需要明確地使用 :mod:`zipimport` 模組;對於 :"
"data:`sys.path` 中指向 ZIP 封存檔案路徑的項目,內建的 :keyword:`import` 機制"
"會自動使用它。"
#: ../../library/zipimport.rst:19
msgid ""
"Typically, :data:`sys.path` is a list of directory names as strings. This "
"module also allows an item of :data:`sys.path` to be a string naming a ZIP "
"file archive. The ZIP archive can contain a subdirectory structure to "
"support package imports, and a path within the archive can be specified to "
"only import from a subdirectory. For example, the path :file:`example.zip/"
"lib/` would only import from the :file:`lib/` subdirectory within the "
"archive."
msgstr ""
"通常 :data:`sys.path` 是一個由目錄名稱字串組成的串列。此模組也允許 :data:"
"`sys.path` 的一個項目是命名 ZIP 封存檔案的字串。ZIP 封存檔案可以包含子目錄結"
"構以支援套件引入,並且可以指定封存檔案內的路徑以僅從子目錄中引入。例如路徑 :"
"file:`example.zip/lib/` 將只會從封存檔案內的 :file:`lib/` 子目錄中引入。"
#: ../../library/zipimport.rst:26
msgid ""
"Any files may be present in the ZIP archive, but importers are only invoked "
"for :file:`.py` and :file:`.pyc` files. ZIP import of dynamic modules (:"
"file:`.pyd`, :file:`.so`) is disallowed. Note that if an archive only "
"contains :file:`.py` files, Python will not attempt to modify the archive by "
"adding the corresponding :file:`.pyc` file, meaning that if a ZIP archive "
"doesn't contain :file:`.pyc` files, importing may be rather slow."
msgstr ""
"ZIP 封存檔案中可以存在任何檔案,但引入器只會對 :file:`.py` 和 :file:`.pyc` 檔"
"案起作用。不允許從 ZIP 引入動態模組(:file:`.pyd`、:file:`.so`)。請注意,如"
"果封存檔案只包含 :file:`.py` 檔案,Python 將不會試圖透過新增對應的 :file:`."
"pyc` 檔案來修改封存檔案,這意味著如果 ZIP 封存檔案不包含 :file:`.pyc` 檔案,"
"引入可能會相當慢。"
#: ../../library/zipimport.rst:33
msgid "ZIP64 is supported"
msgstr "支援 ZIP64。"
#: ../../library/zipimport.rst:36
msgid "Previously, ZIP archives with an archive comment were not supported."
msgstr "在過去,不支援帶有封存檔案註解的 ZIP 封存檔案。"
#: ../../library/zipimport.rst:41
msgid ""
"`PKZIP Application Note <https://pkware.cachefly.net/webdocs/casestudies/"
"APPNOTE.TXT>`_"
msgstr ""
"`PKZIP Application Note <https://pkware.cachefly.net/webdocs/casestudies/"
"APPNOTE.TXT>`_"
#: ../../library/zipimport.rst:42
msgid ""
"Documentation on the ZIP file format by Phil Katz, the creator of the format "
"and algorithms used."
msgstr ""
"由 ZIP 格式和所用演算法的創造者 Phil Katz 編寫的關於 ZIP 檔案格式的文件。"
#: ../../library/zipimport.rst:45
msgid ":pep:`273` - Import Modules from Zip Archives"
msgstr ":pep:`273` - 從 Zip 封存檔案引入模組"
#: ../../library/zipimport.rst:46
msgid ""
"Written by James C. Ahlstrom, who also provided an implementation. Python "
"2.3 follows the specification in :pep:`273`, but uses an implementation "
"written by Just van Rossum that uses the import hooks described in :pep:"
"`302`."
msgstr ""
"由 James C. Ahlstrom 編寫,他也提供了一個實作。Python 2.3 遵循 :pep:`273` 中"
"的規範,但使用由 Just van Rossum 編寫的實作,該實作使用了 :pep:`302` 中描述的"
"引入掛鉤。"
#: ../../library/zipimport.rst:50
msgid ":mod:`importlib` - The implementation of the import machinery"
msgstr ":mod:`importlib` - 引入機制的實作"
#: ../../library/zipimport.rst:51
msgid ""
"Package providing the relevant protocols for all importers to implement."
msgstr "提供所有引入器要實作的相關協定的套件。"
#: ../../library/zipimport.rst:55
msgid "This module defines an exception:"
msgstr "此模組定義了一個例外:"
#: ../../library/zipimport.rst:59
msgid ""
"Exception raised by zipimporter objects. It's a subclass of :exc:"
"`ImportError`, so it can be caught as :exc:`ImportError`, too."
msgstr ""
"由 zipimporter 物件引發的例外。它是 :exc:`ImportError` 的子類別,所以也可以被"
"捕捉為 :exc:`ImportError`。"
#: ../../library/zipimport.rst:66
msgid "zipimporter Objects"
msgstr "zipimporter 物件"
#: ../../library/zipimport.rst:68
msgid ":class:`zipimporter` is the class for importing ZIP files."
msgstr ":class:`zipimporter` 是用於引入 ZIP 檔案的類別。"
#: ../../library/zipimport.rst:72
msgid ""
"Create a new zipimporter instance. *archivepath* must be a path to a ZIP "
"file, or to a specific path within a ZIP file. For example, an "
"*archivepath* of :file:`foo/bar.zip/lib` will look for modules in the :file:"
"`lib` directory inside the ZIP file :file:`foo/bar.zip` (provided that it "
"exists)."
msgstr ""
"建立一個新的 zipimporter 實例。*archivepath* 必須是 ZIP 檔案的路徑,或是 ZIP "
"檔案內的特定路徑。例如,:file:`foo/bar.zip/lib` 的 *archivepath* 將會在 ZIP "
"檔案 :file:`foo/bar.zip` 內的 :file:`lib` 目錄中尋找模組(如果該目錄存在的"
"話)。"
#: ../../library/zipimport.rst:77
msgid ""
":exc:`ZipImportError` is raised if *archivepath* doesn't point to a valid "
"ZIP archive."
msgstr ""
"如果 *archivepath* 未指向一個有效的 ZIP 封存檔案,則會引發 :exc:"
"`ZipImportError`。"
#: ../../library/zipimport.rst:82
msgid ""
"Methods ``find_loader()`` and ``find_module()``, deprecated in 3.10 are now "
"removed. Use :meth:`find_spec` instead."
msgstr ""
"在 3.10 版中已棄用的 ``find_loader()`` 和 ``find_module()`` 方法現已被移除。"
"請改用 :meth:`find_spec`。"
#: ../../library/zipimport.rst:87
msgid ""
"Implementation of :meth:`importlib.abc.Loader.create_module` that returns :"
"const:`None` to explicitly request the default semantics."
msgstr ""
":meth:`importlib.abc.Loader.create_module` 的實作,回傳 :const:`None` 以明確"
"請求預設語意。"
#: ../../library/zipimport.rst:95
msgid "Implementation of :meth:`importlib.abc.Loader.exec_module`."
msgstr ":meth:`importlib.abc.Loader.exec_module` 的實作。"
#: ../../library/zipimport.rst:102
msgid "An implementation of :meth:`importlib.abc.PathEntryFinder.find_spec`."
msgstr ":meth:`importlib.abc.PathEntryFinder.find_spec` 的一個實作。"
#: ../../library/zipimport.rst:109
msgid ""
"Return the code object for the specified module. Raise :exc:`ZipImportError` "
"if the module couldn't be imported."
msgstr ""
"回傳指定模組的程式碼物件。如果模組無法被引入,則引發 :exc:`ZipImportError`。"
#: ../../library/zipimport.rst:115
msgid ""
"Return the data associated with *pathname*. Raise :exc:`OSError` if the file "
"wasn't found."
msgstr "回傳與 *pathname* 相關的資料。如果找不到檔案,則引發 :exc:`OSError`。"
#: ../../library/zipimport.rst:118
msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`."
msgstr "過去會引發 :exc:`IOError`,現在它是 :exc:`OSError` 的別名。"
#: ../../library/zipimport.rst:124
msgid ""
"Return the value ``__file__`` would be set to if the specified module was "
"imported. Raise :exc:`ZipImportError` if the module couldn't be imported."
msgstr ""
"回傳如果指定模組被引入時 ``__file__`` 會被設定的值。如果模組無法被引入,則引"
"發 :exc:`ZipImportError`。"
#: ../../library/zipimport.rst:133
msgid ""
"Return the source code for the specified module. Raise :exc:`ZipImportError` "
"if the module couldn't be found, return :const:`None` if the archive does "
"contain the module, but has no source for it."
msgstr ""
"回傳指定模組的原始碼。如果找不到模組,則引發 :exc:`ZipImportError`;如果封存"
"檔案包含該模組但沒有其原始碼,則回傳 :const:`None`。"
#: ../../library/zipimport.rst:141
msgid ""
"Return ``True`` if the module specified by *fullname* is a package. Raise :"
"exc:`ZipImportError` if the module couldn't be found."
msgstr ""
"如果由 *fullname* 指定的模組是一個套件,則回傳 ``True``。如果找不到模組,則引"
"發 :exc:`ZipImportError`。"
#: ../../library/zipimport.rst:147
msgid ""
"Load the module specified by *fullname*. *fullname* must be the fully "
"qualified (dotted) module name. Returns the imported module on success, "
"raises :exc:`ZipImportError` on failure."
msgstr ""
"載入由 *fullname* 指定的模組。*fullname* 必須是完整限定(以點分隔)的模組名"
"稱。成功時回傳引入的模組,失敗時引發 :exc:`ZipImportError`。"
#: ../../library/zipimport.rst:153
msgid "Use :meth:`exec_module` instead."
msgstr "請改用 :meth:`exec_module`。"
#: ../../library/zipimport.rst:158
msgid ""
"Clear out the internal cache of information about files found within the ZIP "
"archive."
msgstr "清除關於在 ZIP 封存檔案中找到的檔案資訊的內部快取。"
#: ../../library/zipimport.rst:166
msgid ""
"The file name of the importer's associated ZIP file, without a possible "
"subpath."
msgstr "引入器關聯的 ZIP 檔案的檔名,不包含可能的子路徑。"
#: ../../library/zipimport.rst:172
msgid ""
"The subpath within the ZIP file where modules are searched. This is the "
"empty string for zipimporter objects which point to the root of the ZIP file."
msgstr ""
"在 ZIP 檔案內搜尋模組的子路徑。對於指向 ZIP 檔案根目錄的 zipimporter 物件,這"
"是一個空字串。"
#: ../../library/zipimport.rst:176
msgid ""
"The :attr:`archive` and :attr:`prefix` attributes, when combined with a "
"slash, equal the original *archivepath* argument given to the :class:"
"`zipimporter` constructor."
msgstr ""
":attr:`archive` 和 :attr:`prefix` 屬性(attribute),當用斜線組合時,等於給"
"予 :class:`zipimporter` 建構函式的原始 *archivepath* 引數。"
#: ../../library/zipimport.rst:184
msgid "Examples"
msgstr "範例"
#: ../../library/zipimport.rst:186
msgid ""
"Here is an example that imports a module from a ZIP archive - note that the :"
"mod:`zipimport` module is not explicitly used."
msgstr ""
"這是一個從 ZIP 封存檔案引入模組的範例——請注意,:mod:`zipimport` 模組並未被明"
"確使用。"
#: ../../library/zipimport.rst:189
msgid ""
"$ unzip -l example.zip\n"
"Archive: example.zip\n"
" Length Date Time Name\n"
" -------- ---- ---- ----\n"
" 8467 11-26-02 22:30 jwzthreading.py\n"
" -------- -------\n"
" 8467 1 file\n"
"$ ./python\n"
"Python 2.3 (#1, Aug 1 2003, 19:54:32)\n"
">>> import sys\n"
">>> sys.path.insert(0, 'example.zip') # Add .zip file to front of path\n"
">>> import jwzthreading\n"
">>> jwzthreading.__file__\n"
"'example.zip/jwzthreading.py'"
msgstr ""
"$ unzip -l example.zip\n"
"Archive: example.zip\n"
" Length Date Time Name\n"
" -------- ---- ---- ----\n"
" 8467 11-26-02 22:30 jwzthreading.py\n"
" -------- -------\n"
" 8467 1 file\n"
"$ ./python\n"
"Python 2.3 (#1, Aug 1 2003, 19:54:32)\n"
">>> import sys\n"
">>> sys.path.insert(0, 'example.zip') # 將 .zip 檔案新增到系統路徑的最前面\n"
">>> import jwzthreading\n"
">>> jwzthreading.__file__\n"
"'example.zip/jwzthreading.py'"