
    |h                     .    d Z ddlZddZddZddZd Zy)	a2  This module enables interactive mode in Python Fire.

It uses IPython as an optional dependency. When IPython is installed, the
interactive flag will use IPython's REPL. When IPython is not installed, the
interactive flag will start a Python REPL with the builtin `code` module's
InteractiveConsole class.
    Nc                 z    t        t        | |             	 t        |        y# t        $ r t	        |        Y yw xY w)a  Drops into a Python REPL with variables available as local variables.

  Args:
    variables: A dict of variables to make available. Keys are variable names.
        Values are variable values.
    verbose: Whether to include 'hidden' members, those keys starting with _.
  N)print_AvailableString_EmbedIPythonImportError
_EmbedCode)	variablesverboses     L/var/www/html/test/engine/venv/lib/python3.12/site-packages/fire/interact.pyEmbedr      s8     G,-)	 ys   # ::c                    g }g }| j                         D ]Z  \  }}|s|j                  d      rd|v sd|v r#t        j                  |      r|j	                  |       J|j	                  |       \ d|fd|fg}g }|D ]8  \  }}|s	dj                  t        |            }	|j	                  | d|	        : dj                  |      }
d	|
 dS )
ag  Returns a string describing what objects are available in the Python REPL.

  Args:
    variables: A dict of the object to be available in the REPL.
    verbose: Whether to include 'hidden' members, those keys starting with _.
  Returns:
    A string fit for printing at the start of the REPL, indicating what objects
    are available for the user to use.
  _-/ModulesObjectsz, z: 
z;Fire is starting a Python REPL with the following objects:
)items
startswithinspectismoduleappendjoinsorted)r	   r
   modulesothernamevaluelists	list_strsvarlist	items_str	lists_strs              r   r   r   *   s     '
%__& 	kdEts+
d{cTknnTll4	 '%% ) /mdG))F7O,i$r)-./
 ii	")D	2    c                 >    ddl }|xs g }|j                  ||        y)a  Drops into an IPython REPL with variables available for use.

  Args:
    variables: A dict of variables to make available. Keys are variable names.
        Values are variable values.
    argv: The argv to use for starting ipython. Defaults to an empty list.
  r   N)argvuser_ns)IPythonstart_ipython)r	   r&   r(   s      r   r   r   Q   s#     	$	T95r$   c                 J    dd l }|j                  |       j                          y )Nr   )codeInteractiveConsoleinteract)r	   r+   s     r   r   r   ^   s    )$--/r$   )F)N)__doc__r   r   r   r   r    r$   r   <module>r0      s$     $N
60r$   