Skip to content

Commit f054b64

Browse files
committed
Merge python doc rebuild to release.
[SVN r76359]
1 parent 9064a06 commit f054b64

9 files changed

Lines changed: 162 additions & 220 deletions

File tree

doc/tutorial/doc/html/index.html

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
44
<title>Chapter&#160;1.&#160;python 2.0</title>
55
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6-
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
6+
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
77
<link rel="home" href="index.html" title="Chapter&#160;1.&#160;python 2.0">
88
<link rel="next" href="python/hello.html" title="Building Hello World">
99
</head>
@@ -31,7 +31,7 @@
3131
<div><p class="copyright">Copyright &#169; 2002-2005 Joel
3232
de Guzman, David Abrahams</p></div>
3333
<div><div class="legalnotice">
34-
<a name="id759709"></a><p>
34+
<a name="python.legal"></a><p>
3535
Distributed under the Boost Software License, Version 1.0. (See accompanying
3636
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
3737
http://www.boost.org/LICENSE_1_0.txt </a>)
@@ -42,8 +42,8 @@
4242
<p><b>Table of Contents</b></p>
4343
<dl>
4444
<dt><span class="section"><a href="index.html#python.quickstart">QuickStart</a></span></dt>
45-
<dt><span class="section"><a href="python/hello.html"> Building Hello World</a></span></dt>
46-
<dt><span class="section"><a href="python/exposing.html"> Exposing Classes</a></span></dt>
45+
<dt><span class="section"><a href="python/hello.html">Building Hello World</a></span></dt>
46+
<dt><span class="section"><a href="python/exposing.html">Exposing Classes</a></span></dt>
4747
<dd><dl>
4848
<dt><span class="section"><a href="python/exposing.html#python.constructors">Constructors</a></span></dt>
4949
<dt><span class="section"><a href="python/exposing.html#python.class_data_members">Class Data Members</a></span></dt>
@@ -60,7 +60,7 @@
6060
<dt><span class="section"><a href="python/functions.html#python.default_arguments">Default Arguments</a></span></dt>
6161
<dt><span class="section"><a href="python/functions.html#python.auto_overloading">Auto-Overloading</a></span></dt>
6262
</dl></dd>
63-
<dt><span class="section"><a href="python/object.html"> Object Interface</a></span></dt>
63+
<dt><span class="section"><a href="python/object.html">Object Interface</a></span></dt>
6464
<dd><dl>
6565
<dt><span class="section"><a href="python/object.html#python.basic_interface">Basic Interface</a></span></dt>
6666
<dt><span class="section"><a href="python/object.html#python.derived_object_types">Derived Object types</a></span></dt>
@@ -70,8 +70,8 @@
7070
<dt><span class="section"><a href="python/embedding.html">Embedding</a></span></dt>
7171
<dd><dl><dt><span class="section"><a href="python/embedding.html#python.using_the_interpreter">Using the interpreter</a></span></dt></dl></dd>
7272
<dt><span class="section"><a href="python/iterators.html">Iterators</a></span></dt>
73-
<dt><span class="section"><a href="python/exception.html"> Exception Translation</a></span></dt>
74-
<dt><span class="section"><a href="python/techniques.html"> General Techniques</a></span></dt>
73+
<dt><span class="section"><a href="python/exception.html">Exception Translation</a></span></dt>
74+
<dt><span class="section"><a href="python/techniques.html">General Techniques</a></span></dt>
7575
<dd><dl>
7676
<dt><span class="section"><a href="python/techniques.html#python.creating_packages">Creating Packages</a></span></dt>
7777
<dt><span class="section"><a href="python/techniques.html#python.extending_wrapped_objects_in_python">Extending Wrapped Objects in Python</a></span></dt>
@@ -93,8 +93,8 @@
9393
code takes on the look of a kind of declarative interface definition language
9494
(IDL).
9595
</p>
96-
<a name="quickstart.hello_world"></a><h3>
97-
<a name="id759740"></a>
96+
<h3>
97+
<a name="quickstart.hello_world"></a>
9898
Hello World
9999
</h3>
100100
<p>
@@ -121,22 +121,18 @@
121121
That's it. We're done. We can now build this as a shared library. The resulting
122122
DLL is now visible to Python. Here's a sample Python session:
123123
</p>
124-
<p>
125-
</p>
126124
<pre class="programlisting"><span class="special">&gt;&gt;&gt;</span> <span class="keyword">import</span> <span class="identifier">hello_ext</span>
127125
<span class="special">&gt;&gt;&gt;</span> <span class="keyword">print</span> <span class="identifier">hello_ext</span><span class="special">.</span><span class="identifier">greet</span><span class="special">()</span>
128126
<span class="identifier">hello</span><span class="special">,</span> <span class="identifier">world</span>
129127
</pre>
130-
<p>
131-
</p>
132128
<div class="blockquote"><blockquote class="blockquote"><p>
133129
<span class="emphasis"><em><span class="bold"><strong>Next stop... Building your Hello World module
134130
from start to finish...</strong></span></em></span>
135131
</p></blockquote></div>
136132
</div>
137133
</div>
138134
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
139-
<td align="left"><p><small>Last revised: July 01, 2010 at 21:56:58 GMT</small></p></td>
135+
<td align="left"><p><small>Last revised: December 26, 2011 at 21:51:27 GMT</small></p></td>
140136
<td align="right"><div class="copyright-footer"></div></td>
141137
</tr></table>
142138
<hr>

doc/tutorial/doc/html/python/embedding.html

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
44
<title>Embedding</title>
55
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
6-
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
6+
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
77
<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;python 2.0">
88
<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;python 2.0">
99
<link rel="prev" href="object.html" title="Object Interface">
@@ -39,8 +39,8 @@
3939
a lot easier and, in a future version, it may become unnecessary to touch the
4040
Python/C API at all. So stay tuned... <span class="inlinemediaobject"><img src="../images/smiley.png" alt="smiley"></span>
4141
</p>
42-
<a name="embedding.building_embedded_programs"></a><h3>
43-
<a name="id773307"></a>
42+
<h3>
43+
<a name="embedding.building_embedded_programs"></a>
4444
Building embedded programs
4545
</h3>
4646
<p>
@@ -81,8 +81,8 @@
8181
&lt;library-path&gt;$(PYTHON_LIB_PATH)
8282
&lt;find-library&gt;$(PYTHON_EMBEDDED_LIBRARY) ;
8383
</pre>
84-
<a name="embedding.getting_started"></a><h3>
85-
<a name="id773391"></a>
84+
<h3>
85+
<a name="embedding.getting_started"></a>
8686
Getting started
8787
</h3>
8888
<p>
@@ -95,8 +95,7 @@
9595
</li>
9696
<li class="listitem">
9797
Call <a href="http://www.python.org/doc/current/api/initialization.html#l2h-652" target="_top">Py_Initialize</a>()
98-
to start the interpreter and create the <code class="literal"><span class="underline">_main</span>_</code>
99-
module.
98+
to start the interpreter and create the <code class="literal">__main__</code> module.
10099
</li>
101100
<li class="listitem">
102101
Call other Python C API routines to use the interpreter.
@@ -132,8 +131,8 @@
132131
and <a href="../../../../v2/object.html" target="_top">object</a> class templates to
133132
automate the process.
134133
</p>
135-
<a name="using_the_interpreter.running_python_code"></a><h3>
136-
<a name="id773549"></a>
134+
<h3>
135+
<a name="using_the_interpreter.running_python_code"></a>
137136
Running Python code
138137
</h3>
139138
<p>
@@ -152,8 +151,7 @@
152151
The <code class="literal">globals</code> and <code class="literal">locals</code> parameters are
153152
Python dictionaries containing the globals and locals of the context in which
154153
to run the code. For most intents and purposes you can use the namespace
155-
dictionary of the <code class="literal"><span class="underline">_main</span>_</code>
156-
module for both parameters.
154+
dictionary of the <code class="literal">__main__</code> module for both parameters.
157155
</p>
158156
<p>
159157
Boost.python provides a function to import a module:
@@ -165,8 +163,8 @@
165163
first), and returns it.
166164
</p>
167165
<p>
168-
Let's import the <code class="literal"><span class="underline">_main</span>_</code>
169-
module and run some Python code in its namespace:
166+
Let's import the <code class="literal">__main__</code> module and run some Python code
167+
in its namespace:
170168
</p>
171169
<pre class="programlisting"><span class="identifier">object</span> <span class="identifier">main_module</span> <span class="special">=</span> <span class="identifier">import</span><span class="special">(</span><span class="string">"__main__"</span><span class="special">);</span>
172170
<span class="identifier">object</span> <span class="identifier">main_namespace</span> <span class="special">=</span> <span class="identifier">main_module</span><span class="special">.</span><span class="identifier">attr</span><span class="special">(</span><span class="string">"__dict__"</span><span class="special">);</span>
@@ -180,8 +178,8 @@
180178
This should create a file called 'hello.txt' in the current directory containing
181179
a phrase that is well-known in programming circles.
182180
</p>
183-
<a name="using_the_interpreter.manipulating_python_objects"></a><h3>
184-
<a name="id774064"></a>
181+
<h3>
182+
<a name="using_the_interpreter.manipulating_python_objects"></a>
185183
Manipulating Python objects
186184
</h3>
187185
<p>
@@ -197,16 +195,16 @@
197195
<span class="keyword">int</span> <span class="identifier">five_squared</span> <span class="special">=</span> <span class="identifier">extract</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;(</span><span class="identifier">main_namespace</span><span class="special">[</span><span class="string">"result"</span><span class="special">]);</span>
198196
</pre>
199197
<p>
200-
Here we create a dictionary object for the <code class="literal"><span class="underline">_main</span>_</code>
201-
module's namespace. Then we assign 5 squared to the result variable and read
202-
this variable from the dictionary. Another way to achieve the same result
203-
is to use eval instead, which returns the result directly:
198+
Here we create a dictionary object for the <code class="literal">__main__</code> module's
199+
namespace. Then we assign 5 squared to the result variable and read this
200+
variable from the dictionary. Another way to achieve the same result is to
201+
use eval instead, which returns the result directly:
204202
</p>
205203
<pre class="programlisting"><span class="identifier">object</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">eval</span><span class="special">(</span><span class="string">"5 ** 2"</span><span class="special">);</span>
206204
<span class="keyword">int</span> <span class="identifier">five_squared</span> <span class="special">=</span> <span class="identifier">extract</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;(</span><span class="identifier">result</span><span class="special">);</span>
207205
</pre>
208-
<a name="using_the_interpreter.exception_handling"></a><h3>
209-
<a name="id774390"></a>
206+
<h3>
207+
<a name="using_the_interpreter.exception_handling"></a>
210208
Exception handling
211209
</h3>
212210
<p>
@@ -216,13 +214,13 @@
216214
<pre class="programlisting"><span class="keyword">try</span>
217215
<span class="special">{</span>
218216
<span class="identifier">object</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">eval</span><span class="special">(</span><span class="string">"5/0"</span><span class="special">);</span>
219-
<span class="comment">// execution will never get here:
220-
</span> <span class="keyword">int</span> <span class="identifier">five_divided_by_zero</span> <span class="special">=</span> <span class="identifier">extract</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;(</span><span class="identifier">result</span><span class="special">);</span>
217+
<span class="comment">// execution will never get here:</span>
218+
<span class="keyword">int</span> <span class="identifier">five_divided_by_zero</span> <span class="special">=</span> <span class="identifier">extract</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;(</span><span class="identifier">result</span><span class="special">);</span>
221219
<span class="special">}</span>
222220
<span class="keyword">catch</span><span class="special">(</span><span class="identifier">error_already_set</span> <span class="keyword">const</span> <span class="special">&amp;)</span>
223221
<span class="special">{</span>
224-
<span class="comment">// handle the exception in some way
225-
</span><span class="special">}</span>
222+
<span class="comment">// handle the exception in some way</span>
223+
<span class="special">}</span>
226224
</pre>
227225
<p>
228226
The <code class="literal">error_already_set</code> exception class doesn't carry any
@@ -238,12 +236,12 @@
238236
<span class="special">{</span>
239237
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">PyErr_ExceptionMatches</span><span class="special">(</span><span class="identifier">PyExc_ZeroDivisionError</span><span class="special">))</span>
240238
<span class="special">{</span>
241-
<span class="comment">// handle ZeroDivisionError specially
242-
</span> <span class="special">}</span>
239+
<span class="comment">// handle ZeroDivisionError specially</span>
240+
<span class="special">}</span>
243241
<span class="keyword">else</span>
244242
<span class="special">{</span>
245-
<span class="comment">// print all other errors to stderr
246-
</span> <span class="identifier">PyErr_Print</span><span class="special">();</span>
243+
<span class="comment">// print all other errors to stderr</span>
244+
<span class="identifier">PyErr_Print</span><span class="special">();</span>
247245
<span class="special">}</span>
248246
<span class="special">}</span>
249247
</pre>

doc/tutorial/doc/html/python/exception.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
44
<title>Exception Translation</title>
55
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
6-
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
6+
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
77
<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;python 2.0">
88
<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;python 2.0">
99
<link rel="prev" href="iterators.html" title="Iterators">
@@ -24,7 +24,7 @@
2424
</div>
2525
<div class="section">
2626
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
27-
<a name="python.exception"></a> Exception Translation</h2></div></div></div>
27+
<a name="python.exception"></a>Exception Translation</h2></div></div></div>
2828
<p>
2929
All C++ exceptions must be caught at the boundary with Python code. This boundary
3030
is the point where C++ meets Python. Boost.Python provides a default exception

0 commit comments

Comments
 (0)