Skip to content

Commit

Permalink
Fixing references.
Browse files Browse the repository at this point in the history
  • Loading branch information
htgoebel committed Mar 27, 2016
1 parent c40765f commit 7c001fc
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 34 deletions.
16 changes: 14 additions & 2 deletions doc/advanced-topics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ but such details are helpful if you want to investigate
the |PyInstaller| code and possibly contribute to it,
as described in `How to Contribute`_.


.. _the bootstrap process in detail:

The Bootstrap Process in Detail
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

There are many steps that must take place before the bundled
script can begin execution.
A summary of these steps was given in the Overview
(`How the One-Folder Program Works`_ and
`How the One-File Program Works`_).
(:ref:`How the One-Folder Program Works` and
:ref:`How the One-File Program Works`).
Here is more detail to help you understand what the |bootloader|
does and how to figure out problems.

Expand Down Expand Up @@ -131,6 +134,8 @@ in a bundled app:
raise ``ImportError``.


.. _the toc and tree classes:

The TOC and Tree Classes
~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -271,6 +276,8 @@ Each tuple in this TOC has:
* A *typecode* of ``EXTENSION`` (``BINARY`` could be used as well).


.. _inspecting archives:

Inspecting Archives
~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -409,6 +416,8 @@ The ``pyi-archive_viewer`` command has these options:



.. _inspecting executables:

Inspecting Executables
~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -425,6 +434,9 @@ an executable or by another DLL.
follow the chain of dependencies of binary extensions
during Analysis.


.. _creating a reproducible build:

Creating a Reproducible Build
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 2 additions & 0 deletions doc/bootloader-building.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _building the bootloader:

Building the Bootloader
=========================

Expand Down
11 changes: 8 additions & 3 deletions doc/hooks.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
.. _understanding pyinstaller hooks:

Understanding PyInstaller Hooks
==================================

In summary, a "hook" file extends |PyInstaller| to adapt it to
the special needs and methods used by a Python package.
The word "hook" is used for two kinds of files.
A *runtime* hook helps the bootloader to launch an app.
For more on runtime hooks, see `Changing Runtime Behavior`_.
For more on runtime hooks, see :ref:`Changing Runtime Behavior`.
Other hooks run while an app is being analyzed.
They help the Analysis phase find needed files.

Expand Down Expand Up @@ -128,7 +130,7 @@ applies them to the bundle being created.
and the second specifies the name(s) the file(s) are to have in
the bundle.
(This is the same format as used for the ``datas=`` argument,
see `Adding Data Files`_.)
see :ref:`Adding Data Files`.)
Example::

datas = [ ('/usr/share/icons/education_*.png', 'icons') ]
Expand All @@ -145,7 +147,7 @@ applies them to the bundle being created.
for example because the files are
in different places on different platforms or under different versions.
Then you can write a ``hook()`` function as described
below under `The ``hook(hook_api)`` Function`_.
below under :ref:`The hook(hook_api) Function`.


``binaries``
Expand Down Expand Up @@ -382,6 +384,9 @@ You are welcome to read the ``PyInstaller.utils.hooks`` module
the Django settings.py file, such as the
``Django.settings.INSTALLED_APPS`` list and many others.


.. _the hook(hook_api) function:

The ``hook(hook_api)`` Function
--------------------------------

Expand Down
4 changes: 2 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ and resolutions for many old issues.
Functional changes include
removal of support for Python prior to 2.7,
an easier way to include data files
in the bundle (`Adding Files to the Bundle`_),
and changes to the "hook" API (`Understanding PyInstaller Hooks`_).
in the bundle (:ref:`Adding Files to the Bundle`),
and changes to the "hook" API (:ref:`Understanding PyInstaller Hooks`).

Contents:

Expand Down
14 changes: 7 additions & 7 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ along with the correct version of PyWin32_.
pip-Win_ also provides virtualenv_, which makes it simple
to maintain multiple different Python interpreters and install packages
such as |PyInstaller| in each of them.
(For more on the uses of virtualenv, see `Supporting Multiple Platforms`_ below.)
(For more on the uses of virtualenv, see :ref:`Supporting Multiple Platforms` below.)

When pip-Win is working, enter this command in its Command field
and click Run:
Expand Down Expand Up @@ -76,7 +76,7 @@ Execute ``python setup.py install``
with administrator privilege to install or upgrade |PyInstaller|.

