def _link_environment(protocol, alias, local_port, hostname, remote_port):
 alias = alias.upper()
 base = (u'%s_PORT_%d_%s' % (alias, local_port, protocol.upper()))
 return {base: (u'%s://%s:%d' % (protocol, hostname, remote_port)), (base + u'_ADDR'): hostname, (base + u'_PORT'): (u'%d' % (remote_port,)), (base + u'_PROTO'): protocol}

def _link_environment ( protocol , alias , local_port , hostname , remote_port ) : alias = alias . upper ( ) base = ( u'%s_PORT_%d_%s' % ( alias , local_port , protocol . upper ( ) ) ) return { base : ( u'%s://%s:%d' % ( protocol , hostname , remote_port ) ) , ( base + u'_ADDR' ) : hostname , ( base + u'_PORT' ) : ( u'%d' % ( remote_port , ) ) , ( base + u'_PROTO' ) : protocol }
generate the environment variables used for defining a docker link .