
    heX                     V    d dl Z d dlZddlmZ ddlmZ ddlmZ ddlm	Z	 	 	 d	dZ
d Zy)
    N   )DesignerSource)PythonSource)TranslationFile)UserExceptionc           	      ~   |d}|D cg c]  }t        ||||       }}g }| D ]a  }	t        j                  j                  |	      rt        j                  |	      D ]  \  }
}}t        ||       t        ||       |D ]  }t        j                  j                  |
|      }|j                  d      r|j                  t        ||             Q|j                  d      r|j                  t        ||             |st        d|         |	j                  d      r|j                  t        |	|             |	j                  d      r|j                  t        |	|             Jt        dj                  |	             |D ]*  }|D ]  }|j                  |        |j                          , yc c}w )	z Update a sequence of translation (.ts) files from a sequence of Python
    source (.py) files, Designer source (.ui) files or directories containing
    source files.
    N )no_obsolete
no_summaryverbosez.py)filenamer   z.uiIgnoringz.{0} must be a directory or a .py or a .ui file)r   ospathisdirwalk_remove_excludesjoinendswithappendr   r   printr   formatupdatewrite)sourcestranslation_filesr
   r   r   excludeststranslationssource_filessourcedirpathdirnames	filenamesfnr   tss                    7/usr/lib/python3/dist-packages/PyQt6/lupdate/lupdate.pylupdater)      s    
 () $BK!74 )L )
 L !%77== 02 4,9 84 H5# 4B!ww||GR8H((/$++ ,h07!9: "**51$++ .07!9: !j(34	4( __U# &'BD __U#"FGDF  DKK"$% %?!%H   	AHHQK	 	
		U)s   F:c                     t        |       D ]U  }|j                  d      r| j                  |       &|D ]+  }t        j                  ||      s| j                  |        U W y)zB Remove all implicitly and explicitly excluded names from a list. .N)list
startswithremovefnmatch)namesr   nameexcludes       r(   r   r   X   s[     U ??3LL# ??41LL&	    )FTFN)r/   r   designer_sourcer   python_sourcer   translation_filer   userr   r)   r   r	   r3   r(   <module>r8      s.   &  	 + ' -  GK $9x
r3   