From 35935462c242d67add8883f7e6dcb8a62d215721 Mon Sep 17 00:00:00 2001 From: German Larrain Date: Wed, 24 Jul 2013 20:04:57 -0400 Subject: [PATCH 1/2] fixed module docstring location (all imports must be below them) --- src/SOAPpy/Client.py | 5 +++-- src/SOAPpy/GSIServer.py | 4 ++-- src/SOAPpy/NS.py | 4 ++-- src/SOAPpy/Server.py | 4 ++-- src/SOAPpy/Types.py | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/SOAPpy/Client.py b/src/SOAPpy/Client.py index 3749879..52f8a29 100644 --- a/src/SOAPpy/Client.py +++ b/src/SOAPpy/Client.py @@ -1,5 +1,3 @@ -from __future__ import nested_scopes - """ ################################################################################ # @@ -40,7 +38,10 @@ from __future__ import nested_scopes # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ################################################################################ + """ +from __future__ import nested_scopes + ident = '$Id: Client.py 1496 2010-03-04 23:46:17Z pooryorick $' from version import __version__ diff --git a/src/SOAPpy/GSIServer.py b/src/SOAPpy/GSIServer.py index 39f836c..16ae8d2 100644 --- a/src/SOAPpy/GSIServer.py +++ b/src/SOAPpy/GSIServer.py @@ -1,5 +1,3 @@ -from __future__ import nested_scopes - """ GSIServer - Contributed by Ivan R. Judson @@ -43,7 +41,9 @@ GSIServer - Contributed by Ivan R. Judson # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ################################################################################ + """ +from __future__ import nested_scopes ident = '$Id: GSIServer.py 1468 2008-05-24 01:55:33Z warnes $' from version import __version__ diff --git a/src/SOAPpy/NS.py b/src/SOAPpy/NS.py index 124dad0..c112e5b 100644 --- a/src/SOAPpy/NS.py +++ b/src/SOAPpy/NS.py @@ -1,5 +1,3 @@ -from __future__ import nested_scopes - """ ################################################################################ # @@ -40,7 +38,9 @@ from __future__ import nested_scopes # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ################################################################################ + """ +from __future__ import nested_scopes ident = '$Id: NS.py 1468 2008-05-24 01:55:33Z warnes $' from version import __version__ diff --git a/src/SOAPpy/Server.py b/src/SOAPpy/Server.py index a01a105..0a3befe 100644 --- a/src/SOAPpy/Server.py +++ b/src/SOAPpy/Server.py @@ -1,5 +1,3 @@ -from __future__ import nested_scopes - """ ################################################################################ # @@ -40,7 +38,9 @@ from __future__ import nested_scopes # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ################################################################################ + """ +from __future__ import nested_scopes ident = '$Id: Server.py 1468 2008-05-24 01:55:33Z warnes $' from version import __version__ diff --git a/src/SOAPpy/Types.py b/src/SOAPpy/Types.py index 8cfee53..0856732 100644 --- a/src/SOAPpy/Types.py +++ b/src/SOAPpy/Types.py @@ -1,5 +1,3 @@ -from __future__ import nested_scopes - """ ################################################################################ # Copyright (c) 2003, Pfizer @@ -33,7 +31,9 @@ from __future__ import nested_scopes # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ################################################################################ + """ +from __future__ import nested_scopes ident = '$Id: Types.py 1496 2010-03-04 23:46:17Z pooryorick $' from version import __version__ From e74c636ca22130b18997017fddb116f9f7f9c905 Mon Sep 17 00:00:00 2001 From: German Larrain Date: Wed, 24 Jul 2013 20:17:44 -0400 Subject: [PATCH 2/2] Client.HTTPWithTimeout: fixed constructor's docstring and comments -named the diferences with respect to the overriden method -fixed wrong reference to class in module 'httplib' -added documentation of param 'timeout' -removed redundant comments --- src/SOAPpy/Client.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/SOAPpy/Client.py b/src/SOAPpy/Client.py index 52f8a29..c073c53 100644 --- a/src/SOAPpy/Client.py +++ b/src/SOAPpy/Client.py @@ -135,17 +135,19 @@ class HTTPWithTimeout(HTTP): _connection_class = HTTPConnectionWithTimeout - ## this __init__ copied from httplib.HTML class def __init__(self, host='', port=None, strict=None, timeout=None): - "Provide a default host, since the superclass requires one." + """Slight modification of superclass (httplib.HTTP) constructor. - # some joker passed 0 explicitly, meaning default port + The only change is that arg ``timeout`` is also passed in the + initialization of :attr:`_connection_class`. + + :param timeout: for the socket connection (seconds); None to disable + :type timeout: float or None + + """ if port == 0: port = None - # Note that we may pass an empty string as the host; this will throw - # an error when we attempt to connect. Presumably, the client code - # will call connect before then, with a proper host. self._setup(self._connection_class(host, port, strict, timeout)) class HTTPTransport: