def run_simple(hostname, port, application, use_reloader=False, use_debugger=False, use_evalex=True, extra_files=None, reloader_interval=1, reloader_type='auto', threaded=False, processes=1, request_handler=None, static_files=None, passthrough_errors=False, ssl_context=None):
 if use_debugger:
  from werkzeug.debug import DebuggedApplication
  application = DebuggedApplication(application, use_evalex)
 if static_files:
  from werkzeug.wsgi import SharedDataMiddleware
  application = SharedDataMiddleware(application, static_files)
 def log_startup(sock):
  display_hostname = (((hostname not in ('', '*')) and hostname) or 'localhost')
  if (':' in display_hostname):
   display_hostname = ('[%s]' % display_hostname)
  quit_msg = '(Press CTRL+C to quit)'
  port = sock.getsockname()[1]
  _log('info', ' * Running on %s://%s:%d/ %s', (((ssl_context is None) and 'http') or 'https'), display_hostname, port, quit_msg)
 def inner():
  try:
   fd = int(os.environ['WERKZEUG_SERVER_FD'])
  except (LookupError, ValueError):
   fd = None
  srv = make_server(hostname, port, application, threaded, processes, request_handler, passthrough_errors, ssl_context, fd=fd)
  if (fd is None):
   log_startup(srv.socket)
  srv.serve_forever()
 if use_reloader:
  if (os.environ.get('WERKZEUG_RUN_MAIN') != 'true'):
   if ((port == 0) and (not can_open_by_fd)):
    raise ValueError('Cannot bind to a random port with enabled reloader if the Python interpreter does not support socket opening by fd.')
   address_family = select_ip_version(hostname, port)
   s = socket.socket(address_family, socket.SOCK_STREAM)
   s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
   s.bind((hostname, port))
   if hasattr(s, 'set_inheritable'):
    s.set_inheritable(True)
   if can_open_by_fd:
    os.environ['WERKZEUG_SERVER_FD'] = str(s.fileno())
    s.listen(LISTEN_QUEUE)
    log_startup(s)
   else:
    s.close()
  from ._reloader import run_with_reloader
  run_with_reloader(inner, extra_files, reloader_interval, reloader_type)
 else:
  inner()

def run_simple ( hostname , port , application , use_reloader = False , use_debugger = False , use_evalex = True , extra_files = None , reloader_interval = 1 , reloader_type = 'auto' , threaded = False , processes = 1 , request_handler = None , static_files = None , passthrough_errors = False , ssl_context = None ) : if use_debugger : from werkzeug . debug import DebuggedApplication application = DebuggedApplication ( application , use_evalex ) if static_files : from werkzeug . wsgi import SharedDataMiddleware application = SharedDataMiddleware ( application , static_files ) def log_startup ( sock ) : display_hostname = ( ( ( hostname not in ( '' , '*' ) ) and hostname ) or 'localhost' ) if ( ':' in display_hostname ) : display_hostname = ( '[%s]' % display_hostname ) quit_msg = '(Press CTRL+C to quit)' port = sock . getsockname ( ) [ 1 ] _log ( 'info' , ' * Running on %s://%s:%d/ %s' , ( ( ( ssl_context is None ) and 'http' ) or 'https' ) , display_hostname , port , quit_msg ) def inner ( ) : try : fd = int ( os . environ [ 'WERKZEUG_SERVER_FD' ] ) except ( LookupError , ValueError ) : fd = None srv = make_server ( hostname , port , application , threaded , processes , request_handler , passthrough_errors , ssl_context , fd = fd ) if ( fd is None ) : log_startup ( srv . socket ) srv . serve_forever ( ) if use_reloader : if ( os . environ . get ( 'WERKZEUG_RUN_MAIN' ) != 'true' ) : if ( ( port == 0 ) and ( not can_open_by_fd ) ) : raise ValueError ( 'Cannot bind to a random port with enabled reloader if the Python interpreter does not support socket opening by fd.' ) address_family = select_ip_version ( hostname , port ) s = socket . socket ( address_family , socket . SOCK_STREAM ) s . setsockopt ( socket . SOL_SOCKET , socket . SO_REUSEADDR , 1 ) s . bind ( ( hostname , port ) ) if hasattr ( s , 'set_inheritable' ) : s . set_inheritable ( True ) if can_open_by_fd : os . environ [ 'WERKZEUG_SERVER_FD' ] = str ( s . fileno ( ) ) s . listen ( LISTEN_QUEUE ) log_startup ( s ) else : s . close ( ) from . _reloader import run_with_reloader run_with_reloader ( inner , extra_files , reloader_interval , reloader_type ) else : inner ( )
run simple external command and return output .