def attach_server(host, port, cert=None, key=None, chain=None):
 if (sabnzbd.cfg.ipv6_hosting() or ('::1' not in host)):
  http_server = cherrypy._cpserver.Server()
  http_server.bind_addr = (host, port)
  if (cert and key):
   http_server.ssl_provider = 'builtin'
   http_server.ssl_certificate = cert
   http_server.ssl_private_key = key
   http_server.ssl_certificate_chain = chain
  http_server.subscribe()

def attach_server ( host , port , cert = None , key = None , chain = None ) : if ( sabnzbd . cfg . ipv6_hosting ( ) or ( '::1' not in host ) ) : http_server = cherrypy . _cpserver . Server ( ) http_server . bind_addr = ( host , port ) if ( cert and key ) : http_server . ssl_provider = 'builtin' http_server . ssl_certificate = cert http_server . ssl_private_key = key http_server . ssl_certificate_chain = chain http_server . subscribe ( )
define and attach server .