forked from AFPy/python-docs-fr
338 lines
12 KiB
Plaintext
338 lines
12 KiB
Plaintext
# SOME DESCRIPTIVE TITLE.
|
|
# Copyright (C) 2001-2016, Python Software Foundation
|
|
# This file is distributed under the same license as the Python package.
|
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
#
|
|
#, fuzzy
|
|
msgid ""
|
|
msgstr ""
|
|
"Project-Id-Version: Python 3.6\n"
|
|
"Report-Msgid-Bugs-To: \n"
|
|
"POT-Creation-Date: 2017-04-02 22:11+0200\n"
|
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
"Language: fr\n"
|
|
"MIME-Version: 1.0\n"
|
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
"Content-Transfer-Encoding: 8bit\n"
|
|
|
|
#: ../Doc/library/zipapp.rst:2
|
|
msgid ":mod:`zipapp` --- Manage executable python zip archives"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:9
|
|
msgid "**Source code:** :source:`Lib/zipapp.py`"
|
|
msgstr "**Code source :** :source:`Lib/zipapp.py`"
|
|
|
|
#: ../Doc/library/zipapp.rst:16
|
|
msgid ""
|
|
"This module provides tools to manage the creation of zip files containing "
|
|
"Python code, which can be :ref:`executed directly by the Python interpreter "
|
|
"<using-on-interface-options>`. The module provides both a :ref:`zipapp-"
|
|
"command-line-interface` and a :ref:`zipapp-python-api`."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:23
|
|
msgid "Basic Example"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:25
|
|
msgid ""
|
|
"The following example shows how the :ref:`zipapp-command-line-interface` can "
|
|
"be used to create an executable archive from a directory containing Python "
|
|
"code. When run, the archive will execute the ``main`` function from the "
|
|
"module ``myapp`` in the archive."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:40
|
|
msgid "Command-Line Interface"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:42
|
|
msgid ""
|
|
"When called as a program from the command line, the following form is used:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:48
|
|
msgid ""
|
|
"If *source* is a directory, this will create an archive from the contents of "
|
|
"*source*. If *source* is a file, it should be an archive, and it will be "
|
|
"copied to the target archive (or the contents of its shebang line will be "
|
|
"displayed if the --info option is specified)."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:53
|
|
msgid "The following options are understood:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:59
|
|
msgid ""
|
|
"Write the output to a file named *output*. If this option is not specified, "
|
|
"the output filename will be the same as the input *source*, with the "
|
|
"extension ``.pyz`` added. If an explicit filename is given, it is used as "
|
|
"is (so a ``.pyz`` extension should be included if required)."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:64
|
|
msgid ""
|
|
"An output filename must be specified if the *source* is an archive (and in "
|
|
"that case, *output* must not be the same as *source*)."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:69
|
|
msgid ""
|
|
"Add a ``#!`` line to the archive specifying *interpreter* as the command to "
|
|
"run. Also, on POSIX, make the archive executable. The default is to write "
|
|
"no ``#!`` line, and not make the file executable."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:75
|
|
msgid ""
|
|
"Write a ``__main__.py`` file to the archive that executes *mainfn*. The "
|
|
"*mainfn* argument should have the form \"pkg.mod:fn\", where \"pkg.mod\" is "
|
|
"a package/module in the archive, and \"fn\" is a callable in the given "
|
|
"module. The ``__main__.py`` file will execute that callable."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:80
|
|
msgid ":option:`--main` cannot be specified when copying an archive."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:84
|
|
msgid ""
|
|
"Display the interpreter embedded in the archive, for diagnostic purposes. "
|
|
"In this case, any other options are ignored and SOURCE must be an archive, "
|
|
"not a directory."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:90
|
|
msgid "Print a short usage message and exit."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:96
|
|
msgid "Python API"
|
|
msgstr "API Python"
|
|
|
|
#: ../Doc/library/zipapp.rst:98
|
|
msgid "The module defines two convenience functions:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:103
|
|
msgid ""
|
|
"Create an application archive from *source*. The source can be any of the "
|
|
"following:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:106
|
|
msgid ""
|
|
"The name of a directory, or a :class:`pathlib.Path` object referring to a "
|
|
"directory, in which case a new application archive will be created from the "
|
|
"content of that directory."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:109
|
|
msgid ""
|
|
"The name of an existing application archive file, or a :class:`pathlib.Path` "
|
|
"object referring to such a file, in which case the file is copied to the "
|
|
"target (modifying it to reflect the value given for the *interpreter* "
|
|
"argument). The file name should include the ``.pyz`` extension, if required."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:113
|
|
msgid ""
|
|
"A file object open for reading in bytes mode. The content of the file "
|
|
"should be an application archive, and the file object is assumed to be "
|
|
"positioned at the start of the archive."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:117
|
|
msgid ""
|
|
"The *target* argument determines where the resulting archive will be written:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:120
|
|
msgid ""
|
|
"If it is the name of a file, or a :class:`pathlb.Path` object, the archive "
|
|
"will be written to that file."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:122
|
|
msgid ""
|
|
"If it is an open file object, the archive will be written to that file "
|
|
"object, which must be open for writing in bytes mode."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:124
|
|
msgid ""
|
|
"If the target is omitted (or ``None``), the source must be a directory and "
|
|
"the target will be a file with the same name as the source, with a ``.pyz`` "
|
|
"extension added."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:128
|
|
msgid ""
|
|
"The *interpreter* argument specifies the name of the Python interpreter with "
|
|
"which the archive will be executed. It is written as a \"shebang\" line at "
|
|
"the start of the archive. On POSIX, this will be interpreted by the OS, and "
|
|
"on Windows it will be handled by the Python launcher. Omitting the "
|
|
"*interpreter* results in no shebang line being written. If an interpreter "
|
|
"is specified, and the target is a filename, the executable bit of the target "
|
|
"file will be set."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:136
|
|
msgid ""
|
|
"The *main* argument specifies the name of a callable which will be used as "
|
|
"the main program for the archive. It can only be specified if the source is "
|
|
"a directory, and the source does not already contain a ``__main__.py`` "
|
|
"file. The *main* argument should take the form \"pkg.module:callable\" and "
|
|
"the archive will be run by importing \"pkg.module\" and executing the given "
|
|
"callable with no arguments. It is an error to omit *main* if the source is "
|
|
"a directory and does not contain a ``__main__.py`` file, as otherwise the "
|
|
"resulting archive would not be executable."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:146
|
|
msgid ""
|
|
"If a file object is specified for *source* or *target*, it is the caller's "
|
|
"responsibility to close it after calling create_archive."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:149
|
|
msgid ""
|
|
"When copying an existing archive, file objects supplied only need ``read`` "
|
|
"and ``readline``, or ``write`` methods. When creating an archive from a "
|
|
"directory, if the target is a file object it will be passed to the ``zipfile."
|
|
"ZipFile`` class, and must supply the methods needed by that class."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:157
|
|
msgid ""
|
|
"Return the interpreter specified in the ``#!`` line at the start of the "
|
|
"archive. If there is no ``#!`` line, return :const:`None`. The *archive* "
|
|
"argument can be a filename or a file-like object open for reading in bytes "
|
|
"mode. It is assumed to be at the start of the archive."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:166
|
|
msgid "Examples"
|
|
msgstr "Exemples"
|
|
|
|
#: ../Doc/library/zipapp.rst:168
|
|
msgid "Pack up a directory into an archive, and run it."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:176
|
|
msgid "The same can be done using the :func:`create_archive` functon::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:181
|
|
msgid ""
|
|
"To make the application directly executable on POSIX, specify an interpreter "
|
|
"to use."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:190
|
|
msgid ""
|
|
"To replace the shebang line on an existing archive, create a modified "
|
|
"archive using the :func:`create_archive` function::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:196
|
|
msgid ""
|
|
"To update the file in place, do the replacement in memory using a :class:"
|
|
"`BytesIO` object, and then overwrite the source afterwards. Note that there "
|
|
"is a risk when overwriting a file in place that an error will result in the "
|
|
"loss of the original file. This code does not protect against such errors, "
|
|
"but production code should do so. Also, this method will only work if the "
|
|
"archive fits in memory::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:210
|
|
msgid ""
|
|
"Note that if you specify an interpreter and then distribute your application "
|
|
"archive, you need to ensure that the interpreter used is portable. The "
|
|
"Python launcher for Windows supports most common forms of POSIX ``#!`` line, "
|
|
"but there are other issues to consider:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:215
|
|
msgid ""
|
|
"If you use \"/usr/bin/env python\" (or other forms of the \"python\" "
|
|
"command, such as \"/usr/bin/python\"), you need to consider that your users "
|
|
"may have either Python 2 or Python 3 as their default, and write your code "
|
|
"to work under both versions."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:219
|
|
msgid ""
|
|
"If you use an explicit version, for example \"/usr/bin/env python3\" your "
|
|
"application will not work for users who do not have that version. (This may "
|
|
"be what you want if you have not made your code Python 2 compatible)."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:222
|
|
msgid ""
|
|
"There is no way to say \"python X.Y or later\", so be careful of using an "
|
|
"exact version like \"/usr/bin/env python3.4\" as you will need to change "
|
|
"your shebang line for users of Python 3.5, for example."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:227
|
|
msgid "The Python Zip Application Archive Format"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:229
|
|
msgid ""
|
|
"Python has been able to execute zip files which contain a ``__main__.py`` "
|
|
"file since version 2.6. In order to be executed by Python, an application "
|
|
"archive simply has to be a standard zip file containing a ``__main__.py`` "
|
|
"file which will be run as the entry point for the application. As usual for "
|
|
"any Python script, the parent of the script (in this case the zip file) will "
|
|
"be placed on :data:`sys.path` and thus further modules can be imported from "
|
|
"the zip file."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:236
|
|
msgid ""
|
|
"The zip file format allows arbitrary data to be prepended to a zip file. "
|
|
"The zip application format uses this ability to prepend a standard POSIX "
|
|
"\"shebang\" line to the file (``#!/path/to/interpreter``)."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:240
|
|
msgid "Formally, the Python zip application format is therefore:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:242
|
|
msgid ""
|
|
"An optional shebang line, containing the characters ``b'#!'`` followed by an "
|
|
"interpreter name, and then a newline (``b'\\n'``) character. The "
|
|
"interpreter name can be anything acceptable to the OS \"shebang\" "
|
|
"processing, or the Python launcher on Windows. The interpreter should be "
|
|
"encoded in UTF-8 on Windows, and in :func:`sys.getfilesystemencoding()` on "
|
|
"POSIX."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:247
|
|
msgid ""
|
|
"Standard zipfile data, as generated by the :mod:`zipfile` module. The "
|
|
"zipfile content *must* include a file called ``__main__.py`` (which must be "
|
|
"in the \"root\" of the zipfile - i.e., it cannot be in a subdirectory). The "
|
|
"zipfile data can be compressed or uncompressed."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:252
|
|
msgid ""
|
|
"If an application archive has a shebang line, it may have the executable bit "
|
|
"set on POSIX systems, to allow it to be executed directly."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/zipapp.rst:255
|
|
msgid ""
|
|
"There is no requirement that the tools in this module are used to create "
|
|
"application archives - the module is a convenience, but archives in the "
|
|
"above format created by any means are acceptable to Python."
|
|
msgstr ""
|