
    ڏDj"5                         d dl Z d dlmZmZmZmZ ddlmZ  G d de      Z G d de      Z	 G d	 d
e      Z
 G d de      Z G d de      Z G d de      Z G d de      Z G d de      Zd Zd Zd Zd Zy)    N)ArgumentParserActionSUPPRESSRawDescriptionHelpFormatter   )Optionsc                       e Zd ZddZy)ParseDirectivesActionNc                     t        t        || j                  t        j                                     }t        j
                  |d|      }t        || j                  |       y )NT)relaxed_boolcurrent_settings)dictgetattrdestr   get_directive_defaultsparse_directive_listsetattr)selfparser	namespacevaluesoption_stringold_directives
directivess          [C:\Crop_Prediction\Backend\crop-ai-system\venv\Lib\site-packages\Cython/Compiler/CmdLine.py__call__zParseDirectivesAction.__call__   sQ    gi&-&D&D&FH I11H
	499j1    N__name__
__module____qualname__r    r   r   r
   r
      s    2r   r
   c                       e Zd ZddZy)ParseOptionsActionNc                    t        t        || j                  i             }|j                  d      D ]7  }d|v r(|j                  dd      \  }}|j	                         dv}n|d}}|||<   9 t        || j                  |       y )N,=r   )falsef0noT)r   r   r   splitlowerr   )	r   r   r   r   r   optionsoptnvs	            r   r   zParseOptionsAction.__call__   s    wy$))R89<<$ 	Cczyya(1GGI%>>D1GAJ	 		499g.r   r   r   r#   r   r   r%   r%      s    	/r   r%   c                       e Zd ZddZy)ParseCompileTimeEnvActionNc                     t        t        || j                  i             }t        j                  ||      }t        || j                  |       y )N)r   )r   r   r   r   parse_compile_time_envr   )r   r   r   r   r   old_envnew_envs          r   r   z"ParseCompileTimeEnvAction.__call__"   s;    wy$))R8900'R	499g.r   r   r   r#   r   r   r4   r4   !   s    /r   r4   c                       e Zd ZddZy)ActivateAllWarningsActionNc                 j    t        |di       }|j                  t        j                         ||_        y )Ncompiler_directives)r   updater   extra_warningsr<   )r   r   r   r   r   r   s         r   r   z"ActivateAllWarningsAction.__call__)   s-    Y(=rB
'001(2	%r   r   r   r#   r   r   r:   r:   (   s    3r   r:   c                       e Zd ZddZy)SetLenientActionNc                      d|_         d|_        y )NF)error_on_unknown_nameserror_on_uninitializedr   r   r   r   r   s        r   r   zSetLenientAction.__call__0   s    +0	(+0	(r   r   r   r#   r   r   r@   r@   /       1r   r@   c                       e Zd ZddZy)SetGDBDebugActionNc                 <    d|_         t        j                  |_        y NT)	gdb_debugoscurdir
output_dirrD   s        r   r   zSetGDBDebugAction.__call__6   s    "	!yy	r   r   r   r#   r   r   rG   rG   5   s    )r   rG   c                       e Zd ZddZy)SetGDBDebugOutputActionNc                      d|_         ||_        y rI   )rJ   rM   rD   s        r   r   z SetGDBDebugOutputAction.__call__<   s    "	%	r   r   r   r#   r   r   rO   rO   ;   s    &r   rO   c                       e Zd ZddZy)SetAnnotateCoverageActionNc                      d|_         ||_        y rI   )annotateannotate_coverage_xmlrD   s        r   r   z"SetAnnotateCoverageAction.__call__B   s    !	*0	'r   r   r   r#   r   r   rR   rR   A   rE   r   rR   c            	         d} t        | t        t        d      }|j                  dddddd	
       |j                  dddddd
       |j                  ddddd       |j                  ddddt        d       |j                  dddddd
       |j                  dd ddd!d"
       |j                  d#d$d%d&d'       |j                  d(d)d*ddd+
       |j                  d,d-dt
        d.       |j                  d/d0d1d2       |j                  d3d4d5dt        d6       |j                  d7t        d!d89       |j                  d:t        t        d;<       |j                  d=d>d?d@dA       |j                  dBdCddDdEdFG       |j                  dHddIdEdJG       |j                  dKdLt        t        dM       |j                  dNdOd1dP       |j                  dQdRdSdddT
       |j                  dUddVdWX       |j                  dYdt        dZ<       |j                  d[d\dd]d^
       |j                  d_d\dd`da
       |j                  dbd\ddcdd
       |j                  det        d!df9       |j                  dgdhd1di       |j                  djdkd1dl       |j                  dmdndod1dp       |j                  dqdrt        d!ds9       |j                  dtdudvdwt        t        dxy       |j                  dzd{dvd|t        t        d}y       |j                  d~dt        dd       |j                  ddd1d       |j                  dddt        d       |j                  dddt        d       |j                  ddg        |j                  ddddt        t               |j                  ddd1t               |j                  ddd@t               |j                  ddd1t               |j                  ddd1t               ddlm} t!        |      D ]A  }|j#                  d      s|j%                  dd      }|j                  d|z   d1t               C |S )Nz|Cython (https://cython.org/) is a compiler for code written in the Cython language.  Cython is based on Pyrex by Greg Ewing.zYEnvironment variables:
  CYTHON_CACHE_DIR: the base directory containing Cython's caches.)descriptionargument_defaultformatter_classepilogz-Vz	--versionshow_versionstore_constr   z)Display version number of cython compiler)r   actionconsthelpz-lz--create-listinguse_listing_filez&Write error messages to a listing filez-Iz--include-dirinclude_pathappendzWSearch for include files in named directory (multiple include directories are allowed).)r   r]   r_   z-oz--output-fileoutput_filestorez Specify name of generated C file)r   r]   typer_   z-tz--timestamps
timestampszOnly compile newer source filesz-fz--forcer   z/Compile all source files (overrides implied -t)z-vz	--verboseverbosecountz4Be verbose, print file names on multiple compilationz-pz--embed-positionsembed_pos_in_docstringzeIf specified, the positions in Cython files of each function definition is embedded in its docstring.z	--cleanupgenerate_cleanup_codezzRelease interned objects on python exit, for memory debugging. Level indicates aggressiveness, default 0 releases nothing.z--cachecache
store_truez!Enables Cython compilation cache.z-wz	--workingworking_pathzOSets the working directory for Cython (the directory modules are searched from)z--gdbz"Output debug information for cygdb)r]   nargsr_   z--gdb-outdirz>Specify gdb debug information output directory. Implies --gdb.)r]   re   r_   z-Dz--no-docstrings
docstringsstore_falsez*Strip docstrings from the compiled module.z-az
--annotatedefaultrT   z/Produce a colorized HTML version of the source.)r]   r^   r   r_   z--annotate-fullcfullczZProduce a colorized HTML version of the source which includes entire generated C/C++-code.z--annotate-coveragerU   z7Annotate and include coverage information from cov.xml.z--line-directivesemit_linenumsz4Produce #line directives pointing to the .pyx sourcez-+z--cpluscplusz Output a C++ rather than C file.--embedmainzwGenerate a main() function that embeds the Python interpreter. Pass --embed=<method_name> for a name other than main().)r]   r^   r_   z--embed-modules z-2language_level   z4Compile based on Python-2 syntax and code semantics.z-3   z4Compile based on Python-3 syntax and code semantics.z--3str3zRCompile based on Python-3 syntax and code semantics (same as -3 since Cython 3.1).z	--lenientzQChange some compile time errors to runtime errors to improve Python compatibilityz--capi-reexport-cincludescapi_reexport_cincludesz9Add cincluded headers to any auto-generated header files.z--fast-fail	fast_failz(Abort the compilation on the first errorz-Werrorz--warning-errorswarning_errorszMake all warnings into errorsz-Wextraz--warning-extrazEnable extra warningsz-Xz--directivezNAME=VALUE,...r<   zOverrides a compiler directive)metavarr   re   r]   r_   z-Ez--compile-time-envcompile_time_envz,Provides compile time env like DEF would do.z--module-namemodule_namezFully qualified module name. If not given, is deduced from the import path if source file is in a package, or equals the filename otherwise.)r   re   r]   r_   z-Mz	--depfilez produce depfiles for the sources)r]   r_   z--generate-sharedshared_c_file_pathz,Generates shared module with specified name.z--sharedshared_utility_qualified_namezQImports utility code from shared module specified by fully qualified module name.sources*)rn   rq   z-zz--pre-import
pre_importz--convert-rangeconvert_rangez--no-c-in-tracebackc_line_in_tracebackz--cimport-from-pyxcimport_from_pyxz--old-style-globalsold_style_globals
DebugFlagsdebug_-z--)r   r   r   add_argumentstrintrG   rO   rR   
comma_listr@   r:   r
   r4   rw   r   vars
startswithreplace)rW   r   r   nameoption_names        r   create_cython_argparserr   F   s   NK !3F	F k}\]F  H
07IR_ghC  E
oN8I  J oM'X[=  ?
n<]^<  >
il=XYL  N
k	'Q  S
18PYfnoO  P *A'X[Y  Z 	>  @
kwUXl  n
(9?  A
/FS[  ]
/l=G  I
l=	XbL  N
*=V`I  J -4KTmtwT  V
+/,Q  S
igmST=  ?
	-vV  W )'
  
