+
    8Li                     ~   R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	H
t
Ht ^ RIHtHt ^ RIHtHt ^ RIHtHtHtHtHtHtHt ^ RIHtHtHtHtHtH t H!t!H"t"H#t# ]PH                  R8  d   ^ RI%H&t& M^ RIH&t& Rt'RR	 R
 llt(]RR R ll4       t)]R R l4       t)]R R l4       t)]R R l4       t)RR R llt)R R lt*R# )zaPython client for Nvim.

Client library for talking with Nvim processes via its msgpack-rpc API.
N)SimpleNamespace)ListOptionalcastoverload)VERSION__version__)Nvim	NvimError)ErrorResponseSessionTTransportTypechild_sessionsocket_sessionstdio_sessiontcp_session)	Hostautocmdcommanddecodeencodingfunctionplugin
rpc_exportshutdown_hook)Literalc                >    V ^8  d   QhR\         \        ,          RR/# )   sessionreturnN)r   r   )formats   "1/usr/lib/python3/dist-packages/pynvim/__init__.py__annotate__r"   !   s     4 4) 4T 4    c                   . p\         P                   F  p\        P                  P	                  V4      w  r4VR8X  d   VP                  V4       K>  \        P                  P                  V4      '       g   Ke  \        P                  P                  VR4      p\        P                  P                  V4      '       g   K  VP                  V4       K  	  \        V4       FL  pVR,           p\        P                  P                  V4      '       g   K3  Wq9   g   K;  VP                  V4       KN  	  VR.8X  d   RpMRp\        V4       V '       g   \        4       p \        P                  ! V 4      p	V	P                  P                   ^8  d6   \         P"                  P%                  R4       \         P&                  ! ^4       \)        V	4      p
V
P+                  V4       R# )a6  Promote the current process into python plugin host for Nvim.

Start msgpack-rpc event loop for `session`, listening for Nvim requests
and notifications. It registers Nvim commands for loading/unloading
python plugins.

The sys.stdout and sys.stderr streams are redirected to Nvim through
`session`. That means print statements probably won't work as expected
while this function doesn't return.

This function is normally called at program startup and could have been
defined as a separate executable. It is exposed as a library function for
testing purposes only.
z.pyz__init__.pyzscript_host.pyscriptrpluginz3This version of pynvim requires nvim 0.1.6 or laterN)sysargvospathsplitextappendisdirjoinisfilelistremovesetup_loggingr   r	   from_sessionversion	api_levelstderrwriteexitr   start)r   pluginsarg_extinitr*   dupnamenvimhosts   &          r!   
start_hostrC   !   sE    Gxx!!#&%<NN3WW]]377<<]3Dww~~d##s#  WUl77==3>NN3  #$$$/W%D||!

 8 	9:DJJwr#   c                V    V ^8  d   QhR\         R,          R\        R\        R\        /# )r   session_typetcpaddressportr   )r   strintr	   )r    s   "r!   r"   r"   Y   s      U U U# US UD Ur#   c                     R # N )rE   rG   rH   s   &&&r!   attachrN   X   s    RUr#   c                J    V ^8  d   QhR\         R,          R\        R\        /# )r   rE   socketr*   r   )r   rI   r	   )r    s   "r!   r"   r"   ]   s     F F* FS FT Fr#   c                    R # rL   rM   )rE   r*   s   &$r!   rN   rN   \   s    CFr#   c                `    V ^8  d   QhR\         R,          R\        \        ,          R\        /# )r   rE   childr(   r   )r   r   rI   r	   )r    s   "r!   r"   r"   a   s      K K) KDI K$ Kr#   c                    R # rL   rM   )rE   r(   s   &$r!   rN   rN   `   s    HKr#   c                >    V ^8  d   QhR\         R,          R\        /# )r   rE   stdior   )r   r	   )r    s   "r!   r"   r"   e   s     7 7) 7d 7r#   c                     R # rL   rM   )rE   s   &r!   rN   rN   d   s    47r#   c                    V ^8  d   QhR\         R\        \        ,          R\        R\        \        ,          R\        \        \        ,          ,          R\
        R,          R\        /# )	r   rE   rG   rH   r*   r(   r   Tr   )r   r   rI   rJ   r   r   r	   )r    s   "r!   r"   r"   h   sc     /: /: /:c]/: /: 3-	/:
 49
