o
    ,wi;                     @   s6   d Z dd Zdd Ze d e_ edkre  dS dS )z?
The real functionality to run this package as a main module.

c                  C   s&  dd l } ddlm} i }| jdd  }d}d}t \}}}|r|d dr|d dd  }	|	dkr7|d7 }n@|	d	kr>d
}n9|	drT|	dd|v rTd||	dd  < n#|	|v rld||	< |	|v rk|D ]}
||
d qbn| |d d|	   |d= |r|d ds&|rdd l	}dd l
}tdddd | D   td| j ddf  td|| j  td|t| j   td|   |st| d S || jd d < ztj}W n ty   d}Y nw | jt | j|< d| jv sJ |di | dd l}t||}|| jd ddS )N       	patch_allFrun_pathz--   verbosemodule
run_modulezno-    Tz

zCannot patch %rzgevent.monkey.patch_all(%s), c                 s       | ]}d | V  qdS )z%s=%sN ).0itemr   r   P/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/gevent/monkey/_main.py	<genexpr>(       zmain.<locals>.<genexpr>zsys.version=%s
 zsys.path=%szsys.modules=%szcwd=%szgevent.monkey__main__)run_namer   )sysr
   r   argv_get_script_help
startswithreplace
setdefaultexitpprintosprintjoinitemsversionstrippformatpathsortedmoduleskeysgetcwd__spec__name	NameError__name__runpygetattr)r   r   argsr   r   run_fnscript_helppatch_all_argsr)   optionr   r   r    mod_namer0   run_methr   r   r   main   s^   
 

r9   c                  C   sV   dd l } ddlm} | j}||d }dd |D }dddd	 |D  }|||fS )
Nr   r   r   c                 S   s   g | ]}d | t  v r|qS )patch_)globals)r   xr   r   r   
<listcomp>Y   s    z$_get_script_help.<locals>.<listcomp>a  gevent.monkey - monkey patch the standard modules to use gevent.

USAGE: ``python -m gevent.monkey [MONKEY OPTIONS] [--module] (script|module) [SCRIPT OPTIONS]``

If no MONKEY OPTIONS are present, monkey patches all the modules as if by calling ``patch_all()``.
You can exclude a module with --no-<module>, e.g. --no-thread. You can
specify a module to patch with --<module>, e.g. --socket. In the latter
case only the modules specified on the command line will be patched.

The default behavior is to execute the script passed as argument. If you wish
to run a module instead, pass the `--module` argument before the module name.

.. versionchanged:: 1.3b1
    The *script* argument can now be any argument that can be passed to `runpy.run_path`,
    just like the interpreter itself does, for example a package directory containing ``__main__.py``.
    Previously it had to be the path to
    a .py source file.

.. versionchanged:: 1.5
    The `--module` option has been added.

MONKEY OPTIONS: ``--verbose %s``r   c                 s   r   )z	--[no-]%sNr   )r   mr   r   r   r   o   r   z#_get_script_help.<locals>.<genexpr>)inspectr
   r   getfullargspecr"   )r?   r   getterr5   r)   r4   r   r   r   r   R   s   
r   r   r   N)__doc__r9   r   r/   r   r   r   r   <module>   s   J 
