From 119cf01f6c4d30fc7648552b7b7c901fa592f013 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> Date: Sat, 30 Oct 2010 04:15:30 +0000 Subject: [PATCH] 2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Added XML-RPC code example for options. * doc/aria2c.1.txt --- ChangeLog | 5 +++++ doc/aria2c.1 | 18 ++++++++++++++++++ doc/aria2c.1.html | 14 +++++++++++++- doc/aria2c.1.txt | 12 ++++++++++++ 4 files changed, 48 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e9ccb0a3..b07ad739 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> + + Added XML-RPC code example for options. + * doc/aria2c.1.txt + 2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Added internal cross reference for sections and subsections. diff --git a/doc/aria2c.1 b/doc/aria2c.1 index 58eee9be..664fecfa 100644 --- a/doc/aria2c.1 +++ b/doc/aria2c.1 @@ -3458,6 +3458,24 @@ In the option struct, name element is option name(without preceding "\-\-") and .if n \{\ .RE .\} +.sp +Following example adds a download with 2 options: dir and header\&. header option has 2 values, so it uses a list: +.sp +.if n \{\ +.RS 4 +.\} +.nf +>>> import xmlrpclib +>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq) +>>> opts = dict(dir=\*(Aq/tmp\*(Aq, +\&.\&.\&. header=[\*(AqAccept\-Language: ja\*(Aq, +\&.\&.\&. \*(AqAccept\-Charset: utf\-8\*(Aq]) +>>> s\&.aria2\&.addUri([\*(Aqhttp://example\&.org/file\*(Aq], opts) +\*(Aq1\*(Aq +.fi +.if n \{\ +.RE +.\} .SS "Sample XML\-RPC Client Code" .sp The following Ruby script adds \fIhttp://localhost/aria2\&.tar\&.bz2\fR to aria2c operated on localhost with option \fB\-\-dir\fR=\fI/downloads\fR and prints its reponse\&. diff --git a/doc/aria2c.1.html b/doc/aria2c.1.html index cefcc6cc..75daec42 100644 --- a/doc/aria2c.1.html +++ b/doc/aria2c.1.html @@ -4088,6 +4088,18 @@ as well as string.</p></div> </member> </struct></tt></pre> </div></div> +<div class="paragraph"><p>Following example adds a download with 2 options: dir and header. +header option has 2 values, so it uses a list:</p></div> +<div class="listingblock"> +<div class="content"> +<pre><tt>>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') +>>> opts = dict(dir='/tmp', +... header=['Accept-Language: ja', +... 'Accept-Charset: utf-8']) +>>> s.aria2.addUri(['http://example.org/file'], opts) +'1'</tt></pre> +</div></div> <h3 id="_sample_xml_rpc_client_code">Sample XML-RPC Client Code</h3><div style="clear:left"></div> <div class="paragraph"><p>The following Ruby script adds <em>http://localhost/aria2.tar.bz2</em> to aria2c operated on localhost with option <strong>--dir</strong>=<em>/downloads</em> and @@ -4538,7 +4550,7 @@ files in the program, then also delete it here.</p></div> <div id="footnotes"><hr /></div> <div id="footer"> <div id="footer-text"> -Last updated 2010-10-30 13:03:13 JST +Last updated 2010-10-30 13:13:28 JST </div> </div> </body> diff --git a/doc/aria2c.1.txt b/doc/aria2c.1.txt index c468abbe..a1b9311e 100644 --- a/doc/aria2c.1.txt +++ b/doc/aria2c.1.txt @@ -2136,6 +2136,18 @@ as well as string. </struct> --------------------------------------------------------------- +Following example adds a download with 2 options: dir and header. +header option has 2 values, so it uses a list: +------------------------------------------------------------------------- +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') +>>> opts = dict(dir='/tmp', +... header=['Accept-Language: ja', +... 'Accept-Charset: utf-8']) +>>> s.aria2.addUri(['http://example.org/file'], opts) +'1' +-------------------------------------------------------------------------- + Sample XML-RPC Client Code ~~~~~~~~~~~~~~~~~~~~~~~~~~