/: DM/: 
/:r#   c                ~   V R8X  d   \        \        \        V4      V4      M]V R8X  d   \        \        \        V4      4      M=V R8X  d   \	        4       M,V R8X  d%   \        \        \        \        ,          V4      4      MRpV'       g   \        RV ,          4      h\        P                  ! V4      P                  V4      # )a  Provide a nicer interface to create python api sessions.

Previous machinery to create python api sessions is still there. This only
creates a facade function to make things easier for the most usual cases.
Thus, instead of:
    from pynvim import socket_session, Nvim
    session = tcp_session(address=<address>, port=<port>)
    nvim = Nvim.from_session(session)
You can now do:
    from pynvim import attach
    nvim = attach('tcp', address=<address>, port=<port>)
And also:
    nvim = attach('socket', path=<path>)
    nvim = attach('child', argv=<argv>)
    nvim = attach('stdio')

When the session is not needed anymore, it is recommended to explicitly
close it:
   nvim.close()
It is also possible to use the session as a context manager:
   with attach('socket', path=thepath) as nvim:
       print(nvim.funcs.getpid())
       print(nvim.current.line)
This will automatically close the session when you're done with it, or
when an error occurred.


rF   rP   rV   rS   NzUnknown session type "%s")r   r   rI   r   r   r   r   	Exceptionr	   r3   with_decode)rE   rG   rH   r*   r(   r   r   s   &&&&&& r!   rN   rN   h   s    J 2>1FDg&-+78+CtC''720<0Gd49d+,  3lBCCW%11&99r#   c                (    V ^8  d   QhR\         RR/# )r   r@   r   N)rI   )r    s   "r!   r"   r"      s        r#   c                   \         P                  ! \        4      pR\        P                  9   Ed2   \        P                  R,          P                  4       p\        P                  ^ ,          pRP                  W#V 4      p\         P                  ! VRR4      p\         P                  ! R4      Vn        \         P                  P                  V4       \         P                  p\        P                  P                  RR4      pVeK   \!        \         VP                  4       R4      p\#        V\$        4      '       d   TpMVP'                  RV4       VP)                  V4       R# R# )	z1Setup logging according to environment variables.NVIM_PYTHON_LOG_FILEz
{}_py{}_{}wzutf-8z\%(asctime)s [%(levelname)s @ %(filename)s:%(funcName)s:%(lineno)s] %(process)s - %(message)sNVIM_PYTHON_LOG_LEVELNz.Invalid NVIM_PYTHON_LOG_LEVEL: %r, using INFO.)logging	getLogger__name__r)   environstripr'   version_infor    FileHandler	Formatter	formatterroot
addHandlerINFOgetgetattr
isinstancerJ   warningsetLevel)	r@   loggerprefixmajor_versionlogfilehandlerlevelenv_log_levellvls	   &        r!   r2   r2      s
   x(F+2399;((+%%fTB%%gsG<#--NO 	(

'>E$'=#6#6#8$?C#s##O,.% ,r#   )      )r   r   r   r   rC   r   r   r   r   r   r   r   r   r	   r
   Versionr   r   r   rN   r2   r   rL   )  )Nr}   NNT)+__doc__ra   r)   r'   typesr   r|   typingr   r   r   r   pynvim._versionr   r   
pynvim.apir	   r
   pynvim.msgpack_rpcr   r   r   r   r   r   r   pynvim.pluginr   r   r   r   r   r   r   r   r   rf   typing_extensionsr   __all__rC   rN   r2   rM   r#   r!   <module>r      s     	 
 , 1 1 0 &- - -> > > f)4n 
 U 
 U 
 F 
 F 
 K 
 K 
 7 
 7/:dr#   