
    g             
          d dl mZmZmZ d dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Z
d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZ	 d dlZddlmZ dej:                  dd z  ZdZdZ dZ!	 d dl"Z" e"jF                  d	      Z e"jF                  d
      Z e  e"jF                  d      Z  e"jF                  d      rt e"jF                  d      rb e"jF                  d      rP ejH                   e"jF                  d       e"jF                  d            Z!ejJ                  jM                  e!      sdZ!dee Z' ejH                   ejP                  e)      e'      Z'ejJ                  jM                  e'      s/er-dedee Z' ejH                   ejP                  e)      e'      Z'ejJ                  jM                  e'      skejT                  dk(  r\d e"jF                  d
      z  Z'ejJ                  jI                  ejJ                  jQ                  e)      e'      Z'e'jW                  dd      Z'd Z,d Z-d Z.dg fdZ/d Z0 e/ddgdg      Z1dZ2dZ3dZ4d Z5d!Z6d"Z7d#Z8d$Z9d%Z:d&Z;d'Z<d(Z=d)Z>d*Z?d+Z@d,ZAd-ZBd.ZCd/ZDd0 ZEd1aFi ZGg aHd2aI ej0                         ZJ ej                         ZLd3 ZMd4 ZNd5 ZO ej                  eO6      ZQd7eQ_R        d8 ZSd9 ZTdd:ZU G d; d<eV      ZW G d= d>eV      ZX G d? d@eV      ZY G dA dBeV      ZZdCZ[dDZ\dEZ]dF Z^dGZ_dH Z`dIZadJZbdK ZcdL Zdg ZedM Zf efdNdOdPdQdRS        efdNdTddUdVS        efdNdWddXdYS        efdNdZd[d\d]d^_        efdNd`dad2dbc        efdNddd\d]def        efdNdgd\d]dhej                  i        efdNdjddkdlS        efdNdmddkdnS        efdNdoddkdpS        efdNdqddkdrS        efdNdsdtdudvdwx        efdNdyddkdzS        efdNd{dad2d|c        efdNd}dad2d~c        efdNddddS        efdNddddS        efdNddtddd        efdNddad2dc        efddd\d]df        efdNdd\dd]d        efddd\dd]d        efddddd]dedd      f  efddddd]dedd        efddddd]dedd        efdNdd\dd]d        efdNdd\d d]d        efddd\ddd        efddd\ddd        efddd\ddd        efddd\ddd        efddd\ddd        efddd\d dd        efddd\ddd        efddd\d dd        efdddtddud        efddd\ddd        efddd\ddd        efdNdd\ddd        efdNdd\ddd        efdNdd\dddì        efdNdd\dddƬ        efdNdd\dddʬ        efdNdd\ddd̬        efdNdd\d ddά        efdNdd\dddЬ        efdNdd\dd]dҬ        efddd\dd]dլ        efddd\d d]d׬        efddd\d d]d٬        efddd\d d]d۬        efddd\d d]dݬ        efddd\d dd߬        efdNddad2dc        efdddad2dc        efdddad2dc        efdd e-       ddS        efdd e.       ddS        efdNddddS        efdNddddS        efdNddd        efdNddd        efdNddad2dc        efdNdddtd         efdNddudd        efdNddtdddd        efdNd	dtdd
dd        efdNddad2dc        efdNddtdddd        efdNddtdddej                          efdNddtdddd        efdNddtg ddd        efdNddtg ddd         efdNd!d\ddd"        efdNd#dad2d$c        efdNd%dad2d&c        efdNd'dad2d(c        efdNd)d*dd+        efdNd,d*dd-        efdNd.dQd/d0        efdNd1d*dd2        efdNd3dd4d5        efdNd6dtd7dkd8        efdNd9dkd:        efdd;dkd<        efdd=ddej                  S        efdNd>ddd?S        efdNd@dtddAdBdC        efdNdDdtdEdFdG        efdNdHddI        efdNdJdkdK        efdNdLddM        efddNdtdOddP        efdNdQddR        efdNdSdTddUS        efdNdVdad2dWc        efddXdad2dYc        efdNdZdad[ej                  \        efdd]dad2d^c        efdNd_d`da      f  efdNdbd`dc      f  efdNddddedf      f  efdNdgddhdi      f  efddjddkdl      f  efddmdad2dnc      f  efddodd\dpdq_      f  efddrej                  dkdsS      f  efdNdtdtduddv        efdNdwddx        efddye1dkdzS        efdd{ej                  dkd|S        efdd}dd~        efdNdej                  ddS        efdd e0       dkdS        efdddd        efdNddtdddd        efdNddad2dc        efdddad2dc        efdddad2dc        efdddad2dc        efdddkdd        efddddd        efdddad2dc        efdNddad2dc        efdddtdddd        efdddtdddd        efdddtdddd        efdddtdddd        efdNddad2dc        efdddad2dc        efdNddad2dc        efdddad2dc        efdddad2dc      f  efdddad2dc      f  efdddad2dc        efddddd        efdddad2dc        efddddd        efdddad2dc        efddddd        efdddad2dìc        efddĐddkdƬS        efdddad2dȬc       dɄ Zkd֐dʄZld˄ Zmd̄ Znd̈́ Zod΄ Zpdτ ZqejT                  dk(  rdZrndZrd҄ Zsdӄ Zteudk(  r es        yy# e$ r d dlZY w xY w# e$ r Y w xY w(      )print_functiondivisionabsolute_importN   )apxs_configz%s%s    z.soSOABI
EXT_SUFFIXSO	WITH_DYLDLIBDIR	LDLIBRARYzmod_wsgi-py.ntz
mod_wsgi%s\/c                      t         S N)MOD_WSGI_SO     u/var/www/html/FastMealFinder_FlaskServer-InitialRelease/venv/lib/python3.12/site-packages/mod_wsgi/server/__init__.pywherer   E   s    r   c                      t         j                  dk(  ry	 dd l} t        j                         }| j	                  |      j
                  S # t        $ r dz  cY S w xY wNr   z#0r   z#%d)osnamepwdgetuidgetpwuidpw_nameKeyError)r   uids     r   default_run_userr%   H   sQ    	ww$iik||C ((( s{s   2A	 	AAc                  &   t         j                  dk(  ry	 dd l} t        j                         }| j	                  |      }	 dd l}|j                  }|j                  |      j                  S # t
        $ r dz  cY S w xY w# t
        $ r dz  cY S w xY wr   )
r   r   r   r    r!   r#   grppw_gidgetgrgidgr_name)r   r$   entryr'   gids        r   default_run_groupr-   S   s    	ww$iikS!ll||C (((  s{  s{s#   )A+  *A? +A<;A<?BBc                     | D ]g  }t         j                  d   j                  d      |z   D ]=  }t        j                  ||      }t         j
                  j                  |      s9|c c S  i |S )NPATH:)r   environsplit	posixpathjoinpathexists)namesdefaultpathsr   r5   programs         r   find_programr;   e   se     JJv&,,S1E9 	DnnT40Gww~~g&	
 Nr   c                  0   t         j                  dk(  rKt        j                  t        j                  t        j                  t
        j                              dd      S dd l} | j                  D ]%  }t         j                  j                  |      s#|c S  y)Nr   confz
mime.typesr   z	/dev/null)r   r   r3   r4   dirnamer   HTTPD	mimetypes
knownfilesr5   r6   )r@   r   s     r   find_mimetypesrB   m   sz    	ww$~~i//	0A0A!!1# $%+\; 	; 	(( 	Dww~~d#	 r   bashshz/usr/local/binaL  
<IfModule !version_module>
LoadModule version_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_version.so'
</IfModule>

ServerName %(host)s
ServerRoot '%(server_root)s'
PidFile '%(pid_file)s'

<IfVersion >= 2.4>
DefaultRuntimeDir '%(server_root)s'
</IfVersion>

ServerTokens ProductOnly
ServerSignature Off

<IfDefine !MOD_WSGI_MPM_ENABLE_WINNT_MODULE>
User ${MOD_WSGI_USER}
Group ${MOD_WSGI_GROUP}
</IfDefine>

<IfDefine MOD_WSGI_WITH_LISTENER_HOST>
Listen %(host)s:%(port)s
</IfDefine>
<IfDefine !MOD_WSGI_WITH_LISTENER_HOST>
Listen %(port)s
</IfDefine>

<IfVersion < 2.4>
LockFile '%(server_root)s/accept.lock'
</IfVersion>

<IfVersion >= 2.4>
<IfDefine MOD_WSGI_WITH_PHP5>
<IfModule !mpm_event_module>
<IfModule !mpm_worker_module>
<IfModule !mpm_prefork_module>
<IfDefine MOD_WSGI_MPM_EXISTS_PREFORK_MODULE>
LoadModule mpm_prefork_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_mpm_prefork.so'
</IfDefine>
</IfModule>
</IfModule>
</IfModule>
</IfDefine>
</IfVersion>

<IfVersion >= 2.4>
<IfModule !mpm_event_module>
<IfModule !mpm_worker_module>
<IfModule !mpm_prefork_module>
<IfDefine MOD_WSGI_MPM_ENABLE_EVENT_MODULE>
LoadModule mpm_event_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_mpm_event.so'
</IfDefine>
<IfDefine MOD_WSGI_MPM_ENABLE_WORKER_MODULE>
LoadModule mpm_worker_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_mpm_worker.so'
</IfDefine>
<IfDefine MOD_WSGI_MPM_ENABLE_PREFORK_MODULE>
LoadModule mpm_prefork_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_mpm_prefork.so'
</IfDefine>
</IfModule>
</IfModule>
</IfModule>
</IfVersion>

<IfDefine MOD_WSGI_WITH_HTTP2>
LoadModule http2_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_http2.so'
</IfDefine>

<IfVersion >= 2.4>
<IfModule !access_compat_module>
LoadModule access_compat_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_access_compat.so'
</IfModule>
<IfDefine !MOD_WSGI_MPM_ENABLE_WINNT_MODULE>
<IfModule !unixd_module>
LoadModule unixd_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_unixd.so'
</IfModule>
</IfDefine>
<IfModule !authn_core_module>
LoadModule authn_core_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_authn_core.so'
</IfModule>
<IfModule !authz_core_module>
LoadModule authz_core_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_authz_core.so'
</IfModule>
</IfVersion>

<IfModule !authz_host_module>
LoadModule authz_host_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_authz_host.so'
</IfModule>
<IfModule !mime_module>
LoadModule mime_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_mime.so'
</IfModule>
<IfModule !rewrite_module>
LoadModule rewrite_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_rewrite.so'
</IfModule>
<IfModule !alias_module>
LoadModule alias_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_alias.so'
</IfModule>
<IfModule !dir_module>
LoadModule dir_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_dir.so'
</IfModule>
<IfModule !env_module>
LoadModule env_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_env.so'
</IfModule>
<IfModule !headers_module>
LoadModule headers_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_headers.so'
</IfModule>
<IfModule !filter_module>
LoadModule filter_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_filter.so'
</IfModule>

<IfDefine MOD_WSGI_DIRECTORY_LISTING>
<IfModule !autoindex_module>
LoadModule autoindex_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_autoindex.so'
</IfModule>
</IfDefine>

<IfVersion >= 2.2.15>
<IfModule !reqtimeout_module>
LoadModule reqtimeout_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_reqtimeout.so'
</IfModule>
</IfVersion>

<IfDefine MOD_WSGI_COMPRESS_RESPONSES>
<IfModule !deflate_module>
LoadModule deflate_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_deflate.so'
</IfModule>
</IfDefine>

<IfDefine MOD_WSGI_AUTH_USER>
<IfModule !auth_basic_module>
LoadModule auth_basic_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_auth_basic.so'
</IfModule>
<IfModule !auth_digest_module>
LoadModule auth_digest_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_auth_digest.so'
</IfModule>
<IfModule !authz_user_module>
LoadModule authz_user_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_authz_user.so'
</IfModule>
</IfDefine>

<IfDefine MOD_WSGI_WITH_PROXY>
<IfModule !proxy_module>
LoadModule proxy_module ${MOD_WSGI_MODULES_DIRECTORY}/mod_proxy.so
</IfModule>
<IfModule !proxy_http_module>
LoadModule proxy_http_module ${MOD_WSGI_MODULES_DIRECTORY}/mod_proxy_http.so
</IfModule>
</IfDefine>

<IfModule mpm_prefork_module>
<IfDefine MOD_WSGI_WITH_PHP5>
<IfModule !php5_module>
Loadmodule php5_module '${MOD_WSGI_MODULES_DIRECTORY}/libphp5.so'
</IfModule>
AddHandler application/x-httpd-php .php
</IfDefine>
</IfModule>

<IfDefine MOD_WSGI_LOAD_PYTHON_DYLIB>
LoadFile '%(python_dylib)s'
</IfDefine>

LoadModule wsgi_module '%(mod_wsgi_so)s'

<IfDefine MOD_WSGI_SERVER_METRICS>
<IfModule !status_module>
LoadModule status_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_status.so'
</IfModule>
</IfDefine>

<IfDefine MOD_WSGI_CGID_SCRIPT>
<IfModule !cgid_module>
LoadModule cgid_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_cgid.so'
</IfModule>
</IfDefine>

<IfDefine MOD_WSGI_CGI_SCRIPT>
<IfModule !cgi_module>
LoadModule cgi_module '${MOD_WSGI_MODULES_DIRECTORY}/mod_cgi.so'
</IfModule>
</IfDefine>

<IfVersion < 2.4>
DefaultType text/plain
</IfVersion>

TypesConfig '%(mime_types)s'

HostnameLookups Off
MaxMemFree 64
Timeout %(socket_timeout)s
ListenBacklog %(server_backlog)s

<IfDefine MOD_WSGI_WITH_HTTP2>
Protocols h2 h2c http/1.1
</IfDefine>

<IfVersion >= 2.2.15>
RequestReadTimeout %(request_read_timeout)s
</IfVersion>

LimitRequestBody %(limit_request_body)s

<Directory />
    AllowOverride None
<IfVersion < 2.4>
    Order deny,allow
    Deny from all
</IfVersion>
<IfVersion >= 2.4>
    Require all denied
</IfVersion>
</Directory>

WSGIPythonHome '%(python_home)s'

WSGIVerboseDebugging '%(verbose_debugging_flag)s'

<IfDefine !MOD_WSGI_MPM_ENABLE_WINNT_MODULE>
<IfDefine MOD_WSGI_WITH_SOCKET_PREFIX>
WSGISocketPrefix %(socket_prefix)s/wsgi
</IfDefine>
<IfDefine !MOD_WSGI_WITH_SOCKET_PREFIX>
WSGISocketPrefix %(server_root)s/wsgi
</IfDefine>
WSGISocketRotation Off
</IfDefine>

<IfDefine EMBEDDED_MODE>
MaxConnectionsPerChild %(maximum_requests)s
</IfDefine>

<IfDefine ORPHAN_INTERPRETER>
WSGIDestroyInterpreter Off
</IfDefine>
<IfDefine !ORPHAN_INTERPRETER>
WSGIDestroyInterpreter On
</IfDefine>

<IfDefine !ONE_PROCESS>
<IfDefine !EMBEDDED_MODE>
WSGIRestrictEmbedded On
<IfDefine MOD_WSGI_MULTIPROCESS>
WSGIDaemonProcess %(host)s:%(port)s \
   display-name='%(daemon_name)s' \
   home='%(working_directory)s' \
   processes=%(processes)s \
   threads=%(threads)s \
   maximum-requests=%(maximum_requests)s \
   python-path='%(python_path)s' \
   python-eggs='%(python_eggs)s' \
   lang='%(lang)s' \
   locale='%(locale)s' \
   listen-backlog=%(daemon_backlog)s \
   queue-timeout=%(queue_timeout)s \
   socket-timeout=%(socket_timeout)s \
   connect-timeout=%(connect_timeout)s \
   request-timeout=%(request_timeout)s \
   inactivity-timeout=%(inactivity_timeout)s \
   startup-timeout=%(startup_timeout)s \
   deadlock-timeout=%(deadlock_timeout)s \
   graceful-timeout=%(graceful_timeout)s \
   eviction-timeout=%(eviction_timeout)s \
   restart-interval=%(restart_interval)s \
   cpu-time-limit=%(cpu_time_limit)s \
   shutdown-timeout=%(shutdown_timeout)s \
   send-buffer-size=%(send_buffer_size)s \
   receive-buffer-size=%(receive_buffer_size)s \
   header-buffer-size=%(header_buffer_size)s \
   response-buffer-size=%(response_buffer_size)s \
   response-socket-timeout=%(response_socket_timeout)s \
   server-metrics=%(server_metrics_flag)s
