[Twisted-Python] Re: [Twisted-commits] *With() methods; refactor/rearrangement of various internal classes

Andrew Bennetts andrew-twisted at puzzling.org
Fri Jan 31 01:23:24 EST 2003


On Thu, Jan 30, 2003 at 03:19:34PM -0600, exarkun CVS wrote:
[..snip..]
> Index: Twisted/twisted/internet/tcp.py
> diff -u Twisted/twisted/internet/tcp.py:1.101 Twisted/twisted/internet/tcp.py:1.102
> --- Twisted/twisted/internet/tcp.py:1.101	Wed Jan 29 01:02:11 2003
> +++ Twisted/twisted/internet/tcp.py	Thu Jan 30 13:19:31 2003
[..snip..]
> @@ -530,6 +475,25 @@
>      def getHost(self):
>          """Returns a tuple of ('INET', hostname, port).
>  
> -        This indicates the servers address.
> +        This indicates the server's address.
>          """
>          return ('INET',)+self.socket.getsockname()
> +
> +
> +class Connector(base.BaseConnector):
> +    def __init__(self, host, port, factory, timeout, bindAddress, reactor=None):
> +        self.host = host
> +        if isinstance(port, types.StringTypes):
                               ^^^^^^^^^^^^^^^^^ This breaks Python 2.1

Should tcp.py import t.p.compat (ugh)?

Or is it safe to assume that service names for ports will always be ascii
(in which case we change that to "if port == types.StringTypes")?

-Andrew.





More information about the Twisted-Python mailing list