For platforms other than Windows, Linux and Mac OS, you must first
build a |bootloader| program for your platform: see `Building the Bootloader`_.
build a |bootloader| program for your platform: see :ref:`Building the Bootloader`.
After the |bootloader| has been created,
use ``python setup.py install`` with administrator privileges
to complete the installation.
Expand Down Expand Up @@ -115,18 +115,18 @@ Installed commands
The complete installation places these commands on the execution path:

* ``pyinstaller`` is the main command to build a bundled application.
See `Using PyInstaller`_.
See :ref:`Using PyInstaller`.

* ``pyi-makespec`` is used to create a spec file. See `Using Spec Files`_.
* ``pyi-makespec`` is used to create a spec file. See :ref:`Using Spec Files`.

* ``pyi-archive_viewer`` is used to inspect a bundled application.
See `Inspecting Archives`_.
See :ref:`Inspecting Archives`.

* ``pyi-bindepend`` is used to display dependencies of an executable.
See `Inspecting Executables`_.
See :ref:`Inspecting Executables`.

* ``pyi-grab_version`` is used to extract a version resource from a Windows
executable. See `Capturing Windows Version Data`_.
executable. See :ref:`Capturing Windows Version Data`.

If you do not perform a complete installation
(installing via ``pip`` or executing ``setup.py``),
Expand Down
12 changes: 8 additions & 4 deletions doc/operating-mode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ What |PyInstaller| Does and How It Does It

This section covers the basic ideas of |PyInstaller|.
These ideas apply to all platforms.
Options and special cases are covered below, under `Using PyInstaller`_.
Options and special cases are covered below, under :ref:`Using PyInstaller`.

|PyInstaller| reads a Python script written by you.
It analyzes your code to discover every other module and library
Expand Down Expand Up @@ -86,13 +86,13 @@ you must help it:
If your program depends on access to certain data files,
you can tell |PyInstaller| to include them in the bundle as well.
You do this by modifying the spec file, an advanced topic that is
covered under `Using Spec Files`_.
covered under :ref:`Using Spec Files`.

In order to locate included files at run time,
your program needs to be able to learn its path at run time
in a way that works regardless of
whether or not it is running from a bundle.
This is covered under `Run-time Information`_.
This is covered under :ref:`Run-time Information`.

|PyInstaller| does *not* include libraries that should exist in
any installation of this OS.
Expand Down Expand Up @@ -136,6 +136,8 @@ in a long list of names or among a big array of icons.
Also your user can create
a problem by accidentally dragging files out of the folder.

.. _how the one-folder program works:

How the One-Folder Program Works
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -156,7 +158,7 @@ Everything follows normally from there, provided
that all the necessary support files were included.

(This is an overview.
For more detail, see `The Bootstrap Process in Detail`_ below.)
For more detail, see :ref:`The Bootstrap Process in Detail` below.)


Bundling to One File
Expand All @@ -176,6 +178,8 @@ Before you attempt to bundle to one file, make sure your app
works correctly when bundled to one folder.
It is is *much* easier to diagnose problems in one-folder mode.

.. _how the one-file program works:

How the One-File Program Works
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
4 changes: 2 additions & 2 deletions doc/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The ``ldd`` and ``objdump`` commands are needed.

Each bundled app contains a copy of a *bootloader*,
a program that sets up the application and starts it
(see `The Bootstrap Process in Detail`_).
(see :ref:`The Bootstrap Process in Detail`).

When you install |PyInstaller| using pip_, the setup will attempt
to build a bootloader for this platform.
Expand All @@ -55,7 +55,7 @@ If that succeeds, the installation continues and |PyInstaller| is ready to use.
If the pip_ setup fails to build a bootloader,
or if you do not use pip_ to install,
you must compile a bootloader manually.
The process is described under `Building the Bootloader`_.
The process is described under :ref:`Building the Bootloader`.


.. include:: _common_definitions.txt
Expand Down
7 changes: 5 additions & 2 deletions doc/runtime-information.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _run-time information:

Run-time Information
=====================

Expand All @@ -20,7 +22,7 @@ So the test for "are we bundled?" is::
When your app is running, it may need to access data files in any of
three general locations:

* Files that were bundled with it (see `Adding Data Files`_).
* Files that were bundled with it (see :ref:`Adding Data Files`).

* Files the user has placed with the app bundle, say in the same folder.

Expand All @@ -40,7 +42,7 @@ and stores the absolute path to the bundle folder in ``sys._MEIPASS``.
For a one-folder bundle, this is the path to that folder,
wherever the user may have put it.
For a one-file bundle, this is the path to the ``_MEIxxxxxx`` temporary folder
created by the |bootloader| (see `How the One-File Program Works`_).
created by the |bootloader| (see :ref:`How the One-File Program Works`).