</IfDefine>
<IfDefine !MOD_WSGI_MULTIPROCESS>
WSGIDaemonProcess %(host)s:%(port)s \
   display-name='%(daemon_name)s' \
   home='%(working_directory)s' \
   threads=%(threads)s \
   maximum-requests=%(maximum_requests)s \
   python-path='%(python_path)s' \
   python-eggs='%(python_eggs)s' \
   lang='%(lang)s' \
   locale='%(locale)s' \
   listen-backlog=%(daemon_backlog)s \
   queue-timeout=%(queue_timeout)s \
   socket-timeout=%(socket_timeout)s \
   connect-timeout=%(connect_timeout)s \
   request-timeout=%(request_timeout)s \
   inactivity-timeout=%(inactivity_timeout)s \
   startup-timeout=%(startup_timeout)s \
   deadlock-timeout=%(deadlock_timeout)s \
   graceful-timeout=%(graceful_timeout)s \
   eviction-timeout=%(eviction_timeout)s \
   restart-interval=%(restart_interval)s \
   cpu-time-limit=%(cpu_time_limit)s \
   shutdown-timeout=%(shutdown_timeout)s \
   send-buffer-size=%(send_buffer_size)s \
   receive-buffer-size=%(receive_buffer_size)s \
   response-buffer-size=%(response_buffer_size)s \
   response-socket-timeout=%(response_socket_timeout)s \
   server-metrics=%(server_metrics_flag)s
</IfDefine>
</IfDefine>
</IfDefine>

WSGICallableObject '%(callable_object)s'
WSGIPassAuthorization On
WSGIMapHEADToGET %(map_head_to_get)s

<IfDefine MOD_WSGI_DISABLE_RELOADING>
WSGIScriptReloading Off
</IfDefine>

<IfDefine EMBEDDED_MODE>
<IfDefine MOD_WSGI_WITH_PYTHON_PATH>
WSGIPythonPath '%(python_path)s'
</IfDefine>
</IfDefine>

<IfDefine ONE_PROCESS>
WSGIRestrictStdin Off
<IfDefine MOD_WSGI_WITH_PYTHON_PATH>
WSGIPythonPath '%(python_path)s'
</IfDefine>
</IfDefine>

<IfDefine MOD_WSGI_SERVER_METRICS>
ExtendedStatus On
</IfDefine>

WSGIServerMetrics %(server_metrics_flag)s

<IfDefine MOD_WSGI_SERVER_STATUS>
<Location /server-status>
    SetHandler server-status
<IfVersion < 2.4>
    Order deny,allow
    Deny from all
    Allow from localhost
</IfVersion>
<IfVersion >= 2.4>
    Require all denied
    Require host localhost
</IfVersion>
</Location>
</IfDefine>

<IfDefine MOD_WSGI_KEEP_ALIVE>
KeepAlive On
KeepAliveTimeout %(keep_alive_timeout)s
</IfDefine>
<IfDefine !MOD_WSGI_KEEP_ALIVE>
KeepAlive Off
</IfDefine>

<IfDefine MOD_WSGI_ENABLE_SENDFILE>
EnableSendfile On
WSGIEnableSendfile On
</IfDefine>

<IfDefine MOD_WSGI_COMPRESS_RESPONSES>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/json
</IfDefine>

<IfDefine MOD_WSGI_ROTATE_LOGS>
ErrorLog "|%(rotatelogs_executable)s \
    %(error_log_file)s.%%Y-%%m-%%d-%%H_%%M_%%S %(max_log_size)sM"
</IfDefine>
<IfDefine !MOD_WSGI_ROTATE_LOGS>
ErrorLog "%(error_log_file)s"
</IfDefine>
LogLevel %(log_level)s

<IfDefine MOD_WSGI_ERROR_LOG_FORMAT>
ErrorLogFormat "%(error_log_format)s"
</IfDefine>

<IfDefine MOD_WSGI_ACCESS_LOG>
<IfModule !log_config_module>
LoadModule log_config_module ${MOD_WSGI_MODULES_DIRECTORY}/mod_log_config.so
</IfModule>
LogFormat "%%h %%l %%u %%t \"%%r\" %%>s %%b" common
LogFormat "%%h %%l %%u %%t \"%%r\" %%>s %%b \"%%{Referer}i\" \"%%{User-agent}i\"" combined
LogFormat "%(access_log_format)s" custom
<IfDefine MOD_WSGI_ROTATE_LOGS>
CustomLog "|%(rotatelogs_executable)s \
    %(access_log_file)s.%%Y-%%m-%%d-%%H_%%M_%%S %(max_log_size)sM" %(log_format_nickname)s
</IfDefine>
<IfDefine !MOD_WSGI_ROTATE_LOGS>
CustomLog "%(access_log_file)s" %(log_format_nickname)s
</IfDefine>
</IfDefine>

<IfDefine MOD_WSGI_CHUNKED_REQUEST>
WSGIChunkedRequest On
</IfDefine>

<IfDefine MOD_WSGI_WITH_PROXY_HEADERS>
WSGITrustedProxyHeaders %(trusted_proxy_headers)s
</IfDefine>
<IfDefine MOD_WSGI_WITH_TRUSTED_PROXIES>
WSGITrustedProxies %(trusted_proxies)s
</IfDefine>

<IfDefine MOD_WSGI_WITH_HTTPS>
<IfModule !ssl_module>
LoadModule ssl_module ${MOD_WSGI_MODULES_DIRECTORY}/mod_ssl.so
</IfModule>
</IfDefine>

<IfModule mpm_prefork_module>
<IfDefine !ONE_PROCESS>
ServerLimit %(prefork_server_limit)s
StartServers %(prefork_start_servers)s
MaxClients %(prefork_max_clients)s
MinSpareServers %(prefork_min_spare_servers)s
MaxSpareServers %(prefork_max_spare_servers)s
</IfDefine>
<IfDefine ONE_PROCESS>
ServerLimit 1
StartServers 1
MaxClients 1
MinSpareServers 1
MaxSpareServers 1
</IfDefine>
MaxRequestsPerChild 0
</IfModule>

<IfModule mpm_worker_module>
<IfDefine !ONE_PROCESS>
ServerLimit %(worker_server_limit)s
ThreadLimit %(worker_thread_limit)s
StartServers %(worker_start_servers)s
MaxClients %(worker_max_clients)s
MinSpareThreads %(worker_min_spare_threads)s
MaxSpareThreads %(worker_max_spare_threads)s
ThreadsPerChild %(worker_threads_per_child)s
</IfDefine>
<IfDefine ONE_PROCESS>
ServerLimit 1
ThreadLimit 1
StartServers 1 
MaxClients 1
MinSpareThreads 1
MaxSpareThreads 1
ThreadsPerChild 1
</IfDefine>
MaxRequestsPerChild 0
ThreadStackSize 262144
</IfModule>

<IfModule mpm_event_module>
<IfDefine !ONE_PROCESS>
ServerLimit %(worker_server_limit)s
ThreadLimit %(worker_thread_limit)s
StartServers %(worker_start_servers)s
MaxClients %(worker_max_clients)s
MinSpareThreads %(worker_min_spare_threads)s
MaxSpareThreads %(worker_max_spare_threads)s
ThreadsPerChild %(worker_threads_per_child)s
</IfDefine>
<IfDefine ONE_PROCESS>
ServerLimit 1
ThreadLimit 1
StartServers 1
MaxClients 1
MinSpareThreads 1
MaxSpareThreads 1
ThreadsPerChild 1
</IfDefine>
MaxRequestsPerChild 0
ThreadStackSize 262144
</IfModule>

<IfDefine !MOD_WSGI_VIRTUAL_HOST>
<IfVersion < 2.4>
NameVirtualHost *:%(port)s
</IfVersion>
<VirtualHost _default_:%(port)s>
</VirtualHost>
</IfDefine>

<IfDefine MOD_WSGI_VIRTUAL_HOST>

<IfVersion < 2.4>
NameVirtualHost *:%(port)s
</IfVersion>
<VirtualHost _default_:%(port)s>
<Location />
<IfVersion < 2.4>
Order deny,allow
Deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
<IfDefine MOD_WSGI_ALLOW_LOCALHOST>
Allow from localhost
</IfDefine>
</Location>
</VirtualHost>
<IfDefine !MOD_WSGI_HTTPS_ONLY>
<VirtualHost *:%(port)s>
ServerName %(server_name)s
<IfDefine MOD_WSGI_SERVER_ALIAS>
ServerAlias %(server_aliases)s
</IfDefine>
</VirtualHost>
<IfDefine MOD_WSGI_REDIRECT_WWW>
<VirtualHost *:%(port)s>
ServerName %(parent_domain)s
Redirect permanent / http://%(server_name)s:%(port)s/
</VirtualHost>
</IfDefine>
</IfDefine>

<IfDefine MOD_WSGI_HTTPS_ONLY>
<VirtualHost *:%(port)s>
ServerName %(server_name)s
<IfDefine MOD_WSGI_SERVER_ALIAS>
ServerAlias %(server_aliases)s
</IfDefine>
RewriteEngine On
RewriteCond %%{HTTPS} off
RewriteRule (.*) https://%(server_name)s:%(https_port)s%%{REQUEST_URI}
</VirtualHost>
<IfDefine MOD_WSGI_REDIRECT_WWW>
<VirtualHost *:%(port)s>
ServerName %(parent_domain)s
RewriteEngine On
RewriteCond %%{HTTPS} off
RewriteRule (.*) https://%(server_name)s:%(https_port)s%%{REQUEST_URI}
</VirtualHost>
</IfDefine>
</IfDefine>

</IfDefine>

<IfDefine MOD_WSGI_VIRTUAL_HOST>

<IfDefine MOD_WSGI_WITH_HTTPS>
<IfDefine MOD_WSGI_WITH_LISTENER_HOST>
Listen %(host)s:%(https_port)s
</IfDefine>
<IfDefine !MOD_WSGI_WITH_LISTENER_HOST>
Listen %(https_port)s
</IfDefine>
<IfVersion < 2.4>
NameVirtualHost *:%(https_port)s
</IfVersion>
<VirtualHost _default_:%(https_port)s>
<Location />
<IfVersion < 2.4>
Order deny,allow
Deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
<IfDefine MOD_WSGI_ALLOW_LOCALHOST>
Allow from localhost
</IfDefine>
</Location>
SSLEngine On
SSLCertificateFile %(ssl_certificate_file)s
SSLCertificateKeyFile %(ssl_certificate_key_file)s
<IfDefine MOD_WSGI_VERIFY_CLIENT>
SSLCACertificateFile %(ssl_ca_certificate_file)s
SSLVerifyClient none
</IfDefine>
<IfDefine MOD_WSGI_CERTIFICATE_CHAIN>
SSLCertificateChainFile %(ssl_certificate_chain_file)s
</IfDefine>
</VirtualHost>
<VirtualHost *:%(https_port)s>
ServerName %(server_name)s
<IfDefine MOD_WSGI_SERVER_ALIAS>
ServerAlias %(server_aliases)s
</IfDefine>
SSLEngine On
SSLCertificateFile %(ssl_certificate_file)s
SSLCertificateKeyFile %(ssl_certificate_key_file)s
<IfDefine MOD_WSGI_VERIFY_CLIENT>
SSLCACertificateFile %(ssl_ca_certificate_file)s
SSLVerifyClient none
</IfDefine>
<IfDefine MOD_WSGI_CERTIFICATE_CHAIN>
SSLCertificateChainFile %(ssl_certificate_chain_file)s
</IfDefine>
<IfDefine MOD_WSGI_HTTPS_ONLY>
<IfDefine MOD_WSGI_HSTS_POLICY>
Header set Strict-Transport-Security %(hsts_policy)s
</IfDefine>
</IfDefine>
<IfDefine MOD_WSGI_SSL_ENVIRONMENT>
SSLOptions +StdEnvVars
</IfDefine>
</VirtualHost>
<IfDefine MOD_WSGI_REDIRECT_WWW>
<VirtualHost *:%(https_port)s>
ServerName %(parent_domain)s
Redirect permanent / https://%(server_name)s:%(https_port)s/
SSLEngine On
SSLCertificateFile %(ssl_certificate_file)s
SSLCertificateKeyFile %(ssl_certificate_key_file)s
<IfDefine MOD_WSGI_VERIFY_CLIENT>
SSLCACertificateFile %(ssl_ca_certificate_file)s
SSLVerifyClient none
</IfDefine>
<IfDefine MOD_WSGI_CERTIFICATE_CHAIN>
SSLCertificateChainFile %(ssl_certificate_chain_file)s
</IfDefine>
</VirtualHost>
</IfDefine>
</IfDefine>

</IfDefine>

DocumentRoot '%(document_root)s'

AccessFileName .htaccess

<Directory '%(server_root)s'>
    AllowOverride %(allow_override)s
<Files handler.wsgi>
<IfVersion < 2.4>
    Order allow,deny
    Allow from all
</IfVersion>
<IfVersion >= 2.4>
    Require all granted
</IfVersion>
</Files>
</Directory>

<Directory '%(document_root)s'>
    AllowOverride %(allow_override)s
<IfDefine MOD_WSGI_DIRECTORY_INDEX>
    DirectoryIndex %(directory_index)s
</IfDefine>
<IfDefine MOD_WSGI_DIRECTORY_LISTING>
    Options +Indexes
</IfDefine>
<IfDefine MOD_WSGI_CGI_SCRIPT>
    Options +ExecCGI
</IfDefine>
<IfDefine MOD_WSGI_CGID_SCRIPT>
    Options +ExecCGI
</IfDefine>
    RewriteEngine On
    Include %(rewrite_rules)s
<IfVersion < 2.4>
    Order allow,deny
    Allow from all
</IfVersion>
<IfVersion >= 2.4>
    Require all granted
</IfVersion>
</Directory>

<Directory '%(document_root)s%(mount_point)s'>
<IfDefine !MOD_WSGI_STATIC_ONLY>
    RewriteCond %%{REQUEST_FILENAME} !-f
<IfDefine MOD_WSGI_DIRECTORY_INDEX>
    RewriteCond %%{REQUEST_FILENAME} !-d
</IfDefine>
<IfDefine MOD_WSGI_SERVER_STATUS>
    RewriteCond %%{REQUEST_URI} !/server-status
</IfDefine>
    RewriteRule .* - [H=wsgi-handler]
</IfDefine>
</Directory>

<IfDefine MOD_WSGI_ERROR_OVERRIDE>
WSGIErrorOverride On
</IfDefine>

<IfDefine MOD_WSGI_HOST_ACCESS>
<Location />
    WSGIAccessScript '%(host_access_script)s'
</Location>
</IfDefine>

<IfDefine MOD_WSGI_AUTH_USER>
<Location />
    AuthType %(auth_type)s
    AuthName '%(host)s:%(port)s'
    Auth%(auth_type)sProvider wsgi
    WSGIAuthUserScript '%(auth_user_script)s'
<IfDefine MOD_WSGI_AUTH_GROUP>
    WSGIAuthGroupScript '%(auth_group_script)s'
</IfDefine>
<IfVersion < 2.4>
    Require valid-user
<IfDefine MOD_WSGI_AUTH_GROUP>
    Require wsgi-group '%(auth_group)s'
</IfDefine>
</IfVersion>
<IfVersion >= 2.4>
    <RequireAll>
    Require valid-user
<IfDefine MOD_WSGI_AUTH_GROUP>
    Require wsgi-group '%(auth_group)s'
</IfDefine>
    </RequireAll>
</IfVersion>
</Location>
</IfDefine>

