[Pkg-privacy-commits] [pyptlib] 99/136: update doc and examples for method rename

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:25:15 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository pyptlib.

commit 8dcae3890205eb4a07fa5abc1ea1240c49184918
Author: Ximin Luo <infinity0 at gmx.com>
Date:   Mon Sep 2 18:57:19 2013 +0100

    update doc and examples for method rename
---
 examples/client.py |  4 ++--
 examples/server.py |  4 ++--
 sphinx/API.rst     | 14 +++++++-------
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/examples/client.py b/examples/client.py
index d165066..41e81a9 100755
--- a/examples/client.py
+++ b/examples/client.py
@@ -11,12 +11,12 @@ from pyptlib.config import EnvError
 if __name__ == '__main__':
     client = ClientTransportPlugin()
     try:
-        managed_info = client.init(["blackfish", "bluefish"])
+        client.init(["blackfish", "bluefish"])
     except EnvError, err:
         print "pyptlib could not bootstrap ('%s')." % str(err)
         sys.exit(1)
 
-    for transport in managed_info['transports']:
+    for transport in client.getTransports():
         # Spawn all the transports in the list, and for each spawned
         # transport report back the port where it is listening, and
         # the SOCKS version it supports.
diff --git a/examples/server.py b/examples/server.py
index bef188d..8700b06 100755
--- a/examples/server.py
+++ b/examples/server.py
@@ -11,12 +11,12 @@ from pyptlib.config import EnvError
 if __name__ == '__main__':
     server = ServerTransportPlugin()
     try:
-        managed_info = server.init(["blackfish", "bluefish"])
+        server.init(["blackfish", "bluefish"])
     except EnvError, err:
         print "pyptlib could not bootstrap ('%s')." % str(err)
         sys.exit(1)
 
-    for transport, transport_bindaddr in managed_info['transports'].items():
+    for transport, transport_bindaddr in server.getBindAddresses().items():
         # Try to spawn transports and make them listen in the ports
         # that Tor wants. Report failure or success appropriately.
 
diff --git a/sphinx/API.rst b/sphinx/API.rst
index 00de4d6..f356217 100644
--- a/sphinx/API.rst
+++ b/sphinx/API.rst
@@ -75,8 +75,8 @@ the documentation for that module.
 Client case (skip if you are a server)
 """""""""""""""""""""""""""""""""""""""""""
 
-Your application should then use :func:`client.getServedTransports()
-<pyptlib.core.TransportPlugin.getServedTransports>` to learn which
+Your application should then use :func:`client.getTransports()
+<pyptlib.core.TransportPlugin.getTransports>` to learn which
 transports it should launch.
 
 Proceeding with the previous example:
@@ -84,9 +84,9 @@ Proceeding with the previous example:
 .. code-block::
    python
 
-   if 'rot13' in client.getServedTransports():
+   if 'rot13' in client.getTransports():
        launch_rot13_client()
-   if 'rot26' in client.getServedTransports():
+   if 'rot26' in client.getTransports():
        launch_rot26_client()
 
 
@@ -96,8 +96,8 @@ Proceeding with the previous example:
 Server case (skip if you are a client):
 """"""""""""""""""""""""""""""""""""""""""""
 
-Your application should then use :func:`server.getServedBindAddresses()
-<pyptlib.server.ServerTransportPlugin.getServedBindAddresses>` to
+Your application should then use :func:`server.getBindAddresses()
+<pyptlib.server.ServerTransportPlugin.getBindAddresses>` to
 learn which transports it should launch.
 
 Since the application runs as a server, it will push data to Tor's
@@ -109,7 +109,7 @@ Proceeding with the previous example:
 .. code-block::
    python
 
-   transports = server.getServedBindAddresses()
+   transports = server.getBindAddresses()
    if 'rot13' in transports:
        launch_rot13_server(transports['rot13'], server.config.getORPort())
    if 'rot26' in transports:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/pyptlib.git



More information about the Pkg-privacy-commits mailing list