浏览代码

2010-01-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Added XML-RPC client sample code in Python.
	* doc/aria2c.1.txt
Tatsuhiro Tsujikawa 15 年之前
父节点
当前提交
5d8864caed
共有 4 个文件被更改,包括 48 次插入3 次删除
  1. 5 0
      ChangeLog
  2. 19 2
      doc/aria2c.1
  3. 12 1
      doc/aria2c.1.html
  4. 12 0
      doc/aria2c.1.txt

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2010-01-18  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Added XML-RPC client sample code in Python.
+	* doc/aria2c.1.txt
+
 2010-01-17  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Updated po templates.

+ 19 - 2
doc/aria2c.1

@@ -2,12 +2,12 @@
 .\"     Title: aria2c
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\"      Date: 01/17/2010
+.\"      Date: 01/18/2010
 .\"    Manual: Aria2 Manual
 .\"    Source: Aria2 1.8.1
 .\"  Language: English
 .\"
-.TH "ARIA2C" "1" "01/17/2010" "Aria2 1\&.8\&.1" "Aria2 Manual"
+.TH "ARIA2C" "1" "01/18/2010" "Aria2 1\&.8\&.1" "Aria2 Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -2543,6 +2543,23 @@ pp result
 .if n \{\
 .RE
 .\}
+.sp
+If you are a Python lover, you can use xmlrpclib(for Python3\&.x, use xmlrpc\&.client instead) to interact with aria2\&.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+import xmlrpclib
+from pprint import pprint
+
+s = xmlrpclib\&.ServerProxy("http://localhost:6800/rpc")
+r = s\&.aria2\&.addUri(["http://localhost/aria2\&.tar\&.bz2"], {"dir":"/downloads"})
+pprint(r)
+.fi
+.if n \{\
+.RE
+.\}
 .SH "EXAMPLE"
 .SS "HTTP/FTP Segmented Download"
 .sp

+ 12 - 1
doc/aria2c.1.html

@@ -3229,6 +3229,17 @@ result=client.call("aria2.addUri", [ "http://localhost/aria2.tar.bz2" ], options
 
 pp result</tt></pre>
 </div></div>
+<div class="paragraph"><p>If you are a Python lover, you can use xmlrpclib(for Python3.x, use
+xmlrpc.client instead) to interact with aria2.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>import xmlrpclib
+from pprint import pprint
+
+s = xmlrpclib.ServerProxy("http://localhost:6800/rpc")
+r = s.aria2.addUri(["http://localhost/aria2.tar.bz2"], {"dir":"/downloads"})
+pprint(r)</tt></pre>
+</div></div>
 </div>
 <h2 id="_example">EXAMPLE</h2>
 <div class="sectionbody">
@@ -3637,7 +3648,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-01-17 23:01:25 JST
+Last updated 2010-01-18 23:42:25 JST
 </div>
 </div>
 </body>

+ 12 - 0
doc/aria2c.1.txt

@@ -1563,6 +1563,18 @@ result=client.call("aria2.addUri", [ "http://localhost/aria2.tar.bz2" ], options
 pp result
 ----------------------------------------------
 
+If you are a Python lover, you can use xmlrpclib(for Python3.x, use
+xmlrpc.client instead) to interact with aria2.
+
+----------------------------------------------
+import xmlrpclib
+from pprint import pprint
+
+s = xmlrpclib.ServerProxy("http://localhost:6800/rpc")
+r = s.aria2.addUri(["http://localhost/aria2.tar.bz2"], {"dir":"/downloads"})
+pprint(r)
+----------------------------------------------
+
 EXAMPLE
 -------