
    Gg@                         d dl Z d dlZd dlmZ d dlZej
                  dk\  rd dlmZ nd dlZde	de	de	fdZ
dd	Z G d
 dej                        Zy)    N)protoc   	   r   )	resourcespackage_or_requirementresource_namereturnc                     d}t         j                  dk\  r1t        j                  |       |z  j	                         }t        |      S t        j                  | |      }t        |      S )z6Obtain the filename for a resource on the file system.Nr   )sysversion_infor   filesresolvepkg_resourcesresource_filenamestr)r   r	   	file_names      o/home/kushmeetdev/apache_webroot/langgraph_flaskproject/venv/lib/python3.12/site-packages/grpc_tools/command.py_get_resource_file_namer      sd     I
9$OO23mC
') 	 y> "33"M
	 y>    c           
         g }t         j                  j                  |       }t        j                  |      D ]k  \  }}}|D ]`  }|j	                  d      s|j                  t         j                  j                  t         j                  j                  ||                   b m t        dd      }|D ]  }	ddj                  |      dj                  |      dj                  |      dj                  |      dj                  |      g|	gz   }
t        j                  |
      d	k7  ss|rt        d
j                  |
            t        j                  j                  dj                  |
              y )Nz.proto
grpc_tools_protozgrpc_tools.protocz--proto_path={}z--python_out={}z--pyi_out={}z--grpc_python_out={}r   zerror: {} failedzwarning: {} failed)ospathabspathwalkendswithappendjoinr   formatr   main	Exceptionr   stderrwrite)package_rootstrict_modeproto_filesinclusion_rootroot_r   filenamewell_known_protos_include
proto_filecommands              r   build_package_protosr0   +   sI   KWW__\2N''.1 a 	H  *""GGOOBGGLLx$@A	 !8h O! G
$$^4$$%>?$$^4!!.1")).9
 L ;;w1$ 2 9 9' BCC

  !5!<!<W!EFGr   c                   ,    e Zd ZdZdZdgZd Zd Zd Zy)BuildPackageProtosz>Command to generate project *_pb2.py modules from proto files.zbuild grpc protobuf modules)zstrict-modesz6exit with non-zero value if the proto compiling fails.c                     d| _         y )NF)r'   selfs    r   initialize_optionsz%BuildPackageProtos.initialize_optionsS   s
     r   c                      y )N r5   s    r   finalize_optionsz#BuildPackageProtos.finalize_optionsV   s    r   c                 ^    t        | j                  j                  d   | j                         y )N )r0   distributionpackage_dirr'   r5   s    r   runzBuildPackageProtos.runY   s(    
 	))"-t/?/?	
r   N)	__name__
__module____qualname____doc__descriptionuser_optionsr7   r:   r?   r9   r   r   r2   r2   G   s%    H/K	
L!
r   r2   )F)r   r   r   r   
setuptoolsr   	importlibr   r   r   r   r0   Commandr2   r9   r   r   <module>rI      s\    
 
  y #03 G8
++ 
r   