#3MQRQ  S
#3MQRQ  S
'7UXo  q
,<A:  ; 3:S\hV  X
KE  G
	#5<LUa:  <
	#4=V^_2  4 m5E0s2;  = 2<L-C6I  K (s7J  K
 k,Egh
+2Fw]`K  M

)HQX_bp  r 	b9 n<VY`hi
)[cd
-4IR_fno
,3Elaij
-4GP\ckl Z  X??7#,,sC0K{ 2<hWX
 Mr   c                 $    | j                  d      S )Nr'   )r-   )strings    r   r   r      s    <<r   c                 :   d } ||      \  }}| j                  |      \  }}|j                  }|`|D ]9  }|j                  d      r| j                  d|z          )|j	                  |       ; |D ]%  }	|	dk(  rd}
n|	t        d      d  }
t        |d|
       ' ||fS )Nc                     g g }}| D ];  }|dk(  s|j                  d      r|j                  |       +|j                  |       = ||fS )Nru   --embed=)r   rb   )args
with_embedwithout_embedxs       r   filter_out_embed_optionsz8parse_command_line_raw.<locals>.filter_out_embed_options   sU    $&M
 	(AI~j!9!!!$$$Q'		(
 =((r   r   zunknown option ru   rv   r   embed)parse_known_argsr   r   errorrb   lenr   )r   r   r   r   args_without_embed	argumentsunknownr   optionr   r   s              r   parse_command_line_rawr      s    ) &>d%C"J"001CDIwG  #S!LL*V34NN6"	#  *	>DS_%&D	7D)* gr   c                    t               }t        ||       \  }}t        |dd      }|D ]  }|r?t        j                  j                  |      s t        j                  j                  ||      }t        j                  j                  |      rddd l}t        |j                  t        j                  |j                        |       t        j                  t        j                        }t        |      j!                         D ]{  \  }}	|j#                  d      r6ddlm}
 |t)        |
      v rt+        |
