summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/index.rst13
-rw-r--r--docs/narr/commandline.rst33
-rw-r--r--docs/narr/project.rst6
-rw-r--r--docs/pscripts/index.rst12
-rw-r--r--docs/pscripts/pcreate.rst14
-rw-r--r--docs/pscripts/pdistreport.rst14
-rw-r--r--docs/pscripts/prequest.rst14
-rw-r--r--docs/pscripts/proutes.rst14
-rw-r--r--docs/pscripts/pserve.rst14
-rw-r--r--docs/pscripts/pshell.rst14
-rw-r--r--docs/pscripts/ptweens.rst14
-rw-r--r--docs/pscripts/pviews.rst14
12 files changed, 176 insertions, 0 deletions
diff --git a/docs/index.rst b/docs/index.rst
index e792b9905..8c8a0a18d 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -162,6 +162,19 @@ Comprehensive reference material for every public API exposed by
api/*
+``p*`` Scripts Documentation
+============================
+
+``p*`` scripts included with :app:`Pyramid`:.
+
+.. toctree::
+ :maxdepth: 1
+ :glob:
+
+ pscripts/index
+ pscripts/*
+
+
Change History
==============
diff --git a/docs/narr/commandline.rst b/docs/narr/commandline.rst
index eb79dffb6..34b12e1e9 100644
--- a/docs/narr/commandline.rst
+++ b/docs/narr/commandline.rst
@@ -6,6 +6,7 @@ Command-Line Pyramid
Your :app:`Pyramid` application can be controlled and inspected using a variety
of command-line utilities. These utilities are documented in this chapter.
+
.. index::
pair: matching views; printing
single: pviews
@@ -15,6 +16,8 @@ of command-line utilities. These utilities are documented in this chapter.
Displaying Matching Views for a Given URL
-----------------------------------------
+.. seealso:: See also the output of :ref:`pviews --help <pviews_script>`.
+
For a big application with several views, it can be hard to keep the view
configuration details in your head, even if you defined all the views yourself.
You can use the ``pviews`` command in a terminal window to print a summary of
@@ -114,6 +117,8 @@ found* message.
The Interactive Shell
---------------------
+.. seealso:: See also the output of :ref:`pshell --help <pshell_script>`.
+
Once you've installed your program for development using ``setup.py develop``,
you can use an interactive Python shell to execute expressions in a Python
environment exactly like the one that will be used when your application runs
@@ -179,6 +184,7 @@ hash after the filename:
Press ``Ctrl-D`` to exit the interactive shell (or ``Ctrl-Z`` on Windows).
+
.. index::
pair: pshell; extending
@@ -261,6 +267,7 @@ request is configured to generate urls from the host
>>> request.route_url('home')
'https://www.example.com/'
+
.. _ipython_or_bpython:
Alternative Shells
@@ -317,6 +324,7 @@ arguments, ``env`` and ``help``, which would look like this:
``ipython`` and ``bpython`` have been moved into their respective
packages ``pyramid_ipython`` and ``pyramid_bpython``.
+
Setting a Default Shell
~~~~~~~~~~~~~~~~~~~~~~~
@@ -331,6 +339,7 @@ specify a list of preferred shells.
.. versionadded:: 1.6
+
.. index::
pair: routes; printing
single: proutes
@@ -340,6 +349,8 @@ specify a list of preferred shells.
Displaying All Application Routes
---------------------------------
+.. seealso:: See also the output of :ref:`proutes --help <proutes_script>`.
+
You can use the ``proutes`` command in a terminal window to print a summary of
routes related to your application. Much like the ``pshell`` command (see
:ref:`interactive_shell`), the ``proutes`` command accepts one argument with
@@ -421,6 +432,8 @@ include. The current available formats are ``name``, ``pattern``, ``view``, and
Displaying "Tweens"
-------------------
+.. seealso:: See also the output of :ref:`ptweens --help <ptweens_script>`.
+
A :term:`tween` is a bit of code that sits between the main Pyramid application
request handler and the WSGI application which calls it. A user can get a
representation of both the implicit tween ordering (the ordering specified by
@@ -497,6 +510,7 @@ used:
See :ref:`registering_tweens` for more information about tweens.
+
.. index::
single: invoking a request
single: prequest
@@ -506,6 +520,8 @@ See :ref:`registering_tweens` for more information about tweens.
Invoking a Request
------------------
+.. seealso:: See also the output of :ref:`prequest --help <prequest_script>`.
+
You can use the ``prequest`` command-line utility to send a request to your
application and see the response body without starting a server.
@@ -555,6 +571,7 @@ of the ``prequest`` process is used as the ``POST`` body::
$ $VENV/bin/prequest -mPOST development.ini / < somefile
+
Using Custom Arguments to Python when Running ``p*`` Scripts
------------------------------------------------------------
@@ -566,11 +583,22 @@ Python interpreter at runtime. For example::
python -3 -m pyramid.scripts.pserve development.ini
+
+.. index::
+ single: pdistreport
+ single: distributions, showing installed
+ single: showing installed distributions
+
+.. _showing_distributions:
+
Showing All Installed Distributions and Their Versions
------------------------------------------------------
.. versionadded:: 1.5
+.. seealso:: See also the output of :ref:`pdistreport --help
+ <pdistreport_script>`.
+
You can use the ``pdistreport`` command to show the :app:`Pyramid` version in
use, the Python version in use, and all installed versions of Python
distributions in your Python environment::
@@ -590,6 +618,7 @@ pastebin when you are having problems and need someone with more familiarity
with Python packaging and distribution than you have to look at your
environment.
+
.. _writing_a_script:
Writing a Script
@@ -702,6 +731,7 @@ The above example specifies the ``another`` ``app``, ``pipeline``, or
object present in the ``env`` dictionary returned by
:func:`pyramid.paster.bootstrap` will be a :app:`Pyramid` :term:`router`.
+
Changing the Request
~~~~~~~~~~~~~~~~~~~~
@@ -742,6 +772,7 @@ Now you can readily use Pyramid's APIs for generating URLs:
env['request'].route_url('verify', code='1337')
# will return 'https://example.com/prefix/verify/1337'
+
Cleanup
~~~~~~~
@@ -757,6 +788,7 @@ callback:
env['closer']()
+
Setting Up Logging
~~~~~~~~~~~~~~~~~~
@@ -773,6 +805,7 @@ use the following command:
See :ref:`logging_chapter` for more information on logging within
:app:`Pyramid`.
+
.. index::
single: console script
diff --git a/docs/narr/project.rst b/docs/narr/project.rst
index 4785b60c4..5103bb6b8 100644
--- a/docs/narr/project.rst
+++ b/docs/narr/project.rst
@@ -53,15 +53,19 @@ The included scaffolds are these:
``alchemy``
URL mapping via :term:`URL dispatch` and persistence via :term:`SQLAlchemy`
+
.. index::
single: creating a project
single: project
+ single: pcreate
.. _creating_a_project:
Creating the Project
--------------------
+.. seealso:: See also the output of :ref:`pcreate --help <pcreate_script>`.
+
In :ref:`installing_chapter`, you created a virtual Python environment via the
``virtualenv`` command. To start a :app:`Pyramid` :term:`project`, use the
``pcreate`` command installed within the virtualenv. We'll choose the
@@ -262,6 +266,8 @@ single sample test exists.
Running the Project Application
-------------------------------
+.. seealso:: See also the output of :ref:`pserve --help <pserve_script>`.
+
Once a project is installed for development, you can run the application it
represents using the ``pserve`` command against the generated configuration
file. In our case, this file is named ``development.ini``.
diff --git a/docs/pscripts/index.rst b/docs/pscripts/index.rst
new file mode 100644
index 000000000..1f54546d7
--- /dev/null
+++ b/docs/pscripts/index.rst
@@ -0,0 +1,12 @@
+.. _pscripts_documentation:
+
+``p*`` Scripts Documentation
+============================
+
+``p*`` scripts included with :app:`Pyramid`:.
+
+.. toctree::
+ :maxdepth: 1
+ :glob:
+
+ *
diff --git a/docs/pscripts/pcreate.rst b/docs/pscripts/pcreate.rst
new file mode 100644
index 000000000..4e7f89572
--- /dev/null
+++ b/docs/pscripts/pcreate.rst
@@ -0,0 +1,14 @@
+.. index::
+ single: pcreate; --help
+
+.. _pcreate_script:
+
+``pcreate``
+-----------
+
+.. program-output:: pcreate --help
+ :cwd: ../../env/bin
+ :prompt:
+ :shell:
+
+.. seealso:: :ref:`creating_a_project`
diff --git a/docs/pscripts/pdistreport.rst b/docs/pscripts/pdistreport.rst
new file mode 100644
index 000000000..37d12d848
--- /dev/null
+++ b/docs/pscripts/pdistreport.rst
@@ -0,0 +1,14 @@
+.. index::
+ single: pdistreport; --help
+
+.. _pdistreport_script:
+
+``pdistreport``
+---------------
+
+.. program-output:: pdistreport --help
+ :cwd: ../../env/bin
+ :prompt:
+ :shell:
+
+.. seealso:: :ref:`showing_distributions`
diff --git a/docs/pscripts/prequest.rst b/docs/pscripts/prequest.rst
new file mode 100644
index 000000000..a03d5b0e0
--- /dev/null
+++ b/docs/pscripts/prequest.rst
@@ -0,0 +1,14 @@
+.. index::
+ single: prequest; --help
+
+.. _prequest_script:
+
+``prequest``
+------------
+
+.. program-output:: prequest --help
+ :cwd: ../../env/bin
+ :prompt:
+ :shell:
+
+.. seealso:: :ref:`invoking_a_request`
diff --git a/docs/pscripts/proutes.rst b/docs/pscripts/proutes.rst
new file mode 100644
index 000000000..8f3f34e16
--- /dev/null
+++ b/docs/pscripts/proutes.rst
@@ -0,0 +1,14 @@
+.. index::
+ single: proutes; --help
+
+.. _proutes_script:
+
+``proutes``
+-----------
+
+.. program-output:: proutes --help
+ :cwd: ../../env/bin
+ :prompt:
+ :shell:
+
+.. seealso:: :ref:`displaying_application_routes`
diff --git a/docs/pscripts/pserve.rst b/docs/pscripts/pserve.rst
new file mode 100644
index 000000000..4e41d6e2b
--- /dev/null
+++ b/docs/pscripts/pserve.rst
@@ -0,0 +1,14 @@
+.. index::
+ single: pserve; --help
+
+.. _pserve_script:
+
+``pserve``
+----------
+
+.. program-output:: pserve --help
+ :cwd: ../../env/bin
+ :prompt:
+ :shell:
+
+.. seealso:: :ref:`running_the_project_application`
diff --git a/docs/pscripts/pshell.rst b/docs/pscripts/pshell.rst
new file mode 100644
index 000000000..fd85a11a9
--- /dev/null
+++ b/docs/pscripts/pshell.rst
@@ -0,0 +1,14 @@
+.. index::
+ single: pshell; --help
+
+.. _pshell_script:
+
+``pshell``
+----------
+
+.. program-output:: pshell --help
+ :cwd: ../../env/bin
+ :prompt:
+ :shell:
+
+.. seealso:: :ref:`interactive_shell`
diff --git a/docs/pscripts/ptweens.rst b/docs/pscripts/ptweens.rst
new file mode 100644
index 000000000..e8c0d1ad0
--- /dev/null
+++ b/docs/pscripts/ptweens.rst
@@ -0,0 +1,14 @@
+.. index::
+ single: ptweens; --help
+
+.. _ptweens_script:
+
+``ptweens``
+-----------
+
+.. program-output:: ptweens --help
+ :cwd: ../../env/bin
+ :prompt:
+ :shell:
+
+.. seealso:: :ref:`displaying_tweens`
diff --git a/docs/pscripts/pviews.rst b/docs/pscripts/pviews.rst
new file mode 100644
index 000000000..a1c2f5c2b
--- /dev/null
+++ b/docs/pscripts/pviews.rst
@@ -0,0 +1,14 @@
+.. index::
+ single: pviews; --help
+
+.. _pviews_script:
+
+``pviews``
+----------
+
+.. program-output:: pviews --help
+ :cwd: ../../env/bin
+ :prompt:
+ :shell:
+
+.. seealso:: :ref:`displaying_matching_views`