def protocol(alias_name, default=None, allow_none=False):
    """Get the protocol from the docker link alias or return the default.

    Args:
        alias_name: The docker link alias
        default: The default value if the link isn't available
        allow_none: If the return value can be `None` (i.e. optional)

    Examples:
        Assuming a Docker link was created with ``docker --link postgres:db``
        and the resulting environment variable is ``DB_PORT=tcp://172.17.0.82:5432``.

        >>> envitro.docker.protocol('DB')
        tcp
    """
    warnings.warn('Will be removed in v1.0', DeprecationWarning, stacklevel=2)
    try:
        return _split_docker_link(alias_name)[0]
    except KeyError as err:
        if default or allow_none:
            return default
        else:
            raise err
def protocol ( alias_name , default = None , allow_none = False ) : warnings . warn ( 'Will be removed in v1.0' , DeprecationWarning , stacklevel = 2 ) try : return _split_docker_link ( alias_name ) [ 0 ] except KeyError as err : if default or allow_none : return default else : raise err
Get the protocol from the docker link alias or return the default.

    Args:
        alias_name: The docker link alias
        default: The default value if the link isn't available
        allow_none: If the return value can be `None` (i.e. optional)

    Examples:
        Assuming a Docker link was created with ``docker --link postgres:db``
        and the resulting environment variable is ``DB_PORT=tcp://172.17.0.82:5432``.

        >>> envitro.docker.protocol('DB')
        tcp