
    q'VeQ                     f    d Z ddlZddlZddlZd Zd Zd Zd Zd Zd Z	d	 Z
d
 Zd Zd ZddZdS )zFProvide a CLI to allow configuring developer settings, including mypy.    Nc                  8    ddl } t          d| j                   dS )z)Print the current version of the package.r   NzQtPy version)qtpyprint__version__r   s    (lib/python3.11/site-packages/qtpy/cli.pyprint_versionr	      s$    KKK	.$*+++++    c                  2     ddl   fd j        D             S )z$Get the status of each Qt API usage.r   Nc                 (    i | ]}||j         k    S  )API).0namer   s     r   
<dictcomp>z"get_api_status.<locals>.<dictcomp>   s"    >>>tD$$(">>>r
   )r   	API_NAMESr   s   @r   get_api_statusr      s(    KKK>>>>t~>>>>r
   c                      dddt                      } d                    fd|                                 D                       S )z>Generate a string with always-true/false args to pass to mypy.z--always-falsez--always-true)FT c              3   \   K   | ]&\  }}|          d |                                  V  'dS )=Nupper)r   r   	is_activeoptionss      r   	<genexpr>z%generate_mypy_args.<locals>.<genexpr>#   sV        D) 9..

..     r
   r   joinitems)apis_activer   s    @r   generate_mypy_argsr!      sc    &o>>G ""K88    *0022     r
   c                      t                      } t          j        dd |                                 D             i          S )z;Generate Pyright config to be used in `pyrightconfig.json`.defineConstantc                 >    i | ]\  }}|                                 |S r   r   r   r   r   s      r   r   z0generate_pyright_config_json.<locals>.<dictcomp>/   s6       #D) 

i  r
   )r   jsondumpsr   r    s    r   generate_pyright_config_jsonr)   )   sQ     ""K:  '2'8'8':':  	
  r
   c                      t                      } dd                    d |                                 D                       z   S )z9Generate a Pyright config to be used in `pyproject.toml`.z[tool.pyright.defineConstant]

c              3      K   | ]?\  }}|                                  d t          |                                           V  @dS )z = N)r   strlowerr%   s      r   r   z/generate_pyright_config_toml.<locals>.<genexpr>;   sb       9 9D) ::<<44C	NN0022449 9 9 9 9 9r
   r   r(   s    r   generate_pyright_config_tomlr/   7   sR     ""K,tyy 9 9*00229 9 9 0 0  r
   c                  <    t          t                                 dS )z(Print the generated mypy args to stdout.N)r   r!   r   r
   r   print_mypy_argsr1   A   s    	


r
   c                  <    t          t                                 dS )z2Print the generated Pyright JSON config to stdout.N)r   r)   r   r
   r   print_pyright_config_jsonr3   F       	
&
(
()))))r
   c                  <    t          t                                 dS )z2Print the generated Pyright TOML config to stdout.N)r   r/   r   r
   r   print_pyright_config_tomlr6   K   r4   r
   c                      t          d           t                       t                       t          d           t                       dS )z.Print the generated Pyright configs to stdout.zpyrightconfig.json:zpyproject.toml:N)r   r3   r6   r   r
   r   print_pyright_configsr8   P   sG    	
   	GGG	
r
   c                     t          j        d          } |                     | j                   |                     dddt
          d           |                     d	d
d          }|                    ddt           j        t          j
        d                    }|                    t                     |                    ddt           j        t          j
        d                    }|                    t                     | S )z6Generate the argument parser for the dev CLI for QtPy.z*Features to support development with QtPy.)description)funcz	--versionstore_constr;   z*If passed, will print the version and exit)actiondestconsthelpSubcommandszSubcommand to run
Subcommand)titler@   metavarz	mypy-argsz9Generate command line arguments for using mypy with QtPy.a  
            Generate command line arguments for using mypy with QtPy.

            This will generate strings similar to the following
            which help guide mypy through which library QtPy would have used
            so that mypy can get the proper underlying type hints.

                --always-false=PYQT5 --always-false=PYQT6 --always-true=PYSIDE2 --always-false=PYSIDE6

            It can be used as follows on Bash or a similar shell:

                mypy --package mypackage $(qtpy mypy-args)
            )r   r@   formatter_classr:   zpyright-configz4Generate Pyright config for using Pyright with QtPy.a{  
            Generate Pyright config for using Pyright with QtPy.

            This will generate config sections to be included in a Pyright
            config file (either `pyrightconfig.json` or `pyproject.toml`)
            which help guide Pyright through which library QtPy would have used
            so that Pyright can get the proper underlying type hints.

            )argparseArgumentParserset_defaults
print_helpadd_argumentr	   add_subparsers
add_parserRawTextHelpFormattertextwrapdedentr1   r8   )parsercli_subparsersmypy_args_parserpyright_config_parsers       r   generate_arg_parserrT   Y   s;   $@  F V.///
9     **  +  N &00H 5O
 
	 1  ( !!!777 +55C 5O

 

	 6    &&,A&BBBMr
   c                     t                      }|                    |           }dhfdt          |                                          D             } |j        di | dS )z!Run the development CLI for QtPy.)argsr;   c                 $    i | ]\  }}|v	||S r   r   )r   keyvaluereserved_paramss      r   r   zmain.<locals>.<dictcomp>   s4       Co%% 	U%%%r
   Nr   )rT   
parse_argsvarsr   r;   )rV   rP   parsed_argscleaned_argsrZ   s       @r   mainr_      s     ""F###..KhO   {++1133  L
 K$$|$$$$$r
   )N)__doc__rF   r&   rN   r	   r   r!   r)   r/   r1   r3   r6   r8   rT   r_   r   r
   r   <module>ra      s    M L   , , ,? ? ?           
* * *
* * *
     ? ? ?D% % % % % %r
   