||	       8|j-                  d|z         Mt/        t        |      rt+        t        ||	       ot+        |||	       } |j0                  rt3        |      dkD  r|j-                  d       |j4                  r t3        |      dkD  r=|j-                  d	       n+t3        |      dk(  r|j6                  s|j-                  d
       t        j8                  rt3        |      dkD  r|j-                  d       |j:                  r<|j<                  r|j-                  d       t3        |      dkD  r|j-                  d       ||fS )Nrm   rw   r   r   r   r   zUnknown debug flag: %s
z3cython: Only one source file allowed when using -o
z=cython: Source file not allowed when using --generate-shared
z&cython: Need at least one source file
z8cython: Only one source file allowed when using --embed
z3cython: Cannot use --module-name with --timestamps
z>cython: Only one source file allowed when using --module-name
)r   r   r   rK   pathisabsjoinexistserrnoFileNotFoundErrorENOENTstrerrorr   CompilationOptionsdefault_optionsr   itemsr   rw   r   dirr   r   hasattrr`   r   r   r[   r   r   rf   )r   r   r   r   work_dirsourcer   r/   r   valuer   s              r   parse_command_liner      s   $&F/=Iwy."5H UBGGMM&1WW\\(F3Fww~~f%#ELL"++ell2KVTTU (()@)@AGI,,. 
*e??7#$s:&
D%07$>?Wd#GT5)GT5)
* CL1$4KL!!w<!LLYZ	W	7#7#7>?}}W)PQLLOPw<!LLZ[Gr   )rK   argparser   r   r   r   rw   r   r
   r%   r4   r:   r@   rG   rO   rR   r   r   r   r   r#   r   r   <module>r      s    
 R R 2F 2
/ 
// /3 31v 1) )&f &1 1
qf!H'r   