[Sugar-devel] [PATCH] Time out on registration process to prevent indefinite UI hang (SL#2289)

Sascha Silbe sascha-ml-reply-to-2010-3 at silbe.org
Sat Sep 18 14:00:31 EDT 2010


Excerpts from Dipankar Patro's message of Sat Sep 18 19:18:55 +0200 2010:

> +class TimeoutHTTP(httplib.HTTP):
> +    def __init__(self, host='', port=None, strict=None, timeout = None):
> +        if port == 0:
> +            port = None
> +        # FIXME: we are depending on undocumented internals that can break
> +        #  between Python releases.

             ^ extra space

> +        self._setup(self._connection_class(host,
> +                port, strict, timeout = REGISTER_TIMEOUT))
> +
> +class TimeoutTransport(xmlrpclib.Transport):
> +    def make_connection(self, host):
> +        host, extra_headers, x509 = self.get_host_info(host)
> +        return TimeoutHTTP(host, timeout = REGISTER_TIMEOUT)
> +
>  def register_laptop(url=REGISTER_URL):

Please run pep8 [1] and fix any error your patch adds (hint: two
newlines each around classes).

Apart from the whitespace issues your patch looks fine.
Reviewed-By: Sascha Silbe <sascha-pgp at silbe.org>

Sascha

[1] https://wiki.sugarlabs.org/go/Development_Team/Code_guidelines#Tools
--
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100918/3d3fb37f/attachment.pgp 


More information about the Sugar-devel mailing list