Using ``sys.executable`` and ``sys.argv[0]``
Expand Down Expand Up @@ -98,6 +100,7 @@ symbolic link::
print( 'os.getcwd is', os.getcwd() )



.. include:: _common_definitions.txt

.. Emacs config:
Expand Down
27 changes: 23 additions & 4 deletions doc/spec-files.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _using spec files:

Using Spec Files
=================

Expand Down Expand Up @@ -97,7 +99,7 @@ The statements in a spec file create instances of four classes,
- ``datas``: non-binary files included in the app.

* An instance of class ``PYZ`` is a ``.pyz`` archive (described
under `Inspecting Archives`_ below), which contains all the
under :ref:`Inspecting Archives` below), which contains all the
Python modules from ``a.pure``.

* An instance of ``EXE`` is built from the analyzed scripts and the ``PYZ``
Expand All @@ -111,12 +113,18 @@ In one-file mode, there is no call to ``COLLECT``, and the
You modify the spec file to pass additional values to ``Analysis`` and
to ``EXE``.


.. _adding files to the bundle:

Adding Files to the Bundle
~~~~~~~~~~~~~~~~~~~~~~~~~~~

To add files to the bundle, you create a list that describes the files
and supply it to the ``Analysis`` call.
To find the data files at run-time, see `Run-time Information`_.
To find the data files at run-time, see :ref:`Run-time Information`.


.. _adding data files:

Adding Data Files
------------------
Expand Down Expand Up @@ -180,6 +188,9 @@ You can also include the entire contents of a folder::
The folder ``/mygame/data`` will be reproduced under the name
``data`` in the bundle.


.. _using data files from a module:

Using Data Files from a Module
--------------------------------

Expand Down Expand Up @@ -220,6 +231,9 @@ If it is actually characters, you must decode it::

help_utf = help_bin.decode('UTF-8', 'ignore')


.. _adding binary files:

Adding Binary Files
--------------------

Expand Down Expand Up @@ -252,9 +266,11 @@ Advanced Methods of Adding Files

|PyInstaller| supports a more advanced (and complex) way of adding
files to the bundle that may be useful for special cases.
See `The TOC and Tree Classes`_ below.
See :ref:`The TOC and Tree Classes` below.


.. _giving run-time python options:

Giving Run-time Python Options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -292,6 +308,9 @@ For example modify the spec file this way::
exclude_binaries=...
)


.. _spec file options for a mac os x bundle:

Spec File Options for a Mac OS X Bundle
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -498,7 +517,7 @@ You can use all the Python facilities (``for`` and ``with``
and the members of ``sys`` and ``io``)
in creating the Analysis
objects and performing the ``PYZ``, ``EXE`` and ``COLLECT`` statements.
You may also need to know and use `The TOC and Tree Classes`_ described below.
You may also need to know and use :ref:`The TOC and Tree Classes` described below.

Globals Available to the Spec File
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
13 changes: 11 additions & 2 deletions doc/usage.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _using pyinstaller:

Using PyInstaller
====================

Expand Down Expand Up @@ -29,7 +31,7 @@ spec file and for the executable folder or file.
Its code is the first to execute at run-time.

For certain uses you may edit the contents of ``myscript.spec``
(described under `Using Spec Files`_).
(described under :ref:`Using Spec Files`).
After you do this, you name the spec file to |PyInstaller| instead of the script:

``pyinstaller myscript.spec``
Expand Down Expand Up @@ -115,6 +117,8 @@ unless the ``--noupx`` option was given.
UPX has been used with |PyInstaller| output often, usually with no problems.


.. _encrypting python bytecode:

Encrypting Python Bytecode
~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -128,6 +132,9 @@ The *key-string* is a string of 16 characters which is used to
encrypt each file of Python byte-code before it is stored in
the archive inside the executable file.


.. _supporting multiple platforms:

Supporting Multiple Platforms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -230,6 +237,8 @@ on a 64-bit installation, nor vice-versa.
You must make a unique version of the app for each word-length supported.


.. _capturing windows version data:

Capturing Windows Version Data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -336,7 +345,7 @@ Use the ``icon=`` argument to specify a custom icon for the application.
file ``icon-windowed.icns`` with the |PyInstaller| logo.)

You can add items to the ``Info.plist`` by editing the spec file;
see `Spec File Options for a Mac OS X Bundle`_ below.
see :ref:`Spec File Options for a Mac OS X Bundle` below.

Making Mac OS X apps Forward-Compatible
----------------------------------------
Expand Down
Loading

0 comments on commit 7c001fc

Please sign in to comment.