update docs
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils 0.8.1: http://docutils.sourceforge.net/" />
|
||||
<title>libtorrent python binding</title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@rasterbar.com" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/base.css" />
|
||||
@@ -67,12 +67,12 @@
|
||||
which is a python module that can be imported in a python program.</p>
|
||||
<div class="section" id="building-using-setup-py">
|
||||
<h2>building using setup.py</h2>
|
||||
<p>There is a <tt class="docutils literal"><span class="pre">setup.py</span></tt> shipped with libtorrent that can be used on windows.
|
||||
On windows the setup.py will invoke <tt class="docutils literal"><span class="pre">bjam</span></tt> and assume that you have boost
|
||||
sources at <tt class="docutils literal"><span class="pre">$BOOST_PATH</span></tt>. The resulting executable is self-contained, it does
|
||||
<p>There is a <tt class="docutils literal">setup.py</tt> shipped with libtorrent that can be used on windows.
|
||||
On windows the setup.py will invoke <tt class="docutils literal">bjam</tt> and assume that you have boost
|
||||
sources at <tt class="docutils literal">$BOOST_PATH</tt>. The resulting executable is self-contained, it does
|
||||
not depend any boost or libtorrent dlls.</p>
|
||||
<p>On other systems, the setup.py is generated by running
|
||||
<tt class="docutils literal"><span class="pre">./configure</span> <span class="pre">--enable-python-binding</span></tt>.</p>
|
||||
<tt class="docutils literal">./configure <span class="pre">--enable-python-binding</span></tt>.</p>
|
||||
<p>To build the Python bindings do:</p>
|
||||
<ol class="arabic">
|
||||
<li><p class="first">Run:</p>
|
||||
@@ -104,8 +104,8 @@ using python : 2.6 : /usr/bin/python2.6 : /usr/include/python2.6 : /usr/lib/pyth
|
||||
<p>The bindings require <em>at least</em> python version 2.2.</p>
|
||||
<p>For more information on how to install and set up boost-build, see the
|
||||
<a class="reference external" href="building.html#step-2-setup-bbv2">building libtorrent</a> section.</p>
|
||||
<p>Once you have boost-build set up, you cd to the <tt class="docutils literal"><span class="pre">bindings/python</span></tt>
|
||||
directory and invoke <tt class="docutils literal"><span class="pre">bjam</span></tt> with the apropriate settings. For the available
|
||||
<p>Once you have boost-build set up, you cd to the <tt class="docutils literal">bindings/python</tt>
|
||||
directory and invoke <tt class="docutils literal">bjam</tt> with the apropriate settings. For the available
|
||||
build variants, see <a class="reference external" href="building.html#step-3-building-libtorrent">libtorrent build options</a>.</p>
|
||||
<p>For example:</p>
|
||||
<pre class="literal-block">
|
||||
@@ -124,7 +124,7 @@ the <a class="reference external" href="manual.html">main library reference</a>.
|
||||
<dl class="docutils">
|
||||
<dt>asio::tcp::endpoint</dt>
|
||||
<dd>The endpoint type is represented as a tuple of a string (as the address) and an int for
|
||||
the port number. E.g. <tt class="docutils literal"><span class="pre">('127.0.0.1',</span> <span class="pre">6881)</span></tt> represents the localhost port 6881.</dd>
|
||||
the port number. E.g. <tt class="docutils literal">('127.0.0.1', 6881)</tt> represents the localhost port 6881.</dd>
|
||||
<dt>libtorrent::time_duration</dt>
|
||||
<dd>The time duration is represented as a number of seconds in a regular integer.</dd>
|
||||
</dl>
|
||||
@@ -139,13 +139,13 @@ a list of entries.</p>
|
||||
</ul>
|
||||
<p><tt class="docutils literal"><span class="pre">create_torrent::add_node()</span></tt> takes two arguments, one string and one integer,
|
||||
instead of a pair. The string is the address and the integer is the port.</p>
|
||||
<p><tt class="docutils literal"><span class="pre">session::set_settings()</span></tt> not only accepts a <tt class="docutils literal"><span class="pre">session_settings</span></tt> object, but also
|
||||
a dictionary with keys matching the names of the members of the <tt class="docutils literal"><span class="pre">session_settings</span></tt> struct.
|
||||
When calling <tt class="docutils literal"><span class="pre">set_settings</span></tt>, the dictionary does not need to have every settings set,
|
||||
<p><tt class="docutils literal"><span class="pre">session::set_settings()</span></tt> not only accepts a <tt class="docutils literal">session_settings</tt> object, but also
|
||||
a dictionary with keys matching the names of the members of the <tt class="docutils literal">session_settings</tt> struct.
|
||||
When calling <tt class="docutils literal">set_settings</tt>, the dictionary does not need to have every settings set,
|
||||
keys that are not present, are set to their default value.</p>
|
||||
<p>For backwards compatibility, <tt class="docutils literal"><span class="pre">session::settings()</span></tt> still returns a <tt class="docutils literal"><span class="pre">session_settings</span></tt>
|
||||
<p>For backwards compatibility, <tt class="docutils literal"><span class="pre">session::settings()</span></tt> still returns a <tt class="docutils literal">session_settings</tt>
|
||||
struct. To get a python dictionary of the settings, call <tt class="docutils literal"><span class="pre">session::get_settings</span></tt>.</p>
|
||||
<p>For an example python program, see <tt class="docutils literal"><span class="pre">client.py</span></tt> in the <tt class="docutils literal"><span class="pre">bindings/python</span></tt>
|
||||
<p>For an example python program, see <tt class="docutils literal">client.py</tt> in the <tt class="docutils literal">bindings/python</tt>
|
||||
directory.</p>
|
||||
<p>A very simple example usage of the module would be something like this:</p>
|
||||
<pre class="literal-block">
|
||||
|
Reference in New Issue
Block a user