diff --git a/ChangeLog b/ChangeLog index 277891df..1b8486cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-18 Tatsuhiro Tsujikawa + + Added XML-RPC client sample code in Python. + * doc/aria2c.1.txt + 2010-01-17 Tatsuhiro Tsujikawa Updated po templates. diff --git a/doc/aria2c.1 b/doc/aria2c.1 index b2063428..765b6ea1 100644 --- a/doc/aria2c.1 +++ b/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 -.\" 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 diff --git a/doc/aria2c.1.html b/doc/aria2c.1.html index 1b0018c9..0c13629c 100644 --- a/doc/aria2c.1.html +++ b/doc/aria2c.1.html @@ -3229,6 +3229,17 @@ 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

@@ -3637,7 +3648,7 @@ files in the program, then also delete it here.


diff --git a/doc/aria2c.1.txt b/doc/aria2c.1.txt index c39db431..f100ca13 100644 --- a/doc/aria2c.1.txt +++ b/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 -------