a
    1$e                     @   s  d Z ddlZddlZddlmZmZmZ ddlmZ ddl	m
Z
mZ ddlmZmZmZ ejde de d	d
Zejddddd ejddZejdddZejddd ejddddgdd ejddd ejdd d ejd!d"d ejd#d$dd ejd%d&dd ejd'd(dd ejd)d*dd ejd+d,dd ejd-d.d ejddd/dd d0d1 Zd2d3 Zed4kr|e  dS )5zE
This is the main entry point for pyproj CLI

e.g. python -m pyproj

    N)__proj_version____version___show_versions)BBox)get_data_dirget_user_data_dir)_download_resource_fileget_proj_endpointget_transform_grid_listzpyproj version: z [PROJ version: ])descriptionz-vz	--verbosez+Show verbose debugging version information.
store_true)helpactioncommands)titlesynczBTool for synchronizing PROJ datum and transformation support data.)namer   z--bboxa  Specify an area of interest to restrict the resources to download. The area of interest is specified as a bounding box with geographic coordinates, expressed in degrees in an unspecified geographic CRS. `west_long` and `east_long` should be in the [-180,180] range, and `south_lat` and `north_lat` in the [-90,90]. `west_long` is generally lower than `east_long`, except in the case where the area of interest crosses the antimeridian.)r   z--spatial-testa`  Specify how the extent of the resource files are compared to the area of use specified explicitly with `--bbox`. By default, any resource files whose extent intersects the value specified by `--bbox` will be selected. If using the ``contains`` strategy, only resource files whose extent is contained in the value specified by `--bbox` will be selected.Z
intersectscontains)r   choicesdefaultz--source-idzRestrict resource files to be downloaded to those whose source_id property contains the ID value. Default is all possible values.z--area-of-usezRestrict resource files to be downloaded to those whose area_of_use property contains the AREA_OF_USE value. Default is all possible values.z--filezRestrict resource files to be downloaded to those whose name property  (file name) contains the FILE value. Default is all possible values.z--exclude-world-coveragez(Exclude files which have world coverage.z--include-already-downloadedz*Include grids that are already downloaded.z--list-filesz#List the files without downloading.z--allz%Download all missing transform grids.z--system-directoryzfIf enabled, it will sync grids to the main PROJ data directory instead of the user writable directory.z--target-directoryzFThe directory to sync grids to instead of the user writable directory.zPrint download information.c              
   C   s  t | j| j| j| j| j| jfs,t  dS | jrVt | j| j| j| j| jfrVt	dd}| jdur| j
d\}}}}tt|t|t|t|d}| jr| jrt	d| j}| jrt 
tjjd }n|std}t| j| j| j|| j| j | j|d}| jrtd	 td
 nt }|D ]l}	| jr\t|	d d |	d d |	d ddd n2|	d d }
t| d|
 |
|| j|	d d d q$dS )z'
    Handle sync command arguments
    Nz]Cannot use '--all' with '--list-files', '--source-id','--area-of-use', '--bbox', or '--file'.,)westsoutheastnorthz:Cannot set both --target-directory and --system-directory.r   T)	source_idarea_of_usefilenamebboxspatial_testZinclude_world_coverageinclude_already_downloadedtarget_directoryz"filename | source_id | area_of_usez"----------------------------------
propertiesr   r   r   z | )sep/Z	sha256sum)file_urlZ
short_name	directoryverbosesha256)anyr   Z
list_filesallr   r   filesync_parser
print_helpRuntimeErrorsplitr   floatr"   Zsystem_directoryr   ospathr$   r   r
   r    Zexclude_world_coverager!   printr	   getr   r(   )argsr   r   r   r   r   r"   ZgridsZendpointgridr    r8   K/var/www/html/django/DPS/env/lib/python3.9/site-packages/pyproj/__main__.py_parse_sync_commandr   s    
	





r:   c                  C   s8   t  } t| drt|  n| jr,t  nt   dS )z:
    Main entrypoint into the command line interface.
    r   N)parser
parse_argshasattrr:   r(   r   Zshow_versionsr.   )r6   r8   r8   r9   main   s    


r>   __main__)__doc__argparser2   Zpyprojr   r   r   Z
pyproj.aoir   Zpyproj.datadirr   r   Zpyproj.syncr   r	   r
   ArgumentParserr;   add_argumentadd_subparsersZ
subparsers
add_parserr-   r:   r>   __name__r8   r8   r8   r9   <module>   s   Q
