
    -hH                     h    S r SSKrSSKJr  SSKrSSKrSSKrSSKrSSKrSSK	J
r
  Sr\S4S jrS rg)z
Utilities for end-users.
    N)
namedtuple)InterpreterFc                   ^ ^ [         (       a$  [        R                  " SS[        R                  S9   " UU 4S jS5      n SSKnSSKnUR                  U" 5       R                  5        UR                  S5        UR                  S	5        UR                  S
5        UR                  S5        UR                  S5        UR                  S5        g! [         a    [        S5         gf = f)a	  
This function sets up :mod:`readline` to use Jedi in a Python interactive
shell.

If you want to use a custom ``PYTHONSTARTUP`` file (typically
``$HOME/.pythonrc.py``), you can add this piece of code::

    try:
        from jedi.utils import setup_readline
    except ImportError:
        # Fallback to the stdlib readline completer if it is installed.
        # Taken from http://docs.python.org/2/library/rlcompleter.html
        print("Jedi is not installed, falling back to readline")
        try:
            import readline
            import rlcompleter
            readline.parse_and_bind("tab: complete")
        except ImportError:
            print("Readline is not installed either. No tab completion is enabled.")
    else:
        setup_readline()

This will fallback to the readline completer if Jedi is not installed.
The readline completer will only complete names in the global namespace,
so for example::

    ran<TAB>

will complete to ``range``.

With Jedi the following code::

    range(10).cou<TAB>

will complete to ``range(10).count``, this does not work with the default
cPython :mod:`readline` completer.

You will also need to add ``export PYTHONSTARTUP=$HOME/.pythonrc.py`` to
your shell profile (usually ``.bash_profile`` or ``.profile`` if you use
bash).
z/tmp/jedi.loga)filenamefilemodelevelc                   $   > \ rS rSrU U4S jrSrg)setup_readline.<locals>.JediRLD   c                   > US:X  a  [         R                  R                  S[        R                  " 5       5         [
        R                  " S[        U5      -   5        [        UTR                  /5      nUR                  TS9n[
        R                  " SU5        U Vs/ s H+  nUS[        U5      UR                  -
   UR                  -   PM-     snU l         [         R                  R%                  S5         U R                  U   $ s  snf !   [
        R                  " S[         R"                  " 5       -   5        e = f! [         R                  R%                  S5        f = f! [&         a     gf = f)a+  
This complete stuff is pretty weird, a generator would make
a lot more sense, but probably due to backwards compatibility
this is still the way how it works.

The only important part is stuff in the ``state == 0`` flow,
everything else has been copied from the ``rlcompleter`` std.
library module.
r   zStart REPL completion: )fuzzyzREPL completions: %sNzREPL Completion error:
)syspathinsertosgetcwdloggingdebugreprr   __dict__completelen_like_name_lengthname_with_symbolsmatcheserror	traceback
format_excpop
IndexError)selftextstateinterpretercompletionscr   namespace_modules         ]C:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\jedi/utils.pyr   'setup_readline.<locals>.JediRL.completeE   s,    z299;/$MM";d4j"HI"-d5E5N5N4O"PK"-"6"6U"6"CKMM"8+F "-$!,A =c$i!*=*==>ATATT!,$DL HHLLO||E**$MM"<y?S?S?U"UVHHLLO  s<   A#D 2D	D :E$ 	D /D==E   !E!$
E10E1)r   N)__name__
__module____qualname____firstlineno__r   __static_attributes__)r   r(   s   r)   JediRLr   D   s     	  	    r0   r   Nztab: completezset completion-ignore-case onzset show-all-if-unmodifiedzset show-all-if-ambiguous onz&set completion-prefix-display-length 2 z$Jedi: Module readline not available.)READLINE_DEBUGr   basicConfigDEBUGrlcompleterreadlineset_completerr   parse_and_bindset_completer_delimsImportErrorprint)r(   r   r0   r6   r7   s   ``   r)   setup_readliner=      s    T ~$--	
! !F*
 	 	vx0010 ?@ <= >? HI%%b)  6456s   C C('C(c            	          [        SS5      n SSKJn  [        R                  " SU5      nU " [        U5       VVs/ s H  u  p4US:X  a  UO
[        U5      PM     snn6 $ s  snnf )zS
Returns a namedtuple of Jedi's version, similar to Python's
``sys.version_info``.
Versionzmajor, minor, micror   )__version__z
[a-z]+|\d+   )r   jedir@   refindall	enumerateint)r?   r@   tuplixs        r)   version_inforJ   ~   sV    
 $9:G ::m[1D4I!q&Qc!f,IJJIs   A
)__doc____main__collectionsr   r   r   rC   r   r   rB   r   r3   r=   rJ    r1   r)   <module>rO      s?     "   	 	 
   %-E h*VKr1   