PING: [was Re: [MERGE] bzr help transport [take 3.. or 4]]

John Arbash Meinel john at arbash-meinel.com
Wed Feb 7 19:44:59 GMT 2007


Goffredo Baroncelli wrote:
> Is anyone still interested in this patch ?  I think I have addressed the 
> principal concerns of Aaron & others: any comments ?
> 
> Goffredo

Sorry about the delay.  I think Robert had some valid concerns about
considering http+pycurl an implementation detail (even though we suggest
it to users from time to time). That 'readonly+' is probably not useful
to include, etc.

At a code level, the main things that I see are PEP8 problems. I can
clean it up, but it would be good for you to understand the basics so
that we don't have to do as much of a cleanup in the future.

Specifically, 2 blank lines between top level classes/functions/etc. So
instead of:

def _get_protocol_handlers():
    """Return a dictionary of {urlprefix: [factory]}"""
    return transport_list_registry

def _set_protocol_handlers(new_handlers):
    """Replace the current protocol handlers dictionary.

    WARNING this will remove all build in protocols. Use with care.
    """
    global transport_list_registry
    transport_list_registry = new_handlers

def _clear_protocol_handlers():
    global transport_list_registry
    transport_list_registry = TransportListRegistry()



It should be:


def _get_protocol_handlers():
    """Return a dictionary of {urlprefix: [factory]}"""
    return transport_list_registry


def _set_protocol_handlers(new_handlers):
    """Replace the current protocol handlers dictionary.

    WARNING this will remove all build in protocols. Use with care.
    """
    global transport_list_registry
    transport_list_registry = new_handlers


def _clear_protocol_handlers():
    global transport_list_registry
    transport_list_registry = TransportListRegistry()


For things like:
class TransportListRegistry(registry.Registry):
    def register_transport_provider(self, key, obj):
        self.get(key).insert(0, registry._ObjectGetter(obj))

You should have a doc string, and a single space. Such as:

class TransportListRegistry(registry.Registry):
    """A registry which simplifies tracking available Transports."""

    def register_transport_provider(self, key, obj):
        self.get(key).insert(0, registry._ObjectGetter(obj))


Do you feel like you have time to work on this for 0.15? It is mostly
just cleanup stuff, so if you are unable, I can probably work on it next
week sometime.

John
=:->



More information about the bazaar mailing list