ó
¦V]c           @@  sT   d  d l  m Z d  d l Z d  d l Z d d l m Z d Z d „  Z d „  Z d S(   i    (   t   absolute_importNi   (   t   Optionsse  Cython (http://cython.org) is a compiler for code written in the
Cython language.  Cython is based on Pyrex by Greg Ewing.

Usage: cython [options] sourcefile.{pyx,py} ...

Options:
  -V, --version                  Display version number of cython compiler
  -l, --create-listing           Write error messages to a listing file
  -I, --include-dir <directory>  Search for include files in named directory
                                 (multiple include directories are allowed).
  -o, --output-file <filename>   Specify name of generated C file
  -t, --timestamps               Only compile newer source files
  -f, --force                    Compile all source files (overrides implied -t)
  -v, --verbose                  Be verbose, print file names on multiple compilation
  -p, --embed-positions          If specified, the positions in Cython files of each
                                 function definition is embedded in its docstring.
  --cleanup <level>              Release interned objects on python exit, for memory debugging.
                                 Level indicates aggressiveness, default 0 releases nothing.
  -w, --working <directory>      Sets the working directory for Cython (the directory modules
                                 are searched from)
  --gdb                          Output debug information for cygdb
  --gdb-outdir <directory>       Specify gdb debug information output directory. Implies --gdb.

  -D, --no-docstrings            Strip docstrings from the compiled module.
  -a, --annotate                 Produce a colorized HTML version of the source.
  --annotate-coverage <cov.xml>  Annotate and include coverage information from cov.xml.
  --line-directives              Produce #line directives pointing to the .pyx source
  --cplus                        Output a C++ rather than C file.
  --embed[=<method_name>]        Generate a main() function that embeds the Python interpreter.
  -2                             Compile based on Python-2 syntax and code semantics.
  -3                             Compile based on Python-3 syntax and code semantics.
  --3str                         Compile based on Python-3 syntax and code semantics without
                                 assuming unicode by default for string literals under Python 2.
  --lenient                      Change some compile time errors to runtime errors to
                                 improve Python compatibility
  --capi-reexport-cincludes      Add cincluded headers to any auto-generated header files.
  --fast-fail                    Abort the compilation on the first error
  --warning-errors, -Werror      Make all warnings into errors
  --warning-extra, -Wextra       Enable extra warnings
  -X, --directive <name>=<value>[,<name=value,...] Overrides a compiler directive
  -E, --compile-time-env name=value[,<name=value,...] Provides compile time env like DEF would do.
c           C@  s!   t  j j t ƒ t  j d ƒ d  S(   Ni   (   t   syst   stderrt   writet   usaget   exit(    (    (    s6   lib/python2.7/site-packages/Cython/Compiler/CmdLine.pyt	   bad_usage>   s    c         @  sð  d d l  m } m } g  ‰ ‡  ‡ f d †  ‰ d  ‡  ‡ f d † } ‡ f d †  } | | ƒ } g  } xÓˆ  r9ˆ  d j d ƒ r&ˆ ƒ  } | dK k r¡ d | _ q6| dL k r¹ d | _ q6| dM k rÑ d | _ q6| d k rï | d ƒ t _	 q6| j d ƒ r| j
 j | | ƒ ƒ q6| d k r9| j
 j | ƒ  ƒ q6| dN k rT| ƒ  | _ q6| dO k ro| ƒ  | _ q6| dP k r‡d | _ q6| dQ k rŸd | _ q6| dR k r½| j d 7_ q6| dS k rÕd t _ q6| dT k rð| ƒ  t _ q6| d  k rt | ƒ  ƒ t _ q6| dU k r)t t _ q6| dV k rAt t _ q6| d% k ret t _ | ƒ  t _ q6| d& k r}t t _ q6| d' k r•t | _ q6| d( k r­t | _ q6| d) k rÑt | _ t j | _ q6| d* k rõt | _ | ƒ  | _ q6| d+ k rt t _  t t _! q6| d, k r.d- | _" q6| d. k rFd/ | _" q6| d0 k r^d1 | _" q6| d2 k rvt | _# q6| d3 k rŽt t _$ q6| d4 k r¦t t _% q6| dW k r¾t t _& q6| dX k rà| j' j( t j) ƒ q6| d9 k røt t _* q6| d: k s| j d; ƒ r®| j d; ƒ r?| d- j+ ƒ  r?| d- } n	 | ƒ  } y% t j, | d< t d= | j' ƒ| _' Wq#t- k
 rª}	 t. j/ j0 d> |	 j1 d ƒ t. j2 d ƒ q#Xq6| d? k sÉ| j d@ ƒ r^| j d@ ƒ rõ| d- j+ ƒ  rõ| d- } n	 | ƒ  } y t j3 | d= | j4 ƒ| _4 Wq#t- k
 rZ}	 t. j/ j0 dA |	 j1 d ƒ t. j2 d ƒ q#Xq6| j dB ƒ rÖ| d- j5 d dC ƒ } d dD l6 m7 }
 | t8 |
 ƒ k r¸t9 |
 | t ƒ q#t. j/ j0 dE | ƒ t: ƒ  q6| dY k rt. j; j0 t< ƒ t. j2 d ƒ q6t. j/ j0 dH | ƒ t. j2 d ƒ qg | j ˆ ƒ  ƒ qg Wˆ rJt: ƒ  n  | j r…t= | ƒ d k r…t. j/ j0 dI ƒ t. j2 d ƒ n  t= | ƒ d k r«| j r«t: ƒ  n  t j	 ræt= | ƒ d k ræt. j/ j0 dJ ƒ t. j2 d ƒ n  | | f S(Z   Ni   (   t   CompilationOptionst   default_optionsc          @  sy   ˆ  s ˆ r t  ƒ  n  d ˆ  d k rl ˆ  d j d ƒ rl ˆ  j d ƒ j d d ƒ \ }  } ˆ j | ƒ |  Sˆ  j d ƒ S(   Nt   =i    s   --i   (   R   t
   startswitht   popt   splitt   append(   t   namet   value(   t   argst   pending_arg(    s6   lib/python2.7/site-packages/Cython/Compiler/CmdLine.pyt   pop_argH   s    
#!c         @  s=   ˆ r ˆ j  ƒ  S|  d  k	 r  |  Sˆ  s0 t ƒ  n  ˆ  j  d ƒ S(   Ni    (   R   t   NoneR   (   t   default(   R   R   (    s6   lib/python2.7/site-packages/Cython/Compiler/CmdLine.pyt	   pop_valueQ   s    

c         @  s   |  d } | r | Sˆ  ƒ  Sd  S(   Ni   (    (   t   optiont   tail(   R   (    s6   lib/python2.7/site-packages/Cython/Compiler/CmdLine.pyt	   get_paramZ   s    
i    t   -s   -Vs	   --versions   -ls   --create-listings   -+s   --cpluss   --embedt   mains   -Is   --include-dirs   -ws	   --workings   -os   --output-files   -ts   --timestampss   -fs   --forces   -vs	   --verboses   -ps   --embed-positionss   -zs   --pre-imports	   --cleanups   -Ds   --no-docstringss   -as
   --annotates   --annotate-coverages   --convert-ranges   --line-directivess   --no-c-in-tracebacks   --gdbs   --gdb-outdirs	   --lenients   -2i   s   -3i   s   --3strt   3strs   --capi-reexport-cincludess   --fast-fails   --cimport-from-pyxs   -Werrors   --warning-errorss   -Wextras   --warning-extras   --old-style-globalss   --directives   -Xt   relaxed_boolt   current_settingss    Error in compiler directive: %s
s   --compile-time-envs   -Es   Error in compile-time-env: %s
s   --debugt   _(   t
   DebugFlagss   Unknown debug flag: %s
s   -hs   --helps   Unknown compiler flag: %s
s3   cython: Only one source file allowed when using -o
s7   cython: Only one source file allowed when using -embed
(   s   -Vs	   --version(   s   -ls   --create-listing(   s   -+s   --cplus(   s   -ws	   --working(   s   -os   --output-file(   s   -ts   --timestamps(   s   -fs   --force(   s   -vs	   --verbose(   s   -ps   --embed-positions(   s   -zs   --pre-import(   s   -Ds   --no-docstrings(   s   -as
   --annotate(   s   -Werrors   --warning-errors(   s   -Wextras   --warning-extra(   s   -hs   --help(>   t   MainR   R	   R   R   t   show_versiont   use_listing_filet   cplusR   t   embedt   include_pathR   t   working_patht   output_filet
   timestampst   verboset   embed_pos_in_docstringt
   pre_importt   intt   generate_cleanup_codet   Falset
   docstringst   Truet   annotatet   annotate_coverage_xmlt   convert_ranget   emit_linenumst   c_line_in_tracebackt	   gdb_debugt   ost   curdirt
   output_dirt   error_on_unknown_namest   error_on_uninitializedt   language_levelt   capi_reexport_cincludest	   fast_failt   cimport_from_pyxt   warning_errorst   compiler_directivest   updatet   extra_warningst   old_style_globalst   stript   parse_directive_listt
   ValueErrorR   R   R   R   R   t   parse_compile_time_envt   compile_time_envt   replacet    R    t   dirt   setattrR   t   stdoutR   t   len(   R   R   R	   R   R   t   optionst   sourcesR   t   x_argst   eR    (    (   R   R   R   s6   lib/python2.7/site-packages/Cython/Compiler/CmdLine.pyt   parse_command_lineC   sú    										

	
	(	   t
   __future__R    R8   R   RL   R   R   R   RU   (    (    (    s6   lib/python2.7/site-packages/Cython/Compiler/CmdLine.pyt   <module>   s   ,		