浏览代码

2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Added XML-RPC code example for options.
	* doc/aria2c.1.txt
Tatsuhiro Tsujikawa 15 年之前
父节点
当前提交
119cf01f6c
共有 4 个文件被更改,包括 48 次插入1 次删除
  1. 5 0
      ChangeLog
  2. 18 0
      doc/aria2c.1
  3. 13 1
      doc/aria2c.1.html
  4. 12 0
      doc/aria2c.1.txt

+ 5 - 0
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>
 2010-10-30  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 
 	Added internal cross reference for sections and subsections.
 	Added internal cross reference for sections and subsections.

+ 18 - 0
doc/aria2c.1

@@ -3458,6 +3458,24 @@ In the option struct, name element is option name(without preceding "\-\-") and
 .if n \{\
 .if n \{\
 .RE
 .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"
 .SS "Sample XML\-RPC Client Code"
 .sp
 .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\&.
 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\&.

+ 13 - 1
doc/aria2c.1.html

@@ -4088,6 +4088,18 @@ as well as string.</p></div>
   &lt;/member&gt;
   &lt;/member&gt;
 &lt;/struct&gt;</tt></pre>
 &lt;/struct&gt;</tt></pre>
 </div></div>
 </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>&gt;&gt;&gt; import xmlrpclib
+&gt;&gt;&gt; s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
+&gt;&gt;&gt; opts = dict(dir='/tmp',
+...             header=['Accept-Language: ja',
+...                     'Accept-Charset: utf-8'])
+&gt;&gt;&gt; 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>
 <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
 <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
 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="footnotes"><hr /></div>
 <div id="footer">
 <div id="footer">
 <div id="footer-text">
 <div id="footer-text">
-Last updated 2010-10-30 13:03:13 JST
+Last updated 2010-10-30 13:13:28 JST
 </div>
 </div>
 </div>
 </div>
 </body>
 </body>

+ 12 - 0
doc/aria2c.1.txt

@@ -2136,6 +2136,18 @@ as well as string.
 </struct>
 </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
 Sample XML-RPC Client Code
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~