<IfDefine !ONE_PROCESS>
<IfDefine !EMBEDDED_MODE>
WSGIHandlerScript wsgi-handler '%(server_root)s/handler.wsgi' \
    process-group='%(host)s:%(port)s' application-group=%%{GLOBAL}
WSGIImportScript '%(server_root)s/handler.wsgi' \
    process-group='%(host)s:%(port)s' application-group=%%{GLOBAL}
</IfDefine>
</IfDefine>

<IfDefine EMBEDDED_MODE>
WSGIHandlerScript wsgi-handler '%(server_root)s/handler.wsgi' \
    process-group='%%{GLOBAL}' application-group=%%{GLOBAL}
WSGIImportScript '%(server_root)s/handler.wsgi' \
    process-group='%%{GLOBAL}' application-group=%%{GLOBAL}
</IfDefine>

<IfDefine ONE_PROCESS>
<IfDefine !MOD_WSGI_MPM_ENABLE_WINNT_MODULE>
WSGIHandlerScript wsgi-handler '%(server_root)s/handler.wsgi' \
    process-group='%%{GLOBAL}' application-group=%%{GLOBAL}
WSGIImportScript '%(server_root)s/handler.wsgi' \
    process-group='%%{GLOBAL}' application-group=%%{GLOBAL}
</IfDefine>
<IfDefine MOD_WSGI_MPM_ENABLE_WINNT_MODULE>
WSGIHandlerScript wsgi-handler '%(server_root)s/handler.wsgi' \
    application-group=%%{GLOBAL}
WSGIImportScript '%(server_root)s/handler.wsgi' \
    application-group=%%{GLOBAL}
</IfDefine>
</IfDefine>
z8
<Location '%(url)s'>
WSGIIgnoreActivity On
</Location>
a|  
ProxyPass '%(mount_point)s' '%(url)s'
ProxyPassReverse '%(mount_point)s' '%(url)s'
<Location '%(mount_point)s'>
RewriteEngine On
RewriteRule .* - [E=SERVER_PORT:%%{SERVER_PORT},NE]
RequestHeader set X-Forwarded-Port %%{SERVER_PORT}e
RewriteCond %%{HTTPS} on
RewriteRule .* - [E=URL_SCHEME:https,NE]
RequestHeader set X-Forwarded-Scheme %%{URL_SCHEME}e env=URL_SCHEME
</Location>
a  
ProxyPass '%(mount_point)s/' '%(url)s/'
ProxyPassReverse '%(mount_point)s/' '%(url)s/'
<Location '%(mount_point)s/'>
RewriteEngine On
RewriteRule .* - [E=SERVER_PORT:%%{SERVER_PORT},NE]
RequestHeader set X-Forwarded-Port %%{SERVER_PORT}e
RewriteCond %%{HTTPS} on
RewriteRule .* - [E=URL_SCHEME:https,NE]
RequestHeader set X-Forwarded-Scheme %%{URL_SCHEME}e env=URL_SCHEME
</Location>
<LocationMatch '^%(mount_point)s$'>
RewriteEngine On
RewriteRule - http://%%{HTTP_HOST}%%{REQUEST_URI}/ [R=302,L]
</LocationMatch>
a3  
<VirtualHost *:%(port)s>
ServerName %(host)s
ProxyPass / '%(url)s'
ProxyPassReverse / '%(url)s'
RequestHeader set X-Forwarded-Port %(port)s
RewriteEngine On
RewriteCond %%{HTTPS} on
RewriteRule .* - [E=URL_SCHEME:https,NE]
RequestHeader set X-Forwarded-Scheme %%{URL_SCHEME}e env=URL_SCHEME
</VirtualHost>
z
Alias '%(mount_point)s' '%(directory)s'

<Directory '%(directory)s'>
    AllowOverride %(allow_override)s
<IfVersion < 2.4>
    Order allow,deny
    Allow from all
</IfVersion>
<IfVersion >= 2.4>
    Require all granted
</IfVersion>
</Directory>
z
Alias '%(mount_point)s' '%(directory)s/%(filename)s'

<Directory '%(directory)s'>
<Files '%(filename)s'>
<IfVersion < 2.4>
    Order allow,deny
    Allow from all
</IfVersion>
<IfVersion >= 2.4>
    Require all granted
</IfVersion>
</Files>
</Directory>
a  
Alias /__wsgi__/docs '%(documentation_directory)s'
Alias /__wsgi__/images '%(images_directory)s'

<Directory '%(documentation_directory)s'>
    DirectoryIndex index.html
<IfVersion < 2.4>
    Order allow,deny
    Allow from all
</IfVersion>
<IfVersion >= 2.4>
    Require all granted
</IfVersion>
</Directory>

<Directory '%(images_directory)s'>
<IfVersion < 2.4>
    Order allow,deny
    Allow from all
</IfVersion>
<IfVersion >= 2.4>
    Require all granted
</IfVersion>
</Directory>
zz
<IfDefine MOD_WSGI_VERIFY_CLIENT>
<Location '%(path)s'>
SSLVerifyClient require
SSLVerifyDepth 1
</Location>
</IfDefine>
z+
ErrorDocument '%(status)s' '%(document)s'
z
SetEnv '%(name)s' '%(value)s'
z
PassEnv '%(name)s'
z
WSGIHandlerScript wsgi-resource '%(server_root)s/resource.wsgi' \
    process-group='%(host)s:%(port)s' application-group=%%{GLOBAL}
z&
AddHandler %(handler)s %(extension)s
z
Include '%(filename)s'
zN
WSGIDaemonProcess express display-name=%%{GROUP} threads=1 server-metrics=On
zs
WSGIImportScript '%(server_root)s/server-metrics.py' \
    process-group=express application-group=server-metrics
a  
WSGIDaemonProcess 'service:%(name)s' \
    display-name=%%{GROUP} \
    user='%(user)s' \
    group='%(group)s' \
    home='%(working_directory)s' \
    threads=0 \
    python-path='%(python_path)s' \
    python-eggs='%(python_eggs)s' \
    lang='%(lang)s' \
    locale='%(locale)s' \
    server-metrics=%(server_metrics_flag)s
WSGIImportScript '%(script)s' \
    process-group='service:%(name)s' \
    application-group=%%{GLOBAL}
a  
<VirtualHost *:%(port)s>
<IfDefine MOD_WSGI_ROTATE_LOGS>
ErrorLog "|%(rotatelogs_executable)s \
    %(log_directory)s/%(log_file)s.%%Y-%%m-%%d-%%H_%%M_%%S %(max_log_size)sM"
</IfDefine>
<IfDefine !MOD_WSGI_ROTATE_LOGS>
ErrorLog "%(log_directory)s/%(log_file)s"
</IfDefine>
WSGIDaemonProcess 'service:%(name)s' \
    display-name=%%{GROUP} \
    user='%(user)s' \
    group='%(group)s' \
    home='%(working_directory)s' \
    threads=0 \
    python-path='%(python_path)s' \
    python-eggs='%(python_eggs)s' \
    lang='%(lang)s' \
    locale='%(locale)s' \
    server-metrics=%(server_metrics_flag)s
WSGIImportScript '%(script)s' \
    process-group='service:%(name)s' \
    application-group=%%{GLOBAL}
</VirtualHost>
c                 	   t        | d   d      5 }t        t        | z  |       | d   r(| d   D ]   }t        t        t	        |      z  |       " | d   r]| d   D ]U  \  }}|j                  d      r t        t        t	        ||      z  |       7t        t        t	        ||      z  |       W | d	   r0| d	   D ](  \  }}t        t        t	        || d
   |      z  |       * | d   rt        | d   d      D ]  \  }}t        j                  |      }t        j                  j                  |      st        j                  j                  |      sB|j                  d      r|dk7  r|dz   }n|}t        t         t	        ||| d         z  |       t        j"                  |      }t        j$                  |      }t        t&        t	        |||      z  |        | d   rt        t(        | z  |       | d   r<| d   D ]4  \  }	}
t        t*        t	        |	|
j-                  dd            z  |       6 | d   r6t        | d   d      }|D ]   }t        t.        t	        |      z  |       " nt        t.        t	        d      z  |       | d   r,| d   D ]$  \  }}t        t0        t	        ||      z  |       & | d   r(| d   D ]   }t        t2        t	        |      z  |       " | d   r@t        t4        | z  |       | d   D ]$  \  }}t        t6        t	        d|      z  |       & | d    rt        t6        t	        d!d"      z  |       | d#   ri }| d$   r|j9                  | d$          t	        | d%   xs g       }t	        | d&   xs g       }| d#   D ]  \  }}|j;                  |d'      }|j;                  |d(      }||v rNt        t<        t	        ||||| d
   | d)   ||   | d*   | d+   | d,   | d-   | d.   | d/   | d0   | d1   2      z  |       |t        t>        t	        ||||| d,   | d-   | d.   | d/   | d0   | d1   3
      z  |        | d4   r=| d4   D ]5  }t        j                  |      }t        t@        t	        |5      z  |       7 | d6   rt        tB        | z  |       | d6   rt        tD        | z  |       d d d        y # 1 sw Y   y xY w)7N
httpd_confwfileignore_activity)urlproxy_mount_pointsr   )mount_pointrK   proxy_virtual_hostsport)hostrO   rK   url_aliasesT)reverseallow_override)rM   	directoryrS   )rM   rT   filenameenable_docserror_documents'z\')statusdocumentssl_verify_client_urlsr5   setenv_variables)r   valuepassenv_variables)r   handler_scriptszwsgi-resource)handler	extensionwith_cgiz
cgi-scriptz.cgiservice_scriptsservice_log_filesservice_usersservice_groupsz${MOD_WSGI_USER}z${MOD_WSGI_GROUP}log_directoryrotatelogs_executablemax_log_sizepython_pathworking_directorypython_eggslanglocaleserver_metrics_flag)r   usergroupscriptrO   rh   log_fileri   rj   rk   rl   rm   rn   ro   rp   )
r   rq   rr   rs   rk   rl   rm   rn   ro   rp   include_files)rU   with_newrelic_platform)#openprintAPACHE_GENERAL_CONFIGAPACHE_IGNORE_ACTIVITY_CONFIGdictendswith$APACHE_PROXY_PASS_MOUNT_POINT_CONFIG*APACHE_PROXY_PASS_MOUNT_POINT_SLASH_CONFIGAPACHE_PROXY_PASS_HOST_CONFIGsortedr3   abspathr   r5   isdirr6   APACHE_ALIAS_DIRECTORY_CONFIGr>   basenameAPACHE_ALIAS_FILENAME_CONFIGAPACHE_ALIAS_DOCUMENTATIONAPACHE_ERROR_DOCUMENT_CONFIGreplaceAPACHE_VERIFY_CLIENT_CONFIGAPACHE_SETENV_CONFIGAPACHE_PASSENV_CONFIGAPACHE_HANDLER_SCRIPT_CONFIGAPACHE_HANDLER_CONFIGupdategetAPACHE_SERVICE_WITH_LOG_CONFIGAPACHE_SERVICE_CONFIGAPACHE_INCLUDE_CONFIGAPACHE_TOOLS_CONFIGAPACHE_METRICS_CONFIG)optionsfprK   rM   rP   targetr5   rT   rU   rY   rZ   r9   r   r^   rb   rs   re   usersgroupsrq   rr   s                        r   generate_apache_configr   '  s   	gl#S	) |<R#g-B7$%01 N3dsmC"MN '($+,@$A H S'',>(3B> >DFH Dt(3H> >DFHH ()$%:; !	c3d!S7B B!!
 =!'-gm.D (" 9#V ((077==&bggnnT.Bs+$(3J	$(	7$(3y+23C+D;F F "$% !* 1 1$ 7I(11$7H6(3y%-:/ /579'9. =!,w6R@$%$+,=$> I 2T!)!1!1#u!=6? ?EGII +,7#;<dKE N1DdOC"MN -#>RH%&&'9: !e*Tt5-II!! &' 34 H+do=BGH $%.8rB%,->%? 7!	6+d?"+/- -3577 :'$|$+& &,.0 $% "*+!((1D)EF17R8E'"239r:F '(9 : %fyy'9:

