parameters: (self)
return_statement: return '%s://%s' % (scheme, host)
docstring: Return the base for this server.
  
          e.i. scheme://host[:port] or sock file
docstring_summary: Return the base for this server.
docstring_tokens: Return the base for this server .
function: def base(self):
          """Return the base for this server.
  
          e.i. scheme://host[:port] or sock file
          """
          if self.socket_file:
              return self.socket_file
  
          host = self.socket_host
          if host in ('0.0.0.0', '::'):
              # 0.0.0.0 is INADDR_ANY and :: is IN6ADDR_ANY.
              # Look up the host name, which should be the
              # safest thing to spit out in a URL.
              import socket
              host = socket.gethostname()
  
          port = self.socket_port
  
          if self.ssl_certificate:
              scheme = 'https'
              if port != 443:
                  host += ':%s' % port
          else:
              scheme = 'http'
              if port != 80:
                  host += ':%s' % port
  
          return '%s://%s' % (scheme, host)
function_tokens: def base ( self ) : if self . socket_file : return self . socket_file host = self . socket_host if host in ( '0.0.0.0' , '::' ) : # 0.0.0.0 is INADDR_ANY and :: is IN6ADDR_ANY. # Look up the host name, which should be the # safest thing to spit out in a URL. import socket host = socket . gethostname ( ) port = self . socket_port if self . ssl_certificate : scheme = 'https' if port != 443 : host += ':%s' % port else : scheme = 'http' if port != 80 : host += ':%s' % port return '%s://%s' % ( scheme , host )