ó
öÀ„\c           @@ sO  d  Z  d d l m Z d d l m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l	 Z	 d d l
 m Z d d l m Z d d l m Z yQ d d l Z e j  rÛ d e j  k rÛ e j d	 ƒ e Z n e j d
 ƒ e Z Wn e k
 re Z n Xd d l m Z d d l m Z m Z m Z m Z d d l m Z d d l m Z  d d l! Z" d d l" m# Z# m$ Z$ d d l! m% Z% d d l& m' Z' d d l( m) Z) m* Z* m+ Z+ m, Z, m- Z- m. Z. d d l/ m0 Z0 m1 Z1 d d l2 m3 Z3 e r(d d l4 m5 Z5 m6 Z6 m7 Z7 m8 Z8 m9 Z9 m: Z: n  e; e j< d d ƒ Z> e d e% d ƒ f d e% d ƒ f d e% d ƒ f d e% d ƒ f d e% d  ƒ f d! e% d" ƒ f d# e% d$ ƒ f d% e% d& ƒ f d' e% d( ƒ f d) e% d* ƒ f g
 ƒ Z? i d+ d, 6e d- 6d. d/ 6d d0 6d1 d2 6d3 d4 6e d5 6e d6 6Z@ d7 ZA e jB d8 k r;d9 ZC n d: ZC d; „  ZD d< eE f d= „  ƒ  YZF d> „  ZG d? „  ZH d@ „  ZI dA „  ZJ dB „  ZK dC „  ZL dD „  ZM dE „  ZN d eI dF „ ZO e jP dG ƒ dH „ ZQ dI e3 f dJ „  ƒ  YZR dK „  ZS e e d dL „ ZT dM „  ZU dN „  ZV e jW dO dP „ ZX eY dQ k rKe jZ eX e jW dO ƒ ƒ n  d S(R   sä   
    sphinx.cmd.quickstart
    ~~~~~~~~~~~~~~~~~~~~~

    Quickly setup documentation source to work with Sphinx.

    :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
i    (   t   absolute_import(   t   print_functionN(   t   OrderedDict(   t   open(   t   patht   libedits   bind ^I rl_completes   tab: complete(   t   column_width(   t   PY2t   PY3t	   text_typet   binary_type(   t   input(   t   quote(   t   __display_version__t   package_dir(   t   __(   t	   texescape(   t   colorizet   boldt   redt	   turquoiset   nocolort   color_terminal(   t	   ensuredirt   make_filename(   t   SphinxRenderer(   t   Anyt   Callablet   Dictt   Listt   Patternt   Uniont   encodingt   autodocs,   automatically insert docstrings from modulest   doctests2   automatically test code snippets in doctest blockst   intersphinxs7   link between Sphinx documentation of different projectst   todos9   write "todo" entries that can be shown or hidden on buildt   coverages!   checks for documentation coveraget   imgmaths+   include math, rendered as PNG or SVG imagest   mathjaxs0   include math, rendered in the browser by MathJaxt   ifconfigs7   conditional inclusion of content based on config valuest   viewcodes=   include links to the source code of documented Python objectst   githubpagess=   create .nojekyll file to publish the document on GitHub pagest   .R   t   sept   _t   dott   languages   .rstt   suffixt   indext   mastert   makefilet	   batchfiles   > t   win32R   t   purplec         C@ s7   t  j d k r) t |  d d ƒt d ƒ St |  ƒ Sd  S(   NR5   t   endt    (   t   syst   platformt   printR   (   t   prompt(    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt
   term_input]   s    
t   ValidationErrorc           B@ s   e  Z d  Z RS(   s   Raised for validation errors.(   t   __name__t
   __module__t   __doc__(    (    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyR>   i   s   c         C@ sG   t  j |  ƒ }  t  j |  ƒ rC t  j |  ƒ rC t t d ƒ ƒ ‚ n  |  S(   Ns   Please enter a valid path name.(   R   t
   expandusert   existst   isdirR>   R   (   t   x(    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt   is_pathm   s    c         C@ s   |  S(   N(    (   RE   (    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt   allow_emptyu   s    c         C@ s   |  s t  t d ƒ ƒ ‚ n  |  S(   Ns   Please enter some text.(   R>   R   (   RE   (    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt   nonemptyz   s    c          @ s   ‡  f d †  } | S(   Nc         @ s2   |  ˆ  k r. t  t d ƒ d j ˆ  ƒ ƒ ‚ n  |  S(   Ns   Please enter one of %s.s   , (   R>   R   t   join(   RE   (   t   l(    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt   valƒ   s    "(    (   RJ   RK   (    (   RJ   s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt   choice   s    c         C@ s7   |  j  ƒ  d k r' t t d ƒ ƒ ‚ n  |  j  ƒ  d k S(   Nt   Yt   YESt   Nt   NOs   Please enter either 'y' or 'n'.(   RM   RN   RO   RP   (   RM   RN   (   t   upperR>   R   (   RE   (    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt   boolean‹   s    c         C@ s>   |  d d !d k o" t  |  ƒ d k s: t t d ƒ ƒ ‚ n  |  S(   Ni    i   R+   s2   Please enter a file suffix, e.g. '.rst' or '.txt'.(   t   lenR>   R   (   RE   (    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyR0   ’   s    %c         C@ s   |  S(   N(    (   RE   (    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt   okš   s    c         C@ s    t  |  t ƒ r |  St r& |  j t ƒ S|  j d d ƒ j d d ƒ |  k rW |  j d ƒ St t t d ƒ ƒ ƒ y |  j d ƒ SWn t k
 r› |  j d ƒ SXd  S(   Nt   asciit   replaces`   * Note: non-ASCII characters entered and terminal encoding unknown -- assuming UTF-8 or Latin-1.s   utf-8t   latin1(	   t
   isinstanceR	   t   TERM_ENCODINGt   decodet   encodeR;   R   R   t   UnicodeDecodeError(   t   text(    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt   term_decodeŸ   s    $c         C@ sl  xet  rg| d  k	 r, t d |  | f } n t |  d } t rÎ | j d d ƒ j d d ƒ | k rÎ t r| | j t ƒ } qË t t t	 d ƒ ƒ ƒ y | j d ƒ } WqË t
 k
 rÇ | j d ƒ } qË XqÎ n  t r× n t t | d t  ƒ} t | ƒ j ƒ  } | r| r| } n  t | ƒ } y | | ƒ } Wn0 t k
 rb} t t d	 t | ƒ ƒ ƒ q n XPq W| S(
   Ns	   %s [%s]: s   : RU   RV   sd   * Note: non-ASCII default value provided and terminal encoding unknown -- assuming UTF-8 or Latin-1.s   utf-8RW   t
   input_modes   * (   t   Truet   Nonet   PROMPT_PREFIXR   R[   RZ   RY   R;   R   R   t   UnicodeEncodeErrort   USE_LIBEDITR   t   COLOR_QUESTIONR=   t   stripR^   R>   R   t   str(   R]   t   defaultt	   validatorR<   RE   t   err(    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt	   do_promptµ   s8    			s   [uU]('.*?')c         C@ s   t  r | j d |  ƒ S|  Sd  S(   Ns   \1(   R   t   sub(   t   sourcet   rex(    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt   convert_python_sourceÞ   s    t   QuickstartRendererc           B@ s   e  Z d  „  Z d „  Z RS(   c         C@ s&   | p	 d |  _  t t |  ƒ j ƒ  d  S(   NR8   (   t   templatedirt   superRp   t   __init__(   t   selfRq   (    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyRs   è   s    c         C@ sc   t  j |  j t  j | ƒ ƒ } |  j rF t  j | ƒ rF |  j | | ƒ St t |  ƒ j | | ƒ Sd  S(   N(	   R   RI   Rq   t   basenameRC   t   render_from_fileRr   Rp   t   render(   Rt   t   template_namet   contextt   user_template(    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyRw   í   s    (   R?   R@   Rs   Rw   (    (    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyRp   ç   s   	c         C@ s&  t  t t d ƒ ƒ t ƒ t  t d ƒ ƒ d |  k rW t  t t d ƒ |  d ƒ ƒ n, t  t d ƒ ƒ t t d ƒ d t ƒ |  d <x¯ t j t j |  d d ƒ ƒ sÇ t j t j |  d d	 d ƒ ƒ r4t  ƒ  t  t t d
 ƒ ƒ ƒ t  t d ƒ ƒ t  ƒ  t t d ƒ d t ƒ |  d <|  d s† t	 j
 d ƒ q† q† Wd |  k rpt  t d ƒ ƒ t t d ƒ d t ƒ |  d <n  d |  k r«t  t d ƒ ƒ t t d ƒ d t ƒ |  d <n  d |  k ràt  t d ƒ ƒ t t d ƒ ƒ |  d <n  d |  k rt t d ƒ ƒ |  d <n  d |  k r@t  t d ƒ ƒ t t d ƒ d t ƒ |  d <n  d |  k rot t d  ƒ |  d t ƒ |  d <n  d! |  k rÄt  t d" ƒ ƒ t t d# ƒ d$ ƒ |  d! <|  d! d$ k rÄd= |  d! <qÄn  d% |  k rÿt  t d& ƒ ƒ t t d' ƒ d( t ƒ |  d% <n  d) |  k r7t  t d* ƒ ƒ t t d+ ƒ d, ƒ |  d) <n  x¾ t j t j |  d |  d) |  d% ƒ ƒ s“t j t j |  d d	 |  d) |  d% ƒ ƒ r÷t  ƒ  t  t t d- ƒ |  d) |  d% ƒ ƒ t  t d. ƒ ƒ t  ƒ  t t d/ ƒ |  d) ƒ |  d) <q:Wd0 |  k rµt  t d1 ƒ ƒ g  |  d0 <xN t j ƒ  D]@ \ } } t d2 | | f d t ƒ r+|  d0 j d3 | ƒ q+q+Wt d4 d5 g ƒ j |  d0 ƒ rµt  t d6 ƒ ƒ |  d0 j d4 ƒ qµn  d7 |  k rðt  t d8 ƒ ƒ t t d9 ƒ d: t ƒ |  d7 <n  d; |  k rt t d< ƒ d: t ƒ |  d; <n  t  ƒ  d= S(>   s4  Ask the user for quickstart values missing from *d*.

    Values are:

    * path:      root path
    * sep:       separate source and build dirs (bool)
    * dot:       replacement for dot in _templates etc.
    * project:   project name
    * author:    author names
    * version:   version of project
    * release:   release of project
    * language:  document language
    * suffix:    source file suffix
    * master:    master document name
    * extensions:  extensions to use (list)
    * makefile:  make Makefile
    * batchfile: make command file
    s,   Welcome to the Sphinx %s quickstart utility.sz   
Please enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).R   s   
Selected root path: %ss'   
Enter the root path for documentation.s   Root path for the documentationR+   s   conf.pyRm   sD   Error: an existing conf.py has been found in the selected root path.s>   sphinx-quickstart will not overwrite existing Sphinx projects.s4   Please enter a new root path (or just Enter to exit)R8   i   R,   sÊ   
You have two options for placing the build directory for Sphinx output.
Either, you use a directory "_build" within the root path, or you separate
"source" and "build" directories within the root path.s+   Separate source and build directories (y/n)t   nR.   së   
Inside the root directory, two more directories will be created; "_templates"
for custom HTML templates and "_static" for custom stylesheets and other static
files. You can enter another prefix (such as ".") to replace the underscore.s(   Name prefix for templates and static dirR-   t   projectsJ   
The project name will occur in several places in the built documentation.s   Project namet   authors   Author name(s)t   versions/  
Sphinx has the notion of a "version" and a "release" for the
software. Each version can have multiple releases. For example, for
Python the version is something like 2.5 or 3.0, while the release is
something like 2.5.1 or 3.0a1.  If you don't need this dual structure,
just set both to the same value.s   Project versiont   releases   Project releaseR/   s  
If the documents are to be written in a language other than English,
you can select a language here by its language code. Sphinx will then
translate text that it generates into that language.

For a list of supported codes, see
http://sphinx-doc.org/config.html#confval-language.s   Project languaget   enR0   s‰   
The file name suffix for source files. Commonly, this is either ".txt"
or ".rst".  Only files with this suffix are considered documents.s   Source file suffixs   .rstR2   s  
One document is special in that it is considered the top node of the
"contents tree", that is, it is the root of the hierarchical structure
of the documents. Normally, this is "index", but if your "index"
document is a custom template, you can also set this to another filename.s-   Name of your master document (without suffix)R1   sK   Error: the master file %s has already been found in the selected root path.s7   sphinx-quickstart will not overwrite the existing file.sI   Please enter a new file name, or rename the existing file and press Entert
   extensionssD   Indicate which of the following Sphinx extensions should be enabled:s   %s: %s (y/n)s   sphinx.ext.%ss   sphinx.ext.imgmaths   sphinx.ext.mathjaxsZ   Note: imgmath and mathjax cannot be enabled at the same time. imgmath has been deselected.R3   s˜   
A Makefile and a Windows command file can be generated for you so that you
only have to run e.g. `make html' instead of invoking sphinx-build
directly.s   Create Makefile? (y/n)t   yR4   s"   Create Windows command file? (y/n)N(   R;   R   R   R   Rk   RF   R   t   isfileRI   R9   t   exitRR   RT   RG   Ra   R0   t
   EXTENSIONSt   itemst   appendt   sett   issubsett   remove(   t   dt   namet   description(    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt   ask_userö   s¤    
	
""




#


..

c      	   @ s+  t  d | ƒ } t j ƒ  d ˆ  k r2 d ˆ  d <n  d ˆ  k rK d ˆ  d <n  t ˆ  d <t ˆ  d ƒ ˆ  d <t ˆ  d j d	 ƒ ƒ ˆ  d
 <ˆ  d j ƒ  ˆ  d <t j	 ƒ  ˆ  d <t
 ˆ  d ƒ d ˆ  d <ˆ  j d g  ƒ t j d ƒ d ˆ  d ˆ  d <t ˆ  d ƒ j t j ƒ ˆ  d <ˆ  d d ˆ  d <t ˆ  d d ƒ j t j ƒ ˆ  d <x8 dD D]0 } ˆ  | j d d ƒ j d d ƒ ˆ  | d <qNWt j ˆ  d  ƒ s¦t ˆ  d  ƒ n  ˆ  d! rÆt j ˆ  d  d" ƒ pÍˆ  d  } t | ƒ ˆ  d! rt j ˆ  d  d# ƒ } d ˆ  d$ <nM t j | ˆ  d% d# ƒ } t t ˆ  d% d# d& d' g ƒ } d j | ƒ ˆ  d$ <t | ƒ t t j | ˆ  d% d( ƒ ƒ t t j | ˆ  d% d) ƒ ƒ d- ‡  ‡ f d* † }	 | rÊt j j | d+ ƒ n d- }
 |
 sçt j |
 ƒ rt j j t d( d, d+ ƒ }
 n  t |
 ƒ  } t | j ƒ  ƒ } Wd- QX|	 t j | d. ƒ | j | ˆ  ƒ ƒ t j | ˆ  d ˆ  d/ ƒ } |	 | | j d0 ˆ  ƒ ƒ ˆ  j  d1 ƒ t! k r¬d2 } d3 } n d4 } d5 } ˆ  d6 t! k r3ˆ  d! rØd" pÛd7 ˆ  d8 <ˆ  d! ròd# pýˆ  d% d# ˆ  d9 <|	 t j ˆ  d  d: ƒ | j | ˆ  ƒ d; ƒ n  ˆ  d< t! k r®ˆ  d! rSd" pVd7 ˆ  d8 <ˆ  d! rmd# pxˆ  d% d# ˆ  d9 <|	 t j ˆ  d  d= ƒ | j | ˆ  ƒ d> ƒ n  | r¸d- St" ƒ  t" t# t$ d? ƒ ƒ ƒ t" t$ d@ ƒ | ˆ  d6 sùˆ  d< rt$ dA ƒ pt$ dB ƒ | | f t$ dC ƒ ƒ d- S(E   s(   Generate project based on values in *d*.Rq   t   mastertoctreeR8   t   mastertocmaxdepthi   R   R|   t
   project_fnt   idnat   project_urlt   project_manpaget   nowt   =t   project_underlineR   s   %Ys   , R}   t	   copyrightt   author_texescapeds    Documentationt   project_doct   project_doc_texescapedR~   R   R2   s   \s   \\t   's   \'t   _strR   R,   Rm   t   buildt   exclude_patternsR.   s	   Thumbs.dbs	   .DS_Storet	   templatest   staticc         @ s”   ˆ s t  j |  ƒ rm d ˆ  k r9 t t d ƒ |  ƒ n  t |  d d d d | ƒ } | j | ƒ Wd  QXn# d ˆ  k r t t d ƒ |  ƒ n  d  S(   Nt   quiets   Creating file %s.t   wtR    s   utf-8t   newlines!   File %s already exists, skipping.(   R   Rƒ   R;   R   R   t   write(   t   fpatht   contentR¤   t   f(   R‹   t	   overwrite(    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt
   write_file»  s    s	   conf.py_tt
   quickstartNs   conf.pyR0   s   quickstart/master_doc.rst_tt	   make_modes   quickstart/Makefile.new_ts   quickstart/make.bat.new_ts   quickstart/Makefile_ts   quickstart/make.bat_tR3   R+   t   rsrcdirt	   rbuilddirt   Makefileu   
R4   s   make.batu   
s:   Finished: An initial directory structure has been created.sZ   
You should now populate your master file %s and create other documentation
source files. s=   Use the Makefile to build the docs, like so:
   make builder
sZ   Use the sphinx-build command to build the docs, like so:
   sphinx-build -b builder %s %s
sQ   where "builder" is one of the supported builders, e.g. html, latex or linkcheck.
(	   R|   Rš   R›   R}   R™   R˜   R~   R   R2   (%   Rp   R   t   initR   R   t   urlquoteR[   t   lowert   timet   asctimeR   t
   setdefaultt   strftimeR	   t	   translatet   tex_escape_mapRV   R   RD   R   RI   t   mapt   reprRa   t   osRƒ   R   R   Ro   t   readt   render_stringRw   t   getR`   R;   R   R   (   R‹   R©   t   silentRq   t   templatet   keyt   srcdirt   builddirRŸ   Rª   t	   conf_pathR¨   t	   conf_textt
   masterfilet   makefile_templatet   batchfile_template(    (   R‹   R©   s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt   generate†  sŠ    

 
.*


!%	""Dc         C@ sö   |  d } t  j | ƒ s t St  j | ƒ s0 t St d d g ƒ t t j | ƒ ƒ @rY t S|  d r¡ t j  j d | ƒ } t  j | ƒ s‹ t St  j | ƒ s¡ t Sn  d |  d d |  d d	 |  d
 |  d g } t | ƒ t t j | ƒ ƒ @rò t St S(   NR   R¯   s   make.batR,   Rm   s   conf.pyR.   R¡   R    R2   R0   (	   R   RC   R`   RD   t   FalseRˆ   R»   t   listdirRI   (   R‹   t   dirt   reserved_names(    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt	   valid_dirö  s(    
%
c          C@ sA  t  j d d d t d ƒ d t d ƒ ƒ }  |  j d d d	 d
 d d d d  d t d ƒ ƒ|  j d d	 d d d d d t ƒ|  j d d d d d d d d t d ƒ ƒ|  j t d ƒ ƒ } | j d d	 d
 d d  d t d ƒ ƒ| j d d d d t d  ƒ ƒ|  j t d! ƒ ƒ } | j d" d# d d$ d d% d t d& ƒ ƒ| j d' d( d d) d d* d t d+ ƒ ƒ| j d, d d- d d d d. d t d/ ƒ ƒ| j d0 d1 d d2 d d3 d t d4 ƒ ƒ| j d5 d6 d d7 d d8 d t d9 ƒ ƒ| j d: d d; d t d< ƒ ƒ| j d= d d> d t d? ƒ ƒ| j d@ d	 d
 d t d t dA ƒ ƒ|  j t dB ƒ ƒ } xE t D]= } | j dC | d	 dD dE dF | d dG d t dH ƒ | ƒq^W| j dI d dJ d dG d	 dK d t dL ƒ ƒ|  j t dM ƒ ƒ } | j dN d	 d
 d dO d d  d t dP ƒ ƒ| j dQ d	 dR d dO d t dS ƒ ƒ| j dT d	 d
 d dU d d  d t dV ƒ ƒ| j dW d	 dR d dU d t dX ƒ ƒ| j dY dZ d	 d
 d d[ d t	 d t d\ ƒ ƒ| j d] d^ d	 dR d d[ d t d_ ƒ ƒ|  j t d` ƒ ƒ } | j da db d dc d dd d t de ƒ ƒ| j df d dg d	 dK d dh d t di ƒ ƒ|  S(j   Nt   usages    %(prog)s [OPTIONS] <PROJECT_DIR>t   epilogs5   For more information, visit <http://sphinx-doc.org/>.R   sí   
Generate required files for a Sphinx project.

sphinx-quickstart is an interactive tool that asks some questions about your
project and then generates a complete documentation directory and sample
Makefile to be used with sphinx-build.
s   -qs   --quiett   actiont
   store_truet   destR¢   Rh   t   helps
   quiet modes	   --versionR~   t   show_versions   %%(prog)s %sR   t   metavart   PROJECT_DIRR+   t   nargst   ?s   output paths   Structure optionss   --seps,   if specified, separate source and build dirss   --dott   DOTs&   replacement for dot in _templates etc.s   Project basic optionss   -ps	   --projectt   PROJECTR|   s   project names   -as   --authort   AUTHORR}   s   author namess   -vt   VERSIONR8   s   version of projects   -rs	   --releaset   RELEASER   s   release of projects   -ls
   --languaget   LANGUAGER/   s   document languages   --suffixt   SUFFIXs   source file suffixs   --mastert   MASTERs   master document names   --epubs   use epubs   Extension optionss   --ext-%st   append_constt   consts   sphinx.ext.%sR   s   enable %s extensions   --extensionsR…   R‡   s   enable arbitrary extensionss   Makefile and Batchfile creations
   --makefileR3   s   create makefiles   --no-makefilet   store_falses   do not create makefiles   --batchfileR4   s   create batchfiles   --no-batchfiles   do not create batchfiles   -ms   --use-make-modeR¬   s#   use make-mode for Makefile/make.bats   -Ms   --no-use-make-modes*   do not use make-mode for Makefile/make.bats   Project templatings   -ts   --templatedirt   TEMPLATEDIRRq   s%   template directory for template filess   -ds
   NAME=VALUEt	   variabless   define a template variable(
   t   argparset   ArgumentParserR   t   add_argumentRa   R   t   add_argument_groupRÊ   R…   R`   (   t   parsert   groupt   ext(    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt
   get_parser  s‚    	i   c         C@ sæ  t  j j t j d ƒ t  j j t j j t d ƒ d ƒ t	 ƒ  sK t
 ƒ  n  t ƒ  } y | j |  ƒ } Wn t k
 r€ } | j SXt | ƒ } t d „  | j ƒ  Dƒ ƒ } yí d | k rê t d d g ƒ j | ƒ sê t t d ƒ ƒ d	 Sn  t d d d g ƒ j | ƒ r‹| j d
 d ƒ | j d | d
 ƒ t j ƒ  } | j | ƒ | } t | ƒ s•t ƒ  t t t d ƒ ƒ ƒ t t d ƒ ƒ d	 Sn
 t | ƒ Wn) t t f k
 rÁt ƒ  t d ƒ d SXx< | j ƒ  D]. \ } } t | t  ƒ rÏt! | ƒ | | <qÏqÏW| j d g  ƒ xM | d D]@ } d | k r| d j" | ƒ | d j# | j$ d ƒ ƒ qqWxe | j% d g  ƒ D]Q }	 y# |	 j$ d ƒ \ }
 } | | |
 <Wqtt& k
 rÄt t d ƒ |	 ƒ qtXqtWt' | d t( d | j) ƒd S(   NR8   t   localet   sphinxc         s@ s-   |  ]# \ } } | d  k	 r | | f Vq d  S(   N(   Ra   (   t   .0t   kt   v(    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pys	   <genexpr>w  s    R¢   R|   R}   sH   "quiet" is specified, but any of "project" or "author" is not specified.i   R~   R   sH   Error: specified path is not a directory, or sphinx files already exist.sW   sphinx-quickstart only generate into a empty directory. Please specify a new root path.s   [Interrupted.]i‚   R   t   ,Ræ   R–   s   Invalid template variable: %sR©   Rq   i    (*   Rð   Rï   t	   setlocalet   LC_ALLt   init_consoleR»   R   RI   R   R   R   Rî   t
   parse_argst
   SystemExitt   codet   varst   dictR†   Rˆ   R‰   R;   R   Rµ   t   DEFAULTSt   copyt   updateRÎ   R   RŽ   t   KeyboardInterruptt   EOFErrorRX   R
   R^   RŠ   t   extendt   splitR¾   t
   ValueErrorRÉ   RÊ   Rq   (   t   argvRë   t   argsRj   R‹   t   d2RÁ   t   valueRí   t   variableRŒ   (    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt   mainf  sb    "	
	

!t   __main__([   RA   t
   __future__R    R   Rç   Rï   R»   t   reR9   R³   t   collectionsR   t   ioR   R   t   readlinet   parse_and_bindR`   Rd   RÊ   t   ImportErrort   docutils.utilsR   t   sixR   R   R	   R
   t	   six.movesR   t   six.moves.urllib.parseR   R±   t   sphinx.localeRð   R   R   R   t   sphinx.utilR   t   sphinx.util.consoleR   R   R   R   R   R   t   sphinx.util.osutilR   R   t   sphinx.util.templateR   t   typingR   R   R   R   R   R   t   getattrt   stdinRa   RY   R…   Rý   Rb   R:   Re   R=   t	   ExceptionR>   RF   RG   RH   RL   RR   R0   RT   R^   Rk   t   compileRo   Rp   RŽ   RÉ   RÎ   Rî   R  R
  R?   R„   (    (    (    s4   lib/python2.7/site-packages/sphinx/cmd/quickstart.pyt   <module>
   s    	

".1
						
				)		p		RG