4)<=,,84T!%U6!(*1/*B%6t%<29:Q2R)0)@(/(>.56I.J(/(>!(9J078M0N<P P "$% /$Dt"'(/(>.56I.J(/(>!(9J078M0N3P P "$%%%6 ?##O4 !$,,X6+dH.EE!!
 +,%/b9+,''1;y|< |< |<s   SSS%      ?Fc                 F   t         j                  d       dt        j                         z  }t	        |d| dt
        j                         t	        d|z  t
        j                         t        j                  t        j                         t        j                         y )NTmonitor (pid=%d):z Change detected to "z".rH   z%s Triggering process restart.)
_queueputr   getpidrx   sysstderrkillsignalSIGINT)r5   prefixs     r   _restartr     s]    
JJt 299;.F	64
8szzJ	
*V
3#**EGGBIIK'r   c                     	 t         j                  j                  |       s| t        v S t        j                  |       j
                  }| t        vr	|t        | <   |t        |    k7  ry	 y# t        $ r Y yw xY w)NTF)r   r5   isfile_timesstatst_mtime	Exception)r5   mtimes     r   	_modifiedr     sz     ww~~d#6>! &&v F4L F4L  !    	s   &A( <A( (	A43A4c                     	 t        t        j                  j                               D ]_  } t	        | d      st        | d      }|st        j                  j                  |      d   dv r|d d }t        |      sTt        |      c S  t        D ]  }t        |      st        |      c S  	 t        j                  t              S # t        j                   $ r Y nw xY w)N__file__r   ).pycz.pyo.pyd)timeout)listr   modulesvalueshasattrgetattrr   r5   splitextr   r   _filesr   r   	_intervalqueueEmpty)moduler5   s     r   _monitorr     s      3;;--/0 		&F6:.6:.Dww%a(,DDCRy~%		&  	&D~%	&	::i:00{{ 		5 s   /C	 	CC)r   Tc                  v    	 t         j                  d       t        j	                          y # t        $ r Y  w xY w)NT)r   r   r   _threadr4   r   r   r   _exitingr     s2    

4 LLN  s   , 	88c                 @    | t         vrt         j                  |        y y r   )r   appendr\   s    r   track_changesr     s    6>d r   c                 >   | t         k  r| a t        j                          t        sddt	        j
                         z  }t        d|z  t        j                         dat        j                          t        j                  t               t        j                          y )Nr   z%s Starting change monitor.rH   T)r   _lockacquire_runningr   r   rx   r   r   r   startatexitregisterr   release)intervalr   s     r   start_reloaderr     sd    )	 
MMO$ryy{2+f43::F!	MMOr   c                   0    e Zd Zd Zd Zd Zd Zd Zd Zy)PostMortemDebuggerc                 x    || _         d | _        dd l}|j                         | _        |r| j                          y y Nr   )application	generatorpdbPdbdebuggeractivate_console)selfr   startupr   s       r   __init__zPostMortemDebugger.__init__  s5    &	!!# r   c                 r    | j                   j                  t        j                         j                         y r   )r   	set_tracer   	_getframef_backr   s    r   r   z#PostMortemDebugger.activate_console  s      6 67r   c                     | j                   j                          | j                   j                  d t        j                         d          y )Nr   )r   resetinteractionr   exc_infor   s    r   run_post_mortemz"PostMortemDebugger.run_post_mortem!  s1    !!$q(9:r   c                 r    	 | j                  ||      | _        | S # t        $ r | j                           w xY wr   )r   r   r   r   r   r1   start_responses      r   __call__zPostMortemDebugger.__call__%  s>    	!--g~FDNK 	  "	s    6c              #   t   K   	 | j                   D ]  }|  y # t        $ r | j                           w xY wwr   )r   r   r   )r   items     r   __iter__zPostMortemDebugger.__iter__-  s@     	 
 	  "	s   8 858c                     	 t        | j                  d      r| j                  j                         S y # t        $ r | j	                           w xY w)Nclose)r   r   r   r   r   r   s    r   r   zPostMortemDebugger.close5  sK    	t~~w/~~++-- 0 	  "	s	   /3 AN)	__name__
__module____qualname__r   r   r   r   r   r   r   r   r   r   r     s     $8;r   r   c                       e Zd Zd Zd Zy)RequestRecorderc                     || _         || _        t        j                         | _        t        j                         | _        d| _        y r   )	r   savedir	threadingLocklockr   r   pidcount)r   r   r   s      r   r   zRequestRecorder.__init__?  s3    &NN$	99;
r   c              #   	  K   | j                   5  | xj                  dz  c_        | j                  }d d d        t        t        j                         dz        d| j                  d}t
        j                  j                  | j                  |dz         }t        |d      }t
        j                  j                  | j                  |dz         }t        |d      }t
        j                  j                  | j                  |dz         }	t        |	d      t
        j                  j                  | j                  |d	z         }
t        |
d      t
        j                  j                  | j                  |d
z         }t        |d      }t
        j                  j                  | j                  |dz         }t        |d      }t
        j                  j                  | j                  |dz         }t        |d      }|d   }t        j                  ||       |j                          |d   }|j                  d      }|r%|j                  |       |j                  d      }|r%|j                          |j                  dt
        j                          ||d<   fd}	 	 | j#                  ||      }	 |D ]'  }j                  |       j                          | ) 	 	 t-        |d      r|j                          j                          j                          |j                          |j                          |j                          y # 1 sw Y    xY w#  t%        j&                  t)        j*                         d|i  xY w#  t%        j&                  t)        j*                         d|i  xY w#  t%        j&                  t)        j*                         d|i  xY w# 	 t-        |d      r|j                          w w #  t%        j&                  t)        j*                         d|i  xY wxY w# j                          j                          |j                          |j                          |j                          w xY ww)Nr   i@B -z	.iheadersrG   z	.icontentzw+bz	.oheadersz	.ocontentz	.oaexceptz	.orexceptz	.ofexceptzwsgi.errorsstreamz
wsgi.inputi    r   c                 b    t        j                   | |f|z           | |g| fd}|S )Nr   c                 V    j                  |       j                           |      S r   )writeflush)r   data_writeocontent_fps     r   r  z@RequestRecorder.__call__.<locals>._start_response.<locals>.writey  s'    !!$'!!#d|#r   )pprint)rY   response_headersargsr  r  r  oheaders_fpr   s       @r   _start_responsez1RequestRecorder.__call__.<locals>._start_responses  s?    MMF$45d:&( $F,<DtDF$
 Lr   rI   r   )r   r   inttimer   r   r5   r4   r   rw   r	  r   readr  r  seekSEEK_SETr   	tracebackprint_exceptionr   r   r   )r   r1   r   r   keyiheadersiheaders_fpicontenticontent_fpoheadersocontentoaexceptoaexcept_fporexceptorexcept_fpofexceptofexcept_fperrorsinputr  r  resultr  r  s     `                   @@r   r   zRequestRecorder.__call__F  s    YY 	JJ!OJJJE	  		G 34dhhF77<<cK.?@8S)77<<cK.?@8U+77<<cK.?@8S)77<<cK.?@8U+77<<cK.?@8S)77<<cK.?@8S)77<<cK.?@8S)'gk2%zz$d#::d#D  	BKK( +	!	 ))'?C" D%%d+%%'Jvw/ u	 	z))3<<>LL))3<<>LL--s||~ .!,.vw/ 0--s||~ .!,. s   R"MH1R&<R$M 7,N %N9 ARMR*N		P6 *N66O& 9*O##P6 &P3(PP3*P00P33P6 6ARRN)r   r   r   r   r   r   r   r   r   r   =  s    [ r   r   c                   B    e Zd Z	 	 	 	 	 d	dZd Zd Zd Zd Zd Zd Z	y)
ApplicationHandlerNc                    || _         || _        || _        || _        |dk(  rt	        |       t
        j                  |   | _        t        | j                  |      | _	        | j                  j                  | _        t        j                  j                  | j                        d   }|d   j                         dv r|d   dz   | _        n|dk(  rddlm}  |d|z        | _	        || _        n|d	k7  rt%        j&                  d
      | _        || j                  _
        t)        |d      5 }t+        |j-                         |dd      }t/        || j                  j0                         d d d        | j                  t
        j                  d
<   t        | j                  |      | _	        || _        	 t        j                  j3                  | j                        | _        |r| j9                          || _        || _        |r| j?                  |       |	r| jA                  |
       y y # 1 sw Y   xY w# t6        $ r
 d | _        Y fw xY w)Nr   r   )r   r   r   r   z.pypaste)loadappz	config:%sstatic__wsgi__rexecTdont_inherit)!entry_pointapplication_typecallable_objectrM   
__import__r   r   r   r   r   r   r   r   r5   r   lowerpaste.deployr)  types
ModuleTyperw   compiler  r-  __dict__getmtimer   r   setup_newrelic_agent
debug_modeenable_debuggersetup_debuggersetup_recorder)r   r0  r1  r2  rM   with_newrelic_agentr<  r=  debugger_startupenable_recorderrecorder_directorypartsr)  r   codes                  r   r   zApplicationHandler.__init__  s    ' 0.&x'{#++k2DK&t{{ODD++..DKGG$$T[[1"5ERy $<<#Ah.(,&{['@AD%DK)**:6DK#.DKK k3' 12rwwy+v%)+T4;;//01
 '+kkCKK
#&t{{ODD%DK	))$++6DJ %%'$. 01 23 /1 1  	DJ	s   )>H%/.H1 %H.1IIc                    dd l }t        j                  j                  d      }t        j                  j                  d      }|j                  j                         }|j                  d|_        |j                  j                  ||       |j                  j                          |j                  j                  | j                        | _
        y )Nr   NEW_RELIC_CONFIG_FILENEW_RELIC_ENVIRONMENTr   )newrelic.agentr   r1   r   agentglobal_settingsrt   
initializeregister_applicationWSGIApplicationWrapperr   )r   newrelicconfig_fileenvironmentrK  s        r   r;  z'ApplicationHandler.setup_newrelic_agent  s    jjnn%<=jjnn%<="..88:##+'/O$!!+{;++-#>>@@  "r   c                 :    t        | j                  |      | _        y r   )r   r   )r   r   s     r   r>  z!ApplicationHandler.setup_debugger  s    -d.>.>Hr   c                 :    t        | j                  |      | _        y r   )r   r   )r   r   s     r   r?  z!ApplicationHandler.setup_recorder  s    *4+;+;WEr   c                     | j                   ry	 t        j                  j                  | j                        }|| j                  k7  S # t
        $ r d }Y w xY w)NF)r<  r   r5   r:  r   r   r   )r   resourcer   s      r   reload_requiredz"ApplicationHandler.reload_required  sP    ??	GG$$T[[1E 

""  	E	s   )A AAc                    |j                  d      }|j                  d      }|j                  d      }|Y|d   }||z   |d<   | j                  dk7  r|d   j                  | j                        r|d   t        | j                        d  |d<   ngd|d<   ||z   |d<   | j                  dk7  rK|d   j                  | j                        r-| j                  |d<   |d   t        | j                        d  |d<   | j	                  ||      S )Nzmod_wsgi.mount_pointSCRIPT_NAME	PATH_INFOzmod_wsgi.script_namer   r	   )r   rM   
startswithlenr   )r   r1   r   rM   script_name	path_infos         r   handle_requestz!ApplicationHandler.handle_request  s5    kk"89kk-0KK,	" ""89K#.#:GK 3&;'2243C3CD+2;+? ,,A. A/ ,0GK( &(GM"#.#:GK 3&;'2243C3CD-1-=-=GM*+2;+? ,,A. A/ ,0GK( 88r   c                 &    | j                  ||      S r   r^  r   s      r   r   zApplicationHandler.__call__!      ""7N;;r   )	rs   r   r   FFFFFN)
r   r   r   r   r;  r>  r?  rV  r^  r   r   r   r   r&  r&    s8    5=7:27496:	54n" IF	#"9H<r   r&  c                   *    e Zd Zd Zd Zd Zd Zd Zy)ResourceHandlerc                    i | _         |D ]  \  }}t        j                  dd|      }d|z  }t        j                  |      }||_        t        |d      5 }t        |j                         |dd      }t        ||j                         d d d        |t        j                  |<   || j                   |<    y # 1 sw Y   .xY w)Nz[^\w]{1}_z__wsgi_resource%s__r,  r-  Tr.  )	resourcesresubr6  r7  r   rw   r8  r  r-  r9  r   r   )	r   rf  rb   rs   extension_namemodule_namer   r   rE  s	            r   r   zResourceHandler.__init__&  s    !* 	/IvVVKi@N/.@K%%k2F$FOfc" ,brwwy&&%)+T6??+,
 (.CKK$(.DNN9%	/, ,s   4B55B>	c                 F    t         j                  j                  |      d   S )Nr   )r   r5   r   )r   rU  s     r   resource_extensionz"ResourceHandler.resource_extension7  s    ww)"--r   c                 n    | j                  |      }t        | j                  |   dd       }| ||      S y)NrV  F)rl  r   rf  )r   rU  rb   functions       r   rV  zResourceHandler.reload_required:  s>    ++H5	4>>)46GNH%%r   c                     |d   }| j                  |      }| j                  |   }t        |dd       }|	 |||      S t        |d      } |||      S )NrX  r^  r   )rl  rf  r   )r   r1   r   rU  rb   r   rn  s          r   r^  zResourceHandler.handle_requestA  se    =)++H5		*6#3T:G^446=100r   c                 &    | j                  ||      S r   r`  r   s      r   r   zResourceHandler.__call__K  ra  r   N)r   r   r   r   rl  rV  r^  r   r   r   r   rc  rc  $  s    /".1<r   rc  a  
import os
import sys
import atexit
import time

import mod_wsgi.server

working_directory = r'%(working_directory)s'

entry_point = r'%(entry_point)s'
application_type = '%(application_type)s'
callable_object = '%(callable_object)s'
mount_point = '%(mount_point)s'
with_newrelic_agent = %(with_newrelic_agent)s
newrelic_config_file = '%(newrelic_config_file)s'
newrelic_environment = '%(newrelic_environment)s'
disable_reloading = %(disable_reloading)s
reload_on_changes = %(reload_on_changes)s
debug_mode = %(debug_mode)s
enable_debugger = %(enable_debugger)s
debugger_startup = %(debugger_startup)s
enable_coverage = %(enable_coverage)s
coverage_directory = '%(coverage_directory)s'
enable_profiler = %(enable_profiler)s
profiler_directory = '%(profiler_directory)s'
enable_recorder = %(enable_recorder)s
recorder_directory = '%(recorder_directory)s'
enable_gdb = %(enable_gdb)s

os.environ['MOD_WSGI_EXPRESS'] = 'true'
os.environ['MOD_WSGI_SERVER_NAME'] = '%(server_host)s'
os.environ['MOD_WSGI_SERVER_ALIASES'] = %(server_aliases)r or ''

if reload_on_changes:
    os.environ['MOD_WSGI_RELOADER_ENABLED'] = 'true'

if debug_mode:
    os.environ['MOD_WSGI_DEBUG_MODE'] = 'true'

    # We need to fiddle sys.path as we are not using daemon mode and so
    # the working directory will not be added to sys.path by virtue of
    # 'home' option to WSGIDaemonProcess directive. We could use the
    # WSGIPythonPath directive, but that will cause .pth files to also
    # be evaluated.

    sys.path.insert(0, working_directory)

if enable_debugger:
    os.environ['MOD_WSGI_DEBUGGER_ENABLED'] = 'true'

def output_coverage_report():
    coverage_info.stop()
    coverage_info.html_report(directory=coverage_directory)

if enable_coverage:
    os.environ['MOD_WSGI_COVERAGE_ENABLED'] = 'true'

    from coverage import coverage
    coverage_info = coverage()
    coverage_info.start()
    atexit.register(output_coverage_report)

def output_profiler_data():
    profiler_info.disable()
    output_file = '%%s-%%d.pstats' %% (int(time.time()*1000000), os.getpid())
    output_file = os.path.join(profiler_directory, output_file)
    profiler_info.dump_stats(output_file)

if enable_profiler:
    os.environ['MOD_WSGI_PROFILER_ENABLED'] = 'true'

    from cProfile import Profile
    profiler_info = Profile()
    profiler_info.enable()
    atexit.register(output_profiler_data)

if enable_recorder:
    os.environ['MOD_WSGI_RECORDER_ENABLED'] = 'true'

if enable_gdb:
    os.environ['MOD_WSGI_GDB_ENABLED'] = 'true'

if with_newrelic_agent:
    if newrelic_config_file:
        os.environ['NEW_RELIC_CONFIG_FILE'] = newrelic_config_file
    if newrelic_environment:
        os.environ['NEW_RELIC_ENVIRONMENT'] = newrelic_environment

handler = mod_wsgi.server.ApplicationHandler(entry_point,
        application_type=application_type, callable_object=callable_object,
        mount_point=mount_point, with_newrelic_agent=with_newrelic_agent,
        debug_mode=debug_mode, enable_debugger=enable_debugger,
        debugger_startup=debugger_startup, enable_recorder=enable_recorder,
        recorder_directory=recorder_directory)

if not disable_reloading:
    reload_required = handler.reload_required

handle_request = handler.handle_request

if not disable_reloading and reload_on_changes and not debug_mode:
    mod_wsgi.server.start_reloader()
z
import mod_wsgi.server

resources = %(resources)s

handler = mod_wsgi.server.ResourceHandler(resources)

reload_required = handler.reload_required
handle_request = handler.handle_request
a  
CONTENT = b'''
<html>
<head>
<title>My web site runs on Malt Whiskey</title>
</head>
<body style="margin-top: 100px;">
<table align="center"; style="width: 850px;" border="0" cellpadding="30">
<tbody>
<tr>
<td>
<img style="width: 275px; height: 445px;"
  src="/__wsgi__/images/snake-whiskey.jpg">
</td>
<td style="text-align: center;">
<span style="font-family: Arial,Helvetica,sans-serif;
  font-weight: bold; font-size: 70px;">
My web site<br>runs on<br>Malt Whiskey<br>
<br>
</span>
<span style="font-family: Arial,Helvetica,sans-serif;
  font-weight: bold;">
For further information on configuring mod_wsgi,<br>
see the <a href="%(documentation_url)s">documentation</a>.
</span>
</td>
</tr>
</tbody>
</table>
</body>
</html>
'''

def application(environ, start_response):
    status = '200 OK'
    output = CONTENT

    response_headers = [('Content-type', 'text/html'),
                        ('Content-Length', str(len(output)))]
    start_response(status, response_headers)

    return [output]
c           
      @   t         j                  j                  | d   d      }t        |d      5 }t	        t
        | z  |       d d d        t         j                  j                  | d   d      }t        |d      5 }t	        t        t        t        | d               z  |       d d d        t         j                  j                  | d   d      }t        |d      5 }t	        t        | z  |       d d d        y # 1 sw Y   xY w# 1 sw Y   bxY w# 1 sw Y   y xY w)	Nserver_rootzhandler.wsgirG   rH   zresource.wsgir`   )rf  default.wsgi)
r   r5   r4   rw   rx   WSGI_HANDLER_SCRIPTWSGI_RESOURCE_SCRIPTr{   reprWSGI_DEFAULT_SCRIPTr   r5   r   s      r   generate_wsgi_handler_scriptry    s    77<<.?D	dC 6B!G+"56 77<<.@D	dC 7B"TD)*5, &- -35	77 77<<.?D	dC 6B!G+"56 66 67 7
6 6s#   C<<+DD<DDDad  
import os
import logging

newrelic_config_file = '%(newrelic_config_file)s'
newrelic_environment = '%(newrelic_environment)s'

with_newrelic_platform = %(with_newrelic_platform)s

if with_newrelic_platform:
    if newrelic_config_file:
        os.environ['NEW_RELIC_CONFIG_FILE'] = newrelic_config_file
    if newrelic_environment:
        os.environ['NEW_RELIC_ENVIRONMENT'] = newrelic_environment

logging.basicConfig(level=logging.INFO,
    format='%%(name)s (pid=%%(process)d, level=%%(levelname)s): %%(message)s')

_logger = logging.getLogger(__name__)

try:
    from mod_wsgi.metrics.newrelic import Agent

    agent = Agent()
    agent.start()

except ImportError:
    _logger.fatal('The module mod_wsgi.metrics.newrelic is not available. '
            'The New Relic platform plugin has been disabled. Install the '
            '"mod_wsgi-metrics" package.')
c                     t         j                  j                  | d   d      }t        |d      5 }t	        t
        | z  |       d d d        y # 1 sw Y   y xY w)Nrr  zserver-metrics.pyrG   rH   )r   r5   r4   rw   rx   SERVER_METRICS_SCRIPTrx  s      r   generate_server_metrics_scriptr|    sL    77<<.0CDD	dC 8B#g-B78 8 8s   AAa	  
#!%(shell_executable)s

# %(sys_argv)s

HTTPD="%(httpd_executable)s"
HTTPD_ARGS="%(httpd_arguments)s"

HTTPD_COMMAND="$HTTPD $HTTPD_ARGS"

MOD_WSGI_MODULES_DIRECTORY="%(modules_directory)s"
export MOD_WSGI_MODULES_DIRECTORY

SHLIBPATH="%(shlibpath)s"

if [ "x$SHLIBPATH" != "x" ]; then
    %(shlibpath_var)s="$SHLIBPATH:$%(shlibpath_var)s"
    export %(shlibpath_var)s
fi

MOD_WSGI_SERVER_ROOT="%(server_root)s"

export MOD_WSGI_SERVER_ROOT

MOD_WSGI_LISTENER_HOST="%(host)s"

export MOD_WSGI_LISTENER_HOST

MOD_WSGI_HTTP_PORT="%(port)s"
MOD_WSGI_HTTPS_PORT="%(https_port)s"

export MOD_WSGI_HTTP_PORT
export MOD_WSGI_HTTPS_PORT

WSGI_RUN_USER="${WSGI_RUN_USER:-%(user)s}"
WSGI_RUN_GROUP="${WSGI_RUN_GROUP:-%(group)s}"

MOD_WSGI_USER="${MOD_WSGI_USER:-${WSGI_RUN_USER}}"
MOD_WSGI_GROUP="${MOD_WSGI_GROUP:-${WSGI_RUN_GROUP}}"

export MOD_WSGI_USER
export MOD_WSGI_GROUP

if [ `id -u` = "0" -a ${MOD_WSGI_USER} = "root" ]; then
    cat << EOF

WARNING: When running as the 'root' user, it is required that the options
'--user' and '--group' be specified to mod_wsgi-express. These should
define a non 'root' user and group under which the Apache child worker
processes and mod_wsgi daemon processes should be run. Failure to specify
these options will result in Apache and/or the mod_wsgi daemon processes
failing to start. See the mod_wsgi-express documentation for further
information on this restriction.

EOF

fi

MOD_WSGI_WORKING_DIRECTORY="%(working_directory)s"

export MOD_WSGI_WORKING_DIRECTORY

LANG='%(lang)s'
LC_ALL='%(locale)s'

export LANG
export LC_ALL

ACMD="$1"
ARGV="$@"

if test -f %(server_root)s/envvars; then
    . %(server_root)s/envvars
fi

STATUSURL="http://%(host)s:%(port)s/server-status"

if [ "x$ARGV" = "x" ]; then
    ARGV="-h"
fi

GDB="%(gdb_executable)s"
ENABLE_GDB="%(enable_gdb)s"

PROCESS_NAME="%(process_name)s"

cd $MOD_WSGI_WORKING_DIRECTORY

case $ACMD in
start|stop|restart|graceful|graceful-stop)
    if [ "x$ENABLE_GDB" != "xTrue" ]; then
        exec -a "$PROCESS_NAME" $HTTPD_COMMAND -k $ARGV
    else
        echo "run $HTTPD_ARGS -k $ARGV" > %(server_root)s/gdb.cmds
        gdb -x %(server_root)s/gdb.cmds $HTTPD
    fi
    ;;
configtest)
    exec $HTTPD_COMMAND -t
    ;;
status)
    exec %(python_executable)s -m webbrowser -t $STATUSURL
    ;;
*)
    exec $HTTPD_COMMAND $ARGV
esac
z
. %(envvars_script)s
c                 b   t         j                  j                  | d   d      }t        |d      5 }t	        t
        j                         | z  |       d d d        t        j                  |d       t         j                  j                  | d   d      }| d   r=t        |d      5 }| d   r"t	        t        j                         | z  |       d d d        y t         j                  j                  |      st        |d      5 }	 d d d        y y # 1 sw Y   xY w# 1 sw Y   y xY w# 1 sw Y   y xY w)Nrr  	apachectlrG   rH   i  envvarsenvvars_script)
r   r5   r4   rw   rx   WSGI_CONTROL_SCRIPTlstripchmodAPACHE_ENVVARS_FILEr   rx  s      r   generate_control_scriptsr    s   77<<.<D	dC ?B!((*W42>? HHT577<<.	:D $_ 	G'()002W<2F	G 	G WW^^D!$_ 		 	 "? ?	G 	G
	 	s#   #D%(DD%DD"%D.c                     ||dk  s|dkD  rt        j                  d|z        t        |j                  | j                  |       y )Nr   r   z4%s option value needs to be within the range 0 to 1.)optparseOptionValueErrorsetattrr   dest)optionopt_strr^   parsers       r   check_percentager    sH    UQY%!)'' )$&-). / 	/FMM6;;.r   c                 "   | j                  d      }d}t        j                  dk(  rd|vrd|vrd}n
d|vrd|vrd}|rt        j                  |d<   d	|v rt        j                  |d<   t
        j                  t        j                  |i |       y )
N|Fr   allwindowsTunixhelphidden)r2   r   r   r  SUPPRESS_HELPoption_listr   make_option)	platformsr  kwargstargetssuppresss        r   
add_optionr    s    ooc"GH	ww$IW$<HF'$9H!//v7!//vx++T<V<=r   r  z--application-typers   TYPEa  The type of WSGI application entry point that was provided. Defaults to 'script', indicating the traditional mod_wsgi style WSGI script file specified by a filesystem path. Alternatively one can supply 'module', indicating that the provided entry point is a Python module which should be imported using the standard Python import mechanism, or 'paste' indicating that the provided entry point is a Paste deployment configuration file. If you want to just use the server to host static files only, then you can also instead supply 'static' with the target being the directory containing the files to server or the current directory if none is supplied.)r8   metavarr  z--entry-pointzFILE-PATH|MODULEa  The file system path or module name identifying the file which contains the WSGI application entry point. How the value given is interpreted depends on the corresponding type identified using the '--application-type' option. Use of this option is the same as if the value had been given as argument but without any option specifier. A named option is also provided so as to make it clearer in a long option list what the entry point actually is. If both methods are used, that specified by this option will take precedence.z--hostz
IP-ADDRESSz|The specific host (IP address) interface on which requests are to be accepted. Defaults to listening on all host interfaces.z--porti@  r  NUMBERz]The specific port to bind to and on which requests are to be accepted. Defaults to port 8000.)r8   typer  r  z--http2
store_truez_Flag indicating whether HTTP/2 should be enabled.Requires the mod_http2 module to be available.)actionr8   r  z--https-portzMThe specific port to bind to and on which secure requests are to be accepted.)r  r  r  z
--ssl-port
https_port)r  r  r  r  z--ssl-certificate-filez	FILE-PATHz-Specify the path to the SSL certificate file.z--ssl-certificate-key-filezSSpecify the path to the private key file corresponding to the SSL certificate file.z--ssl-certificateao  Specify the common path to the SSL certificate files. This is a convenience function so that only one option is required to specify the location of the certificate file and the private key file. It is expected that the files have '.crt' and '.key' extensions. This option should refer to the common part of the names for both files which appears before the extension.z--ssl-ca-certificate-filea  Specify the path to the file with the CA certificates to be used for client authentication. When specified, access to the whole site will by default require client authentication. To require client authentication for only parts of the site, use the --ssl-verify-client option.z--ssl-verify-clientr   zURL-PATHr[   a  Specify a sub URL of the site for which client authentication is required. When this option is specified, the default of client authentication being required for the whole site will be disabled and verification will only be required for the specified sub URL.)r  r  r  r  z--ssl-certificate-chain-filezSpecify the path to a file containing the certificates of Certification Authorities (CA) which form the certificate chain of the server certificate.z--ssl-environmentzFlag indicating whether the standard set of SSL related variables are passed in the per request environment passed to a handler.z--https-onlyzFlag indicating whether any requests made using a HTTP request over the non secure connection should be redirected automatically to use a HTTPS request over the secure connection.z--hsts-policyPARAMSz^Specify the HSTS policy that should be applied when HTTPS only connections are being enforced.z--server-nameHOSTNAMEzThe primary host name of the web server. If this name starts with 'www.' then an automatic redirection from the parent domain name to the 'www.' server name will created.z--server-aliasserver_aliaseszHA secondary host name for the web server. May include wildcard patterns.)r  r  r  r  z--allow-localhostzFlag indicating whether access via localhost should still be allowed when a server name has been specified and a name based virtual host has been configured.r  z--processeszThe number of worker processes (instances of the WSGI application) to be started up and which will handle requests concurrently. Defaults to a single process.z	--threads   zThe number of threads in the request thread pool of each process for handling requests. Defaults to 5 in each process. Note that if embedded mode and only prefork MPM is available, then processes will instead be used.)r  r8   r  r  z--max-clientsa  The maximum number of simultaneous client connections that will be accepted. This will default to being 1.5 times the total number of threads in the request thread pools across all process handling requests. Note that if embedded mode is used this will be ignored.z--initial-workersfloatcallbacka  The initial number of workers to create on startup expressed as a percentage of the maximum number of clients. The value provided should be between 0 and 1. The default is dependent on the type of MPM being used. Note that if embedded mode is used, this will be ignored.)r  r8   r  r  r  r  z--minimum-spare-workersa  The minimum number of spare workers to maintain expressed as a percentage of the maximum number of clients. The value provided should be between 0 and 1. The default is dependent on the type of MPM being used. Note that if embedded mode is used, this will be ignored.z--maximum-spare-workersa  The maximum number of spare workers to maintain expressed as a percentage of the maximum number of clients. The value provided should be between 0 and 1. The default is dependent on the type of MPM being used. Note that if embedded mode is used, this will be ignored.z--limit-request-bodyi   z]The maximum number of bytes which are allowed in a request body. Defaults to 10485760 (10MB).z--maximum-requestszThe number of requests after which any one worker process will be restarted and the WSGI application reloaded. Defaults to 0, indicating that the worker process should never be restarted based on the number of requests received.z--startup-timeout   SECONDSa.  Maximum number of seconds allowed to pass waiting for the application to be successfully loaded and started by a worker process. When this timeout has been reached without the application having been successfully loaded and started, the worker process will be forced to restart. Defaults to 15 seconds.z--shutdown-timeouta  Maximum number of seconds allowed to pass when waiting for a worker process to shutdown as a result of the maximum number of requests or inactivity timeout being reached, or when a user initiated SIGINT signal is sent to a worker process. When this timeout has been reached the worker process will be forced to exit even if there are still active requests or it is still running Python exit functions. Defaults to 5 seconds.z--restart-interval0zNumber of seconds between worker process restarts. If graceful timeout is also specified, active requests will be given a chance to complete before the process is forced to exit and restart. Not enabled by default.z--cpu-time-limitzNumber of seconds of CPU time the process can use before it will be restarted. If graceful timeout is also specified, active requests will be given a chance to complete before the process is forced to exit and restart. Not enabled by default.z--graceful-timeoutzGrace period for requests to complete normally, while still accepting new requests, when worker processes are being shutdown and restarted due to maximum requests being reached or restart interval having expired. Defaults to 15 seconds.z--eviction-timeouta  Grace period for requests to complete normally, while still accepting new requests, when the WSGI application is being evicted from the worker processes, and the process restarted, due to forced graceful restart signal. Defaults to timeout specified by '--graceful-timeout' option.z--deadlock-timeout<   zMaximum number of seconds allowed to pass before the worker process is forcibly shutdown and restarted after a potential deadlock on the Python GIL has been detected. Defaults to 60 seconds.z--inactivity-timeoutzMaximum number of seconds allowed to pass before the worker process is shutdown and restarted when the worker process has entered an idle state and is no longer receiving new requests. Not enabled by default.z--ignore-activityrJ   zSpecify the URL path for any location where activity should be ignored when the '--activity-timeout' option is used. This would be used on health check URLs so that health checks do not prevent process restarts due to inactivity.z--request-timeouta  Maximum number of seconds allowed to pass before the worker process is forcibly shutdown and restarted when a request does not complete in the expected time. In a multi threaded worker, the request time is calculated as an average across all request threads. Defaults to 60 seconds.z--connect-timeouta  Maximum number of seconds allowed to pass before giving up on attempting to get a connection to the worker process from the Apache child process which accepted the request. This comes into play when the worker listener backlog limit is exceeded. Defaults to 15 seconds.z--socket-timeoutzMaximum number of seconds allowed to pass before timing out on a read or write operation on a socket and aborting the request. Defaults to 60 seconds.z--queue-timeout-   zMaximum number of seconds allowed for a request to be accepted by a worker process to be handled, taken from the time when the Apache child process originally accepted the request. Defaults to 45 seconds.z--header-timeouta  The number of seconds allowed for receiving the request including the headers. This may be dynamically increased if a minimum rate for reading the request and headers is also specified, up to any limit imposed by a maximum header timeout. Defaults to 15 seconds.z--header-max-timeout   a  Maximum number of seconds allowed for receiving the request including the headers. This is the hard limit after taking into consideration and increases to the basic timeout due to minimum rate for reading the request and headers which may be specified. Defaults to 30 seconds.z--header-min-ratei  BYTESaJ  The number of bytes required to be sent as part of the request and headers to trigger a dynamic increase in the timeout on receiving the request including headers. Each time this number of bytes is received the timeout will be increased by 1 second up to any maximum specified by the maximum header timeout. Defaults to 500 bytes.z--body-timeoutzThe number of seconds allowed for receiving the request body. This may be dynamically increased if a minimum rate for reading the request body is also specified, up to any limit imposed by a maximum body timeout. Defaults to 15 seconds.z--body-max-timeouta  Maximum number of seconds allowed for receiving the request body. This is the hard limit after taking into consideration and increases to the basic timeout due to minimum rate for reading the request body which may be specified. Defaults to 0 indicating there is no maximum.z--body-min-ratea4  The number of bytes required to be sent as part of the request body to trigger a dynamic increase in the timeout on receiving the request body. Each time this number of bytes is received the timeout will be increased by 1 second up to any maximum specified by the maximum body timeout. Defaults to 500 bytes.z--server-backlogzTDepth of server socket listener backlog for Apache child processes. Defaults to 500.z--daemon-backlogd   zNDepth of server socket listener backlog for daemon processes. Defaults to 100.z--send-buffer-sizezSize of socket buffer for sending data to daemon processes. Defaults to 0, indicating the system default socket buffer size is used.z--receive-buffer-sizezSize of socket buffer for receiving data from daemon processes. Defaults to 0, indicating the system default socket buffer size is used.z--header-buffer-sizezSize of buffer used for reading response headers from daemon processes. Defaults to 0, indicating internal default of 32768 bytes is used.z--response-buffer-sizezMaximum amount of response content that will be allowed to be buffered in the Apache child worker process when proxying the response from a daemon process. Defaults to 0, indicating internal default of 65536 bytes is used.z--response-socket-timeouta  Maximum number of seconds allowed to pass before timing out on a write operation back to the HTTP client when the response buffer has filled and data is being forcibly flushed. Defaults to 0 seconds indicating that it will default to the value of the 'socket-timeout' option.z--enable-sendfilezFlag indicating whether sendfile() support should be enabled. Defaults to being disabled. This should only be enabled if the operating system kernel and file system type where files are hosted supports it.z--disable-reloadingzDisables all reloading of daemon processes due to changes to the file containing the WSGI application entrypoint, or any other loaded source files. This has no effect when embedded mode is used as reloading is automatically disabled for embedded mode.z--reload-on-changesa  Flag indicating whether worker processes should be automatically restarted when any Python code file loaded by the WSGI application has been modified. Defaults to being disabled. When reloading on any code changes is disabled, unless all reloading is also disabled, the worker processes will still though be reloaded if the file containing the WSGI application entrypoint is modified.z--userUSERNAMEzUWhen being run by the root user, the user that the WSGI application should be run as.z--groupGROUPzVWhen being run by the root user, the group that the WSGI application should be run as.z--callable-objectr   NAMEzuThe name of the entry point for the WSGI application within the WSGI script file. Defaults to the name 'application'.z--map-head-to-getAutozOFF|ON|AUTOaM  Flag indicating whether HEAD requests should be mapped to a GET request. By default a HEAD request will be automatically mapped to a GET request when an Apache output filter is detected that may want to see the entire response in order to set up response headers correctly for a HEAD request. This can be disable by setting to 'Off'.z--document-rootzDIRECTORY-PATHz\The directory which should be used as the document root and which contains any static files.)r  r  z--directory-indexz	FILE-NAMEzThe name of a directory index resource to be found in the document root directory. Requests mapping to the directory will be mapped to this resource rather than being passed through to the WSGI application.z--directory-listingzFlag indicating if directory listing should be enabled where static file application type is being used and no directory index file has been specified.z--allow-overridezDIRECTIVE-TYPEzAllow directives to be overridden from a '.htaccess' file. Defaults to 'None', indicating that any '.htaccess' file will be ignored with override directives not being permitted.)r  r  r  z--mount-pointzrThe URL path at which the WSGI application will be mounted. Defaults to being mounted at the root URL of the site.)r  r8   r  z--url-aliasrQ   z!URL-PATH FILE-PATH|DIRECTORY-PATHzEMap a single static file or a directory of static files to a sub URL.)r  nargsr  r  r  z--error-documentrW   zSTATUS URL-PATHzRMap a specific sub URL as the handler for HTTP errors generated by the web server.z--error-overridezYFlag indicating whether Apache error documents will override application error responses.z--proxy-mount-pointrL   zURL-PATH URLzMap a sub URL such that any requests against it will be proxied to the specified URL. This is only for proxying to a site as a whole, or a sub site, not individual resources.z--proxy-url-aliasz--proxy-virtual-hostrN   zHOSTNAME URLzAProxy any requests for the specified host name to the remote URL.z--trust-proxy-headertrusted_proxy_headerszHEADER-NAMEzdThe name of any trusted HTTP header providing details of the front end client request when proxying.)r  r8   r  r  r  z--trust-proxytrusted_proxieszIP-ADDRESS/SUBNETz<The IP address or subnet corresponding to any trusted proxy.z--keep-alive-timeoutzThe number of seconds which a client connection will be kept alive to allow subsequent requests to be made over the same connection when a keep alive connection is requested. Defaults to 2, indicating that keep alive connections are set for 2 seconds.z--compress-responseszFlag indicating whether responses for common text based responses, such as plain text, HTML, XML, CSS and Javascript should be compressed.z--server-metricszzFlag indicating whether internal server metrics will be available within the WSGI application. Defaults to being disabled.z--server-statuszvFlag indicating whether web server status will be available at the /server-status sub URL. Defaults to being disabled.z--host-access-scriptzSCRIPT-PATHz?Specify a Python script file for performing host access checks.z--auth-user-scriptz@Specify a Python script file for performing user authentication.z--auth-typeBasiczSpecify the type of authentication scheme used when authenticating users. Defaults to using 'Basic'. Alternate schemes available are 'Digest'.z--auth-group-scriptzwSpecify a Python script file for performing group based authorization in conjunction with a user authentication script.z--auth-groupwsgizSpecify the group which users should be a member of when using a group based authorization script. Defaults to 'wsgi' as a place holder but should be overridden to be the actual group you use rather than making your group name match the default.z--include-fileru   zSpecify the path to an additional web server configuration file to be included at the end of the generated web server configuration file.z--rewrite-ruleszSpecify an alternate server configuration file which contains rewrite rules. Defaults to using the 'rewrite.conf' stored under the server root directory.z--envvars-scriptzSpecify an alternate script file for user defined web server environment variables. Defaults to using the 'envvars' stored under the server root directory.z--langz--localea  Specify the natural language locale for the process as normally defined by the 'LC_ALL' environment variable. If not specified, then the default locale for this process will be used. If the default locale is however 'C' or 'POSIX' then an attempt will be made to use either the 'en_US.UTF-8' or 'C.UTF-8' locales and if that is not possible only then fallback to the default locale of this process.z--setenvr]   z	KEY VALUEzQSpecify a name/value pairs to be added to the per request WSGI environ dictionaryz	--passenvr_   KEYzSpecify the names of any process level environment variables which should be passed as a name/value pair in the per request WSGI environ dictionary.z--working-directorya0  Specify the directory which should be used as the current working directory of the WSGI application. This directory will be searched when importing Python modules so long as the WSGI application doesn't subsequently change the current working directory. Defaults to the directory this script is run from.z
--pid-filezdSpecify an alternate file to be used to store the process ID for the root process of the web server.z--server-roota  Specify an alternate directory for where the generated web server configuration, startup files and logs will be stored. On Linux defaults to the sub directory specified by the TMPDIR environment variable, or /tmp if not specified. On macOS, defaults to the /var/tmp directory.z--server-mpmserver_mpm_variableszSpecify preferred MPM to use when using Apache 2.4 with dynamically loadable MPMs and more than one is available. By default the MPM precedence order when no preference is given is "event", "worker" and "prefork".z--log-directoryzmSpecify an alternate directory for where the log files will be stored. Defaults to the server root directory.z--log-levelwarnz6Specify the log level for logging. Defaults to 'warn'.z--access-logz`Flag indicating whether the web server access log should be enabled. Defaults to being disabled.z--startup-logzaFlag indicating whether the web server startup log should be enabled. Defaults to being disabled.z--verbose-debuggingverbose_debugging)r  r  r  z--log-to-terminalzFlag indicating whether logs should be directed back to the terminal. Defaults to being disabled. If --log-directory is set explicitly, it will override this option. If logging to the terminal is carried out, any rotating of log files will be disabled.z--access-log-formatFORMATz-Specify the format of the access log records.z--error-log-formatz,Specify the format of the error log records.z--error-log-name	error_logzUSpecify the name of the error log file when it is being written to the log directory.z--access-log-name
access_logzVSpecify the name of the access log file when it is being written to the log directory.z--startup-log-namestartup_logzWSpecify the name of the startup log file when it is being written to the log directory.z--rotate-logsz9Flag indicating whether log rotation should be performed.z--max-log-sizeMBzeThe maximum size in MB the log file should be allowed to reach before log file rotation is performed.z--rotatelogs-executablez/Override the path to the rotatelogs executable.z--python-pathpython_pathsa4  Specify the path to any additional directory that should be added to the Python module search path. Note that these directories will not be processed for '.pth' files. If processing of '.pth' files is required, set the 'PYTHONPATH' environment variable in a script specified by the '--envvars-script' option.z--python-eggszSpecify an alternate directory which should be used for unpacking of Python eggs. Defaults to a sub directory of the server root directory.z--shell-executablezjOverride the path to the shell used in the 'apachectl' script. The 'bash' shell will be used if available.z--httpd-executablez6Override the path to the Apache web server executable.z--process-namezOverride the name given to the Apache parent process. This might be needed when a process manager expects the process to be named a certain way but due to a sequence of exec calls the name changed.--modules-directoryz=Override the path to the Apache web server modules directory.z--mime-typesz@Override the path to the mime types file used by the web server.z--socket-prefixzSpecify an alternate directory name prefix to be used for the UNIX domain sockets used by mod_wsgi to communicate between the Apache child processes and the daemon processes.z--add-handlerr`   zEXTENSION SCRIPT-PATHzSpecify a WSGI application to be used as a special handler for any resources matched from the document root directory with a specific extension type.z--chunked-requestzVFlag indicating whether requests which use chunked transfer encoding will be accepted.r  z--with-newreliczXFlag indicating whether all New Relic performance monitoring features should be enabled.z--with-newrelic-agentznFlag indicating whether the New Relic Python agent should be enabled for reporting application server metrics.z--with-newrelic-platformzkFlag indicating whether the New Relic platform plugin should be enabled for reporting server level metrics.z--newrelic-config-filez?Specify the location of the New Relic agent configuration file.z--newrelic-environmentzhSpecify the name of the environment section that should be used from New Relic agent configuration file.z--with-php5zfFlag indicating whether PHP 5 support should be enabled. PHP code files must use the '.php' extension.z
--with-cgizyFlag indicating whether CGI script support should be enabled. CGI scripts must use the '.cgi' extension and be executablez--service-scriptrd   zSERVICE SCRIPT-PATHzSpecify the name of a Python script to be loaded and executed in the context of a distinct daemon process. Used for running a managed service.z--service-userrf   zSERVICE USERNAMEzWhen being run by the root user, the user that the distinct daemon process started to run the managed service should be run as.z--service-grouprg   zSERVICE GROUPzWhen being run by the root user, the group that the distinct daemon process started to run the managed service should be run as.z--service-log-filere   zSERVICE FILE-NAMEzKSpecify the name of a separate log file to be used for the managed service.z--orphan-interpreterz_Flag indicating whether should skip over destroying the Python interpreter on process shutdown.z--embedded-modezFlag indicating whether to run in embedded mode rather than the default daemon mode. Numerous daemon mode specific features will not operate when this mode is used.z--enable-docszjFlag indicating whether the mod_wsgi documentation should be made available at the /__wsgi__/docs sub URL.z--debug-modeai  Flag indicating whether to run in single process mode to allow the running of an interactive Python debugger. This will override all options related to processes, threads and communication with workers. All forms of source code reloading will also be disabled. Both stdin and stdout will be attached to the console to allow interaction with the Python debugger.z--enable-debuggerzFlag indicating whether post mortem debugging of any exceptions which propagate out from the WSGI application when running in debug mode should be performed. Post mortem debugging is performed using the Python debugger (pdb).z--debugger-startupzFlag indicating whether when post mortem debugging is enabled, that the debugger should also be thrown into the interactive console on initial startup of the server to allow breakpoints to be setup.z--enable-coveragezPFlag indicating whether coverage analysis is enabled when running in debug mode.z--coverage-directoryzpOverride the path to the directory into which coverage analysis will be generated when enabled under debug mode.z--enable-profilerzMFlag indicating whether code profiling is enabled when running in debug mode.z--profiler-directoryzjOverride the path to the directory into which profiler data will be written when enabled under debug mode.z--enable-recorderzTFlag indicating whether recording of requests is enabled when running in debug mode.z--recorder-directoryzjOverride the path to the directory into which recorder data will be written when enabled under debug mode.z--enable-gdbzFlag indicating whether Apache should be run under 'gdb' when running in debug mode. This would be use to debug process crashes.z--gdb-executablegdbz(Override the path to the gdb executable.z--setup-onlya*  Flag indicating that after the configuration files have been setup, that the command should then exit and not go on to actually run up the Apache server. This is to allow for the generation of the configuration with Apache then later being started separately using the generated 'apachectl' script.c                     t        j                         }|j                  d       d}t        j                  |t        |      }|j                  |       \  }}t        d|t        |             y )N z#%prog setup-server script [options]usager  	formattersetup-server)r  IndentedHelpFormatterset_long_opt_delimiterOptionParserr  
parse_args_cmd_setup_servervarsparamsr  r  r  r   r  s         r   cmd_setup_serverr  
  s`    ..0I$$S)1E""K!F ''/OWdndDM:r   c                 p   t         j                  dk(  rdgS g }g d}d}|D ]  }|r||v s
t         j                  j                  t         j                  j	                  | d|z              sK|s$|j                  d|j                         z         d}|j                  d|j                         z          |S )	Nr   z"-DMOD_WSGI_MPM_ENABLE_WINNT_MODULE)eventworkerpreforkFzmod_mpm_%s.soz-DMOD_WSGI_MPM_ENABLE_%s_MODULETz-DMOD_WSGI_MPM_EXISTS_%s_MODULE)r   r   r5   r6   r4   r   upper)modules_directory	preferredr$  workersfoundr   s         r   _mpm_module_definesr  
  s    	ww$455F,GE PDI-ww~~bggll+<#d*, -MM"Cdjjl"RS E?$**,NOP Mr   c           	      :   t        t        j                        |d<   t               |d<   |d   xs t	        j
                         |d<   t        j                  j                  |d         |d<   |d   sd |d<   d|d<   n|d   |d<   t        j                  dk(  r(d|d   d	|d
   d	t        j                         d|d<   n'd|d   d	|d
   d	t	        j                         d|d<   |d   st        j                  dk(  rt        j                         }nLt        j                  dk(  rd}n6t        j                  j!                  d      }|xs d}|j#                  d      }t        j                  dk(  r9|d|d   d|d
   dt        j                         j%                  dd      |d<   n(|d|d   d	|d
   d	t	        j                         |d<   t        j                  j'                  |d         st	        j(                  |d          |d   r%t        j                  j                  |d         |d<   |d   r%t        j                  j                  |d         |d<   |d   rOt        j                  j                  |d         |d<   |d   |d<   |dxx   dz  cc<   |d   |d<   |dxx   dz  cc<   |d   r%t        j                  j                  |d         |d<   |d   r%t        j                  j                  |d         |d<   |d   r|d   g}|sQ|d   dk7  r't+        j,                  |d   d       |d<   d!|d<   d"|d#<   n|d$   st	        j
                         |d$<   d%|d<   n_|d   d&v rt+        j                  |d'         |d<   n<|d   dk(  r,|d$   s!t+        j                  |d'         |d$<   d(|d<   nd)|d<   n|d'   |d<   |d*   rt+        j                  |d*         |d*<   |d+   rt+        j                  |d+         |d+<   |d,   rt+        j                  |d,         |d,<   t        j                  j-                  t        j                  j/                  t        j                  j/                  t0                    d-      |d.<   t        j                  j-                  t        j                  j/                  t        j                  j/                  t0                    d/      |d0<   t        j                  j3                  t+        j,                  |d.   d1            rd2|d3<   nd4|d3<   t        j                  j5                  |d         st+        j                  |d         |d<   |d$   st+        j,                  |d   d5      |d$<   	 t	        j(                  |d$          |d6   sd7|d6<   nd8j-                  |d6         |d6<   |d9   j9                  d      st+        j:                  d|d9   z         |d9<   |d9   dk7  r|d9   j#                  d      j=                  d      d:d  }|d$   }	 |D ]M  }t+        j,                  ||      }t        j                  j3                  |      r9t	        j(                  |       O 	 t        j                  j5                  |d$         st+        j                  |d$         |d$<   |d;   s	|d   |d;<   nd<|d=<   |d=   rd<|d><   	 t	        j(                  |d;          t        j                  j5                  |d;         st+        j                  |d;         |d;<   |d=   s t+        j,                  |d;   |d?         |d@<   n5t        j                  dk(  rdA|d@<   n	 t?        dBdC      5  	 d d d        dB|d@<   |d=   s t+        j,                  |d;   |dG         |dH<   n	 t?        dIdC      5  	 d d d        dI|dH<   |dJ   r|dJ   dKv r|dJ   |dL<   dM|dJ<   ndN|dL<   n
dO|dL<   dM|dJ<   |dJ   j%                  dPdQ      |dJ<   |dR   r|dR   j%                  dPdQ      |dR<   |dS   xr t+        j                  |dS         xs t+        j,                  |d   dT      |dS<   |dU   t+        j                  |dU         nd |dU<   |dU   t+        j,                  |d   dV      |dU<   	 t	        j(                  |dU          t        j                  dk7  rqt	        j                         d'k(  rZd'd l"}d'd l#}t	        jH                  |dU   |jK                  |dW         jL                  |jO                  |dX         jP                         |dY   g |dY<   |dZ   s|d[   r"|d   |dY   vr|dY   jS                  d'|d          |dZ   rd\d]g|d^<   n|d[   r|d^   sd\d]g|d^<   g }	d_t        jT                  v rt        jT                  d_   }
d`tW        |
      v rtY        jZ                         }|{|j\                  }|r^|j^                  |
j0                  k(  rE|j`                  d`k(  r6da|jb                  v r(|	je                  tg        |jb                  da                n|jh                  }|{|dY   jk                  |	       d	j-                  |dY         |db<   |dc   d u|dd<   |dc   xs d:|dc<   t        jl                  j%                  dd      |de<   |df   d'k7  |dg<   dh}|di   d'kD  r1|dj|di   z  z  }|dk   d'kD  r|dl|dk   z  z  }|dm   d'kD  r|dn|dm   z  z  }|do   d'kD  r1|dp|do   z  z  }|dq   d'kD  r|dl|dq   z  z  }|dr   d'kD  r|dn|dr   z  z  }||ds<   |dt   rdu|dv<   ndw|dv<   |dx   r[g }|dx   D ]L  \  }}t        j                  j5                  |      st+        j                  |      }|je                  ||f       N ||dx<   |dy   rt+        j                  |dy         |dy<   |dz   r
d"|d{<   d"|d|<   |d|   rd"|dt<   |d}   r[g }|d}   D ]L  \  }}t        j                  j5                  |      st+        j                  |      }|je                  ||f       N ||d}<   |dc   |d~   z  }|d   to        |d   |      }ndto        dtq        d|z              z   }|d   }|d   }|d   }|d}n|}||}n|}|d}n|}||d<   ||d<   to        d:tq        ||z              |d<   to        d:tq        ||z              |d<   to        d:tq        ||z              |d<   |d}n|}||}n|}|d}n|}||d<   |dkD  r!tq        |tq        |dz        d:z   z        |d<   nd|d<   |d   |d<   ||d   z  }tq        ts        jt                  |            |d<   |d   |k7  r|dxx   d:z  cc<   |d   |d   z  |d<   to        d:tq        ||d   z              |d<   to        |d   tq        ||d   z        |d   z        |d<   to        |d   tq        ||d   z        |d   z        |d<   |d[   rS|dc   |d~   z  }||d<   ||d<   ||d<   ||d<   ||d<   ||d<   |dc   |d<   |d~   |d<   |d~   |d<   |dc   |d<   ||d<   ||d<   t+        j,                  |d   d      |d<   t        j                  j!                  d|d         |d<   t        j                  dk7  r7t        j                  j5                  |d         stC        |d   gddg      |d<   |d   st+        jv                  |d         dz   |d<   |d   jy                  t{        |d               |d<   |d   	 t+        j                  |d         nd |d<   |d   	 t+        j                  |d         nd |d<   |d   |d   |d<   |d   Tt}        j~                         \  }}|d}|t}        j                  |      |d<   nt}        j                  |dz   |z         |d<   |d   j                         dv rqt}        j                  t|        j                        } 	 t}        j                  t|        j                  d       d|d<   t}        j                  t|        j                  |        |d   |d<   g |d<   d8j-                  |d         |d<   d8j-                  |d         |d<   |d   r|d=   s t+        j,                  |d;   |d         |d<   n5t        j                  dk(  rdA|d<   n	 t?        dBdC      5  	 d d d        dB|d<   |d   r+|d   je                  d       |d   je                  |d          |d   rdu|d<   ndw|d<   |d   r|d   }!n|d   }!|!|d<   |d
   dk(  r	d|!z  |d<   nd|!d	|d
   d|d<   |d   dk(  r	d|!z  |d<   n|d   d|!d	|d   d|d<   nd |d<   |d   r|d   je                  d       |d[   r|d   je                  d       d"|d<   t        |d   |d   |d   |d   |d   f      rd"|dZ<   |dZ   r|d   je                  dū       |dZ   r|d   rV|d   st+        j,                  |d   dǫ      |d<   nt+        j                  |d         |d<   	 t	        j(                  |d          |d   rV|d   st+        j,                  |d   dɫ      |d<   nt+        j                  |d         |d<   	 t	        j(                  |d          |d   rp|d   st+        j,                  |d   d˫      |d<   nt+        j                  |d         |d<   	 t	        j(                  |d          nd<|d<   d<|d<   d<|d<   d<|d<   d<|d<   d|d<   |d   rU|d   je                  dΫ       |d   j                         j9                  dϫ      r|d   je                  dЫ       |d   dd  |d<   |d   r|d   je                  dӫ       |d   r|d   r|d   r|d   je                  dԫ       |d   r|d   je                  dի       |d   r|d   je                  d֫       |d   r|d   je                  dث       |d   r|d   je                  dګ       |d   r|d   je                  dܫ       |d   r+|d   je                  dޫ       d8j-                  |d         |d<   |d   r|d   je                  d       |d   dk(  r|d   je                  d       |d   r|d   je                  d       |dt   r|d   je                  d       |d   r(|d   je                  d       |d   je                  d       |d   r|d   je                  d       |d   r|d   je                  d       |dR   r|d   je                  d       |d   r|d   je                  d       |d>   r|d   je                  d       |dg   d'k7  r|d   je                  d       |d   d'k7  r|d   je                  d       |dd   r|d   je                  d       |d   r|d   je                  d       |d   r|d   je                  d       |d*   r|d   je                  d       |d+   r|d   je                  d       |d,   r|d   je                  d       |d   r|d   je                  d       |d   r|d   je                  d       |d   s|d   r|d   je                  d       |d   r|d   je                  d        |d   r|d   je                  d       |db   r|d   je                  d       |d   r|d   je                  d       |d   r|d   je                  d       |d   rct        j                  j3                  t+        j,                  |d   d            r|d   je                  d	       n|d   je                  d
       |d   jk                  t        |d   |d^                t        j                  |d<   t        j                  |d<   t        j                  |d<   t        r|d   je                  d       t        |d<   d|d   d8d8j-                  |d         |d<   t        |       |d|   rt        |       t        d|d          |d   rt        d|d          |d   rt        dd|d   z         t        d|d          t        d|d          t        d|d@   d|d   d       |d   rt        d|dH          |d   rt        d|d          |d   r$t        dt+        j,                  |d   d1             |d   rt        d|d          |d   rt        d|d          |d   rt        d |d          t        j                  dk7  r|d   rt        d!|d          | d"k(  s|d#   rY|d   st        d |d   d$z          t        j                  dk7  r-|d   st        d!|d   d%z          t        d&|d   d'z          |dZ   rt        d(       n|d[   rt        d)       nt        d*       |dc   d:k(  r)t        d+|dc   |d~   z  d|dc   d,|d~   d-       n(t        d+|dc   |d~   z  d|dc   d.|d~   d-       |dZ   sr|d[   smt        d/|d0   z         |d1   rt        d2|d1   z         t        d3|d4   z         t        d5|d6   z         t        d7|d   d8|d   d9       t        d:|d;   z         t        d<|d          t        j                  j                          |d   sG|d   d$z   |d<   t        j                  j                  |d         st?        |d   dC      5 }"	 d d d        t        |       t        j                  dk7  rt        |       |S # t6        $ r Y (w xY w# t6        $ r  w xY w# t6        $ r Y w xY w# 1 sw Y   txY w# t@        $ r dDtC        dEgdEF      z  |d@<   Y w xY w# 1 sw Y   dxY w# t@        $ r dDtC        dEgdEF      z  |dH<   Y w xY w# t6        $ r Y w xY w# t|        j                  $ rH 	 t}        j                  t|        j                  d       d|d<   n# t|        j                  $ r Y nw xY wY sw xY w# 1 sw Y   xY w# t@        $ rB 	 t?        ddC      5  	 d d d        n# 1 sw Y   nxY wd|d<   n# t@        $ r d |d<   Y nw xY wY w xY w# t6        $ r Y 
w xY w# t6        $ r Y 
`w xY w# t6        $ r Y 	w xY w# 1 sw Y   xY w(=  Nsys_argvmod_wsgi_sorl   rP   listener_host	localhostr   z(wsgi:r0   rO   )daemon_namerr  darwinz/var/tmpTMPDIRz/tmpr   z
/mod_wsgi-r   r   ssl_certificate_filessl_certificate_key_filessl_certificatez.crtz.keyssl_ca_certificate_filessl_certificate_chain_filer0  r1  r*  rs  rs   TrV   document_rootz(static))rs   r(  r   ignored
overriddenhost_access_scriptauth_user_scriptauth_group_scriptdocsdocumentation_directoryimagesimages_directoryz
index.htmlz/__wsgi__/docs/documentation_urlzhttp://www.modwsgi.org/htdocsrS   Noner  rM   r   rh   Flog_to_terminalrotate_logserror_log_nameerror_log_fileCONz/dev/stderrrG   z|%stee)r8   access_log_nameaccess_log_filez/dev/stdoutaccess_log_format)commoncombinedlog_format_nickname	undefinedcustomr  "z\"error_log_formatpid_filez	httpd.pidrm   zpython-eggsrq   rr   r  r<  embedded_moder  r  r  
_bootstrap	bootstrapsite_packagesrk   	processesmultiprocesspython_homekeep_alive_timeout
keep_aliver	   header_timeoutz	header=%dheader_max_timeoutz-%dheader_min_ratez,MinRate=%dbody_timeoutz body=%dbody_max_timeoutbody_min_raterequest_read_timeoutserver_metricsOnrp   Offr`   newrelic_config_filewith_newrelicr@  rv   rd   threadsmax_clients
   g      ?initial_workersminimum_spare_workersmaximum_spare_workersg?g?prefork_max_clientsprefork_server_limitprefork_start_serversprefork_min_spare_serversprefork_max_spare_serversg?g333333?worker_max_clients   worker_threads_per_childworker_thread_limitworker_server_limitworker_start_serversworker_min_spare_threadsworker_max_spare_threadsz
httpd.confrF   r?   httpd_executablehttpdz	/usr/sbinprocess_namez (mod_wsgi-express)rewrite_rulesr  ro   rn   Cr   )r9  POSIXzen_US.UTF-8zC.UTF-8httpd_arguments_listr  r  r  startup_log_namestartup_log_filez/dev/ttyz-Er  verbose_debugging_flagserver_nameserver_hostP   z
http://%s/rK   zhttp://r  i  zhttps://%s/	https_urlzhttps://orphan_interpreterz-DORPHAN_INTERPRETERz-DEMBEDDED_MODEdisable_reloadingr=  enable_coverageenable_profilerrB  
enable_gdb-DONE_PROCESScoverage_directoryhtmlcovprofiler_directorypstatsrC  archiveunspecifiedparent_domainz-DMOD_WSGI_VIRTUAL_HOSTzwww.z-DMOD_WSGI_REDIRECT_WWW   http2z-DMOD_WSGI_WITH_HTTP2z-DMOD_WSGI_WITH_HTTPSz-DMOD_WSGI_VERIFY_CLIENTz-DMOD_WSGI_CERTIFICATE_CHAINssl_environmentz-DMOD_WSGI_SSL_ENVIRONMENT
https_onlyz-DMOD_WSGI_HTTPS_ONLYhsts_policyz-DMOD_WSGI_HSTS_POLICYr  z-DMOD_WSGI_SERVER_ALIASallow_localhostz-DMOD_WSGI_ALLOW_LOCALHOSTz-DMOD_WSGI_STATIC_ONLYenable_sendfilez-DMOD_WSGI_ENABLE_SENDFILEz-DMOD_WSGI_SERVER_METRICSserver_statusz-DMOD_WSGI_SERVER_STATUSdirectory_indexz-DMOD_WSGI_DIRECTORY_INDEXdirectory_listingz-DMOD_WSGI_DIRECTORY_LISTINGz-DMOD_WSGI_ERROR_LOG_FORMATr  z-DMOD_WSGI_ACCESS_LOGz-DMOD_WSGI_ROTATE_LOGSz-DMOD_WSGI_KEEP_ALIVEcompress_responsesz-DMOD_WSGI_COMPRESS_RESPONSESz-DMOD_WSGI_MULTIPROCESSz-DMOD_WSGI_WITH_LISTENER_HOSTerror_overridez-DMOD_WSGI_ERROR_OVERRIDEz-DMOD_WSGI_HOST_ACCESSz-DMOD_WSGI_AUTH_USERz-DMOD_WSGI_AUTH_GROUPchunked_requestz-DMOD_WSGI_CHUNKED_REQUEST	with_php5z-DMOD_WSGI_WITH_PHP5rL   rN   z-DMOD_WSGI_WITH_PROXYz-DMOD_WSGI_WITH_PROXY_HEADERSz-DMOD_WSGI_WITH_TRUSTED_PROXIESz-DMOD_WSGI_WITH_PYTHON_PATHsocket_prefixz-DMOD_WSGI_WITH_SOCKET_PREFIXz-DMOD_WSGI_DISABLE_RELOADINGrc   r  zmod_cgid.soz-DMOD_WSGI_CGID_SCRIPTz-DMOD_WSGI_CGI_SCRIPTpython_executableshlibpath_var	shlibpathz-DMOD_WSGI_LOAD_PYTHON_DYLIBpython_dylibz-f httpd_argumentszServer URL         :zServer URL (HTTPS) :zServer Status      :z%sserver-statuszServer Root        :zServer Conf        :zError Log File     : z (	log_levelzAccess Log File    :zStartup Log File   :zCoverage Output    :zProfiler Output    :zRecorder Output    :zRewrite Rules      :zEnviron Variables  :r  
setup_onlyz/rewrite.confz/envvarszControl Script     :z
/apachectlzOperating Mode     : debugzOperating Mode     : embeddedzOperating Mode     : daemonzRequest Capacity   : z process * z	 threads)z processes * z!Request Timeout    : %s (seconds)request_timeoutstartup_timeoutz!Startup Timeout    : %s (seconds)z%Queue Backlog      : %s (connections)daemon_backlogz!Queue Timeout      : %s (seconds)queue_timeoutzServer Capacity    : z (event/worker), z
 (prefork)z%Server Backlog     : %s (connections)server_backlogzLocale Setting     :)Urv  r   argvr   r   getcwdr5   r   r   getpassgetuserr    tempfile
gettempdirplatformr1   r   rstripr   r   mkdirr3   r4   r>   r   r6   isabsr   rZ  normpathr2   rw   IOErrorr;   r   r'   chowngetpwnampw_uidgetgrnamgr_gidinsertr   dirinspectcurrentframef_codeco_filenameco_namef_localsr   strr   extendr   maxr  mathfloorr   ljustr[  ro   getdefaultlocale	normalizer  	setlocaleLC_ALLErroranyr4  r  
executabler   SHLIBPATH_VAR	SHLIBPATH	_py_dylibry  r|  rx   stdoutr  r   r   r  )#commandr  r   tmpdirrD  subdirpartr   r'   r  r  framerE  r  r`   rb   rs   rd   r   r#  r%  min_spare_workersmax_spare_workersprefork_initial_workersprefork_min_spare_workersprefork_max_spare_workersworker_initial_workersworker_min_spare_workersworker_max_spare_workersr   languageencoding	oldlocalerP   r   s#                                      r   r  r    s!   sxx.GJ"WGM#*+>#?#N299;G #%77??7;N3O#PG 6?#' %#*6? 	ww$6=foFOW__."0  7>foFORYY["* =!77d?((*F\\X%FZZ^^H-F%vF]]3'F77d?@FFOWV_goo6G'Igd3' M" @FFOWV_biik&CGM" 77==/0
'(%&*,''//./+1&' )*.0ggoo23/5*+  !%'WW__)*&,!" +22C*D&'&'61'.56G.H*+*+v5+()-/WW__12.4)* +,024517,- }&'%&(2%.^^M*N&<GM"*2G&'%)GM"?++-99;(%/GM"%&*==%.%6%6tAw%?GM"'(H4?++4+<+<T!W+E()2&)5&%)!WGM"#$(1(9(9,-)/$% !"&/&7&7*+'-"# "#'0'8'8+,(.#$ *,bggooGGOOH%7'(.*0G%&"$'',,rwwGGOOH%0'(0#2G 
ww~~innW-F%G '8#$'@#$77==/0!*!2!27=3I!J?##,>>'-2H$ 
)* #$$* !$'HHW5E-F$G !=!,,S1!*!3!3C'-:P4P!Q
 }$&--c288=abA)	 %"5ww~~f-HHV$% 77==12#,#4#4W_5M#N ?##*=#9  &+!" !!&
)* 77==12#,#4#4W_5M#N $%$-NN7?3K()%+ ! 77d?(-G$%:--  -:()$%%.^^('2C*D&F!"	7mS)  *7G%&"#&'+AA-45H-IG)*+6G'(-5G)*)1%&'2#$#*+>#?#G#G%$G  !"&-.@&A&I&Ie'"# $J/ !I4E4EJ5! %.^^GM4J& J
 M". (//0FG48 M }%!*0F"	
'(77d?ryy{a/HHW]+LL188LL!1299; ~&"$| 8&'w~/FFN#**1g6I.JK|+3Y*?&'		!-./7.CG*+ Ms{{"KK-	#i.(((*E#||T--1C1CC3'5>>9!((U^^O-L)MN # N""=1 XXgn&=>GM%k2$>GN";/41GK ZZ//S9GM#$89Q>GL 1$g6F.G GG'(1, EG4H,I$II $%) MG<M4N$NN ~"
W^-D DD%&* EG4F,G$GG ?#a' MGO4L$LL &:G"# )-%&).%& !!():!; 	8Iv77==("**62""Iv#67	8 &5!"%&*3*;*;./+1&' )-%&,0()'($( ! !#$56 	3LD&77==("**62""D&>2	3 &5!"
 +&);;K})'-0+>3r3s['8#9::/0O 78 78"&"1 $;!$5! $'!$5!%0G!"&1G"#'*1c#k1/3 (4G#$+.q#%335 ,6G'(+.q#%335 ,6G'( !$!0 #9 #4  #& #4 $/G !R.1+[2%&*3, /-*+ /1*+%,-G%HG!"'"<==E%(E):%;G!"$%.%&!+&%,-B%C./&0G ! '*!&1F)GGH'JG"#*-./(73H+IIJ./0+1G&' +../(73H+IIJ./0+1G&'
 k*WY-??)4%&*5&'+6'(/:+,/:+,(3$%)0)=%&)0);%&.5i.@*+*1+*>&'.9*+.9*+%NN7=+A<PGL"$**..&'#)G 
ww$ww}}W%789*6/017[M+KG&' >""+"4"4*+#-/D#E &n5;;&')GN *1)A* !* 1 1O$!& O
 +22B*C+ "+!2!2$%"'  x #FOx #446(H & 0 0 :GH & 0 0C(1J KGHx N2$$V]]3		V]]M: -GH 		2h'GFO&(G"#'*xx+,(.G#$ "%'2C*D!EG}()*3..O,g6H.I+KG&' ww$.3*+@mS1  3@G./%&*+2248*+227;M3NO"#,0(),1()}}%v!GMv"%,  -1'&/B|#,t3			*379NO##$&'../EF&'../@A'+#$
G%&0A(B%&0A(BL!# $ !%|&'..?|$%/009.	1;,- 1:0A0A 4517,-!567 $%/009.1:,- 1:0A0A 4517,-!567 $%/009.	1;,- 1:0A0A 4517,-!567
 &+!"%*!"%*!"%*!" %,GO}&'../HI=!'')44V<*+223LM'.}'=ab'AGO$w&'../FG'*@"A./&'../FG()&'../IJ+,&'../MN !&'../KL|&'../FG}&'../GH &'../HI$'HHW5E-F$G ! !&'../KL!"h.&'../GH !&'../KL &'../JK&'../JK&'../IJ !&'../KL"#&'../MN!"&'../LM|&'../FG}&'../GH|!&'../FG#$)&'../NO~&'../HI&'../NO &'../JK#$&'../GH!"&'../EF"#&'../FG !&'../KL{&'../EF#$0E(F&'../FG&'&'../NO !&'../PQ}&'../LM&'../NO"#&'../MNz77>>)..1D)E  *+223KL*+223JK"#**(; <*+-. $'>>G *88GO&00GK&'../MN'GN/6|/DHHW345"7G !)'(&w/	
 '%.1{$gk&:;$&7'%.&HI	
 '-"89	
 ',"78	G4D,EK " # |$g.?&@A}$g.@&AB !$inn,-|'= 	>  !$g.B&CD !$g.B&CD$go&>?	ww$#$('2B*CD. GL$9'('-*@?*RS77d?+,,gm.Dz.QR('-*@<*OP|*+		!-.+,{q $WY%77$gi&8: 	; 	$WY%77$gi&8: 	; < )A1G<M4NNO$%5@Q8RRS5@P8QQR1GO4LLM,-w7L/MO 	P 

1G<L4M
MN	
 '("34JJ?##*=#9O#K ww~~go67go.4  7#	ww$ )N_  ,  		$    0,1L50 -0()0  	,).GU2, *,G%&	,T  ^ || 	  	:$-!<< 		4  AA!*c2 ! ! ! !
 7A 23 # ;6: 23;	AB      d s  	An= ):Ao $Ao Ao +Ao8 7Ao+9Ao8 ,Ap) 8Ap:Ap) 'BAq @)Aq C'As C3Ar;C5As IAt J:At& LAt6 nAun=	Ao
o	Ao
oAoo	Ao(o'Ao(o+Ao5o0Ao8 o8AppAppAp&p!Ap) p)Aq
q	Aq
q	AqqAqqAr8q1)ArrAr8rAr1r.Ar8r0Ar1r1Ar8r7Ar8r;Ass As s	AtsAs;sAs)s 	As;s)As2	s.As;s5Ats;Att	AttAttAttAtt	At#t"At#t&	At3t2At3t6	AuuAuuAuc                    t        j                         }|j                  d       d}t        j                  |t        |      }|j                  |       \  }}t        d|t        |            }|d   ry t        j                  dk(  rt                t        d       t        d       t        d	       t        d
       t        d       t        d       t        d       t                |d   }t        j                  t        j                        }|d   |d<   t        |d         }	|	j                  d|d   g       |	j                  dg       |d   t        j                  d<   t!        j"                  |g|	z          t%        j&                  d       y t)        j*                  |d   d      }t$        j,                  j/                         r|d   sd fd}
t1        j0                  t0        j2                  |
       t1        j0                  t0        j4                  |
       t1        j0                  t0        j6                  |
       t1        j0                  t0        j8                  |
       t1        j0                  t0        j:                  |
       t!        j<                  |ddgt        j>                        jA                          y t        jB                  ||dd       y )Nr  z#%prog start-server script [options]r  start-serverre  r   z>WARNING: The ability to use the start-server option on Windowsz>WARNING: is highly experimental and various things don't quitez;WARNING: work properly. If you understand a lot about usingz>WARNING: Python on Windows and Windows programming in general,z@WARNING: and would like to help to get it working properly, thenz?WARNING: you can ask about Windows support for the start-serverz-WARNING: option on the mod_wsgi mailing list.r5  r  MOD_WSGI_MODULES_DIRECTORYr;  z-frF   rH  r   rr  r~  r<  c                     t        j                  d       y | t        j                  fvr!t	        j
                  j                  |        y y )Nr   )r   exitr   SIGWINCHr   r   r   )signumr  processs     r   ra   z!cmd_start_server.<locals>.handlera  s;    ?HHQK foo%66V4 7r   r   z-DFOREGROUND)
preexec_fn)"r  r  r  r  r  r  r  r  r   r   rx   copydeepcopyr1   r   r  
subprocesscallr   r  r3   r4   r  isattyr   r   SIGTERMSIGHUPSIGUSR1r  Popensetpgrpwaitexecl)r  r  r  r  r   r  configr  r1   rc  ra   r  s              @r   cmd_start_serverr  1  s/   ..0I$$S)1E""K!F ''/OWd~tT']CFl	ww$NONOKLNOPQOP=>./
--

+067J0K,-v&<=>f\&:;<0139:M3N

/0_45 ^^F=$9;G
::vl';G5 MM&--1MM&..'2MM&--1MM&..'2MM&//73 &&
G^'L!zz+G LLN HHZWnEr   c                    t        j                         }|j                  d       d}t        j                  ||      }|j	                  |       \  }}t        |      dk7  r|j                  d       t        j                  dk(  rpt        t        dd       }t        t        dd       }|xs |xs t        j                  }t        j                  d	      }d
|z  }	t        j                  ||	      }
t        j                   j#                  |
      sd
|d   z  }	t        j                  |d|	      }
t        j                   j#                  |
      sd }
|
r5t        j$                  |
      }
|
j'                  dd      }
t)        d|
z         t+               }|j'                  dd      }t        j                  }t        j$                  |      }|j'                  dd      }t)        d|z         t)        d|z         y t+               }t        j                  }t        j$                  |      }t,        rt)        dt,        z         t)        d|z         t)        d|z         y )Nr  z%prog module-configr  r  r   Incorrect number of arguments.r   real_prefixbase_prefixVERSIONzpython%s.dllDLLsr   r   LoadFile "%s"LoadModule wsgi_module "%s"WSGIPythonHome "%s")r  r  r  r  r  r[  errorr   r   r   r   r   	sysconfigget_config_varr3   r4   r5   r6   ru  r   rx   r   r  )r  r  r  r  r   r  r  r  library_versionlibrary_namelibrary_pathmodule_pathr   s                r   cmd_module_configr  w  s   ..0I$$S)!E"")DF''/OWd
4yA~56	ww$c=$7c=$7!>[>CJJ#229=%7 ~~k<@ww~~l+)OA,>>L$>>+v|LLww~~l+L$--l;L'//c:L/L01g!))$4##F+c*+k9:#f,- g##F+/I-.+k9:#f,-r   c                    t        j                         }|j                  d       d}t        j                  ||      }|j	                  ddt
        j                         |j                  |       \  }}t        |      dk7  r|j                  d       t        j                  t        j                  |j                  t        j                  t                          }t!        j"                  t%               |       t&        rt)        d	t&        z         t)        d
|z         t)        dt        j*                  t,        j.                        z         y )Nr  z%prog install-module [options]r  r  	DIRECTORY)r  r8   r   r  r  r  r  )r  r  r  r  r  r   
LIBEXECDIRr  r[  r  r3   r   r4   r  r   r   shutilcopyfiler   r  rx   ru  r   r   )r  r  r  r  r   r  r   s          r   cmd_install_moduler    s   ..0I$$S),E"")DF
+[**  , ''/OWd
4yA~56y~~g.G.G{+ - .F OOEGV$o	)*	
'&
01	
)"4"4SZZ"@
@Ar   c                    t        j                         }|j                  d       d}t        j                  ||      }|j	                  |       \  }}t        |      dk7  r|j                  d       t        t                      y )Nr  z%prog module-locationr  r   r  )	r  r  r  r  r  r[  r  rx   r   r  s         r   cmd_module_locationr    sj    ..0I$$S)#E"")DF''/OWd
4yA~56	%'Nr   zM
    %prog command [params]

Commands:
    module-config
    module-location
z
    %prog command [params]

Commands:
    install-module
    module-config
    module-location
    setup-server
    start-server
c                     t        j                  t        j                               } t        j
                  dd  }|s| j                  d       |j                  d      }|D cg c]!  }t        j                  j                  |      # }}t        j                  dk(  rE|dk(  rt        |       y |dk(  rt        |       y |dk(  rt        |       y | j                  d       y |d	k(  rt        |       y |dk(  rt        |       y |dk(  rt        |       y |d
k(  rt!        |       y |dk(  rt        |       y | j                  d       y c c}w )Nr   zNo command was specified.r   r   zmodule-configzmodule-locationr  zInvalid command was specified.zinstall-moduler  )r  r  
main_usagestripr   rk  r  popr   r5   
expandvarsr   r  r  r  r  r  )r  r  r  args       r   mainr    s   "":#3#3#56F88AB<D01hhqkG/34BGGs#4D4	ww$o%d#))%&T"LL9:&&t$'d#))%&T"&T"LL9:/ 5s   #&E
c                  ,    t        t        |              y r   )r  r   )r  s    r   r   r     s    T$Z r   __main__)r   r   )v
__future__r   r   r   r   r   r  r  r  r  r   r   r   r6  rg  r	  r  r  ro   r~  rm  ro  r  r3   Queuer   ImportErrorr	   r   version_info_py_version	_py_soabi	_py_soextr  r  r  r4   r5   r6   r   r>   r   r   r   r   r%   r-   r;   rB   SHELLry   rz   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Threadr   daemonr   r   r   objectr   r   r&  rc  rt  ru  rw  ry  r{  r|  r  r  r  r  r  r  r  
ROTATELOGSr?   r  r  r  r  r  r  r  r  r  r  r   r   r   r   r   <module>r     sM   @ @ 	 
         	          s''++				(	((1I(	((6I,I,,T2	 	  -$I$$X.$I$$[1"INN#;9#;#;H#E(	((57	ww~~i(I
 $/	:inn.Y..x8+F	ww~~k"y*5y)LK )..!2!2!28!<kJK	ww~~k"rww$!9!9!9,!GGK'',,rwwx8+FK%%dC0K	$ !%B 
 	fd^&6%78j X! ( $. *"! !     4       
    
 "" 4}<~ 					(@@ )

(
+) )Vd f d L< <B(<f (<Tg R	 * X6 @8
j X $/ >( 5& )* 5/4" 	*/
0 5(D, 
 5(Du  GH 5)L%9: 5.uh'( 5,UH 6 68 5*D # 5. #>? 5%t #./ 5-t #FG 5'!9./ 50$ #FG
 5%l +,
 5. &' 5/456 5/4GH
 5"8z 9GH 5%l GH
 6=uh67
 5+E1h=> 6?  CD 6&Wd6F78 9 6,7hz! )DE 6,7hz! )DE 5(uh  BC 5&UA   ! 6&UB !89 6'eQ !,- 6'eS ! 6%E3 !/0 6'eR !"# 6'eQ ! 6'eR !12 6)q !AB 6&x
 :DE 6&UB ! 6&UB !FG 5$5" !EF
 5#% !CD 5$5" !GH 5(ub !BC 5%E3 => 5" !"# 5&UA !CD 5#% *+ 5$5#  ?@ 6%E3  9: 6'eQ  9:
 6*  9:
 6)q  >?
 6+%    6.UA !IJ 5%l 34 6( &' 6( ./ 68%5%7 "?@ 69&7&9 <= 5%} $%
 5%v %IJ 5#-=/0 5%{+, 5' EF
 5$.>   5/:s
 5-$G
 5$XQ(9 A
 5$\ ?@ 5'!>DE 5%ha!>##% 5("N
 5(2$m9:
 5/(B(;
 5(ua !34 5( 34
 5$\ &'
 5#L 
 5(- )* 5& *+ 5- AB
 5' ()
 5.& 45 5"8k 9 5#[CD
 6%{>?
 68T6##% 5*dF 5*XQ <
 5+h % 7 5'1A-. 5,=> 5/+;89 6>(#V ;01 5#-=AB 5-GI 5.u9: 6?<23 5' x'='=? 6&| 23 5'<> ? 5&;= > 5$k #BC D 5%{ $BC D 6' %BC D 6?<HJ K 6#QU EF G 6,&&>@ A 5/(%5 =DE 5/+;%&
 6' # !
 6'1B1B # 6#V ;  5'1G1G  (() 6>>+; #'( 6$.>GH
 5/(!(?45 5%l :; 8&| => 8,\ 
 8/ 
 8-{  8-v GH 8]<:; 5,|U
 6%ha(=)* 6#HA&8 6$XQ 6' *= 
 5( AB 6$\5<=
 5/,;< 6>,HI 6&| !" # 6' BC D 6&| 12 6)3C 
 6&| 12 6)3C 
 6&| :; 6)3C 
 6>, 12
 6%u # 6>,&
;"l\DFL8.tB2 77d?J	J!;F! zF qw  8  		s%   p: ?Cq
 :	qq
qq