
    Dh[
              
           S r SSKJr  SSKr\R                  " SSSS9r\R                  " SS	S
S9rS rS rS r	S r
\R                  " SSSSS\	SS9r\R                  " SSSS\	SS9rg)z$Common commandline options for `fio`    )defaultdictNz	--src-crsz	--src_crszSource CRS.)helpz	--dst-crsz	--dst_crszDestination CRS.c                 L    Ub  UR                  5       (       d  U$ [        U5      $ )zLet --layer be a name or index.)isdigitint)ctxparamvalues      dC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\fiona/fio/options.pycb_layerr      s     }EMMOO5z    c                     [        [        5      nU HA  nUR                  S5       H)  nUR                  S5      u  pgX6   R                  U5        M+     MC     U$ )zn
Transform layer options from strings ("1:a,1:b", "2:a,2:c,2:z") to
{
'1': ['a', 'b'],
'2': ['a', 'c', 'z']
}
,:)r   listsplitappend)r   r	   r
   outrawvdsnames           r   cb_multilayerr      sN     d
C3Awws|HBGNN4     Jr   c                    U(       d  0 $ 0 nU Hp  nSU;  a  [         R                  " SU 35      eUR                  SS5      u  pVUR                  5       nUR                  5       nUR                  5       S;   a  SOUX5'   Mr     U$ )aW  
click callback to validate `--opt KEY1=VAL1 --opt KEY2=VAL2` and collect
in a dictionary like the one below, which is what the CLI function receives.
If no value or `None` is received then an empty dictionary is returned.

    {
        'KEY1': 'VAL1',
        'KEY2': 'VAL2'
    }

Note: `==VAL` breaks this as `str.split('=', 1)` is used.

=z Invalid syntax for KEY=VAL arg:    )nonenullnilnadaN)clickBadParameterr   lower)r   r	   r
   r   pairkr   s          r   
cb_key_valr&   %   s     	D$((6tf=  zz#q)GGIGGI!".M!MST  
r   c                     UR                  5        H`  nU[        S[        U 5      S-   5       Vs/ s H  n[        U5      PM     sn;  d  M;  US-   X   S   -   n[        R
                  " SU S35      e   gs  snf )z>
Ensure file indexes provided in the --layer option are valid
r   r   r   zLayer z does not existN)keysrangelenstrr!   r"   )files	layerdictkeyr%   layers        r   validate_multilayer_file_indexr0   D   ss     ~~uQE
Q'?@'?!s1v'?@@#I	q 11E$$veWO%DEE  @s   A6z--coz	--profilecreation_optionsz
NAME=VALUETzlDriver specific creation options. See the documentation for the selected output driver for more information.)metavarmultiplecallbackr   z--ooopen_optionszhDriver specific open options. See the documentation for the selected output driver for more information.)__doc__collectionsr   r!   optionsrc_crs_optdst_crs_optr   r   r&   r0   creation_optopen_opt r   r   <module>r>      s    * $  ll;-Hll;:LM >F ||
	w <<
	sr   