
    ^h&                     \   S SK r S SKJr  S SKrS SKrSSKJr  \R                  R                  \R                  R                  \
5      5      rS\R                  " \5      ;  a  \R                  R                  \5      rSS jrS rSS jrS	 rS
 rSS jr\ R&                  SS j5       rS rg)    N)import_module   )_utilpydevdc                 \    S/nU (       d  U$ U Vs/ s H  n[        U5      PM     sn$ s  snf )z%Return the list of vendored projects.r   )project_root)resolveprojectsnames      T/home/james-whalen/.local/lib/python3.13/site-packages/debugpy/_vendored/__init__.pylist_allr      s0     zH+3484L8444s   )c                 \    U (       d  Sn [         R                  R                  [        U 5      $ )zReturn the path the root dir of the vendored project.

If "project" is an empty string then the path prefix for vendored
projects (e.g. "debugpy/_vendored/") will be returned.
 )ospathjoinVENDORED_ROOT)projects    r   r   r      s!     77<<w//    c              +   "  #    U(       aF  [         R                  " [        5         [         R                  " U 40 UD6 H  nUv   M	     SSS5        g[	        U 5      n[         R                  " U40 UD6 H  nUv   M	     g! , (       d  f       g= f7f)zAYield (dirname, basename, filename) for all files in the project.N)r   cwdr   iter_all_filesr   )r   relativekwargsresultroots        r   iter_project_filesr   (   so     YY}%..wA&A B &% G$**4:6:FL ; &%s   "B#A>7B>
BBc              #      #    SnSn [        SR                  U 5      [        5      n[        USU5      n[        USU5      n[        U SXS9nU H
  u    pVUv   M     g! [         a     N(f = f7f)zYield the filenames for all files in the project.

The filenames are relative to "debugpy/_vendored".  This is most
useful for the "package data" in a setup.py.
Nz._{}_packaging	prune_direxclude_fileT)r   r   r    )r   format__name__getattrImportErrorr   )r   r   r    modresults_filenames          r   iter_packaging_filesr)   4   s      ILB,33G<hG Ci8	sNLA $)G "1 "  s'   A-A 6A-
A*'A-)A**A-c                  &   ^  T (       d   eU 4S jnU$ )zBReturn a module match func that matches any of the given prefixes.c                 H   > T H  nU R                  U5      (       d  M    g   g)NTF)
startswith)r   moduleprefixprefixess      r   matchprefix_matcher.<locals>.matchO   s$    Fv&&  r    )r/   r0   s   ` r   prefix_matcherr3   K   s    O8 Lr   c                 D   Uc  [        U 5      n/ n0 n[        [        R                  R	                  5       5       HX  u  pVU" XV5      (       d  M   [        USS5      nU(       d  UR                  U5        M<  UR                  U5      (       a  MT  XtU'   MZ     XC4$ !   Sn NC= f)z5Verify that only vendored modules have been imported.N__file__)r   listsysmodulesitemsr#   appendr,   )r   r0   r   
extensions
unvendoredmodnamer%   r(   s           r   check_modulesr>   Y   s    |G$JJS[[..01W""	sJ5H g&$$T**"*w 2 !!	Hs   BBc              #      #    Uc  [        U 5      n[        R                  R                  SU5         Uv   [        R                  R	                  U5        g! [        R                  R	                  U5        f = f7f)zDA context manager under which the vendored project will be imported.Nr   )r   r7   r   insertremove)r   r   s     r   vendoredrB   m   sR      |G$HHOOAt
s   /A:A  A:!A77A:c                 x    [        U 40 UD6   U H  n[        U5        M     SSS5        g! , (       d  f       g= f)z=Import each of the named modules out of the vendored project.N)rB   r   )r   r8   r   r   s       r   	preimportrD   z   s-    	'	$V	$D$  
%	$	$s   +
9)F)N)
contextlib	importlibr   r   r7   r   r   r   dirnameabspathr5   r   listdirr   r   r   r)   r3   r>   contextmanagerrB   rD   r2   r   r   <module>rK      s   
  # 	 
   9: 2::m,,GGOOM2M50	."( 	 	 r   