+
    Ni:$                         ^ RI H t  ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RItR t	R t
R tR tR tR tR	 tRR
 ltR tRsR tR tR# )    )fnmatchNc                  X    R p \         P                  ! V R\         P                  R7       R# )z%%(asctime)s %(levelname)s %(message)sz%H:%M:%S)formatdatefmtlevelN)loggingbasicConfigDEBUG)FORMATs    O/tmp/fempkg/build/kf6/DESTDIR/usr/lib/python3.14/site-packages/kapidox/utils.pysetup_loggingr      s    4FvzO    c                2    \        V 4      \        J d   V # V .# )zReturn a list based on `a`. )typelist)as   &r   tolistr   $   s    Q41(aS(r   c                j    V e/   RP                  V P                  4       P                  R4      4      # R# )zXReturn a serialized name.

For now it only replaces ' ' with '_' and lower the letters.
N_ )joinlowersplit)names   &r   serialize_namer   )   s-    
 xx

**3/00r   c                    V f   R#  \         P                  ! RV ,           4      pVP                  4       R,          #   \         d)   p\        P
                  ! RT : RT 24        Rp?R# Rp?ii ; i)zmReturn the repopath for the repo id, queried from projects.kde.org

Args:
    id: unique KDE repo identifier
Nz+https://projects.kde.org/api/v1/identifier/repoz!Failed to get repository url for z from projects.kde.org: )requestsgetjson	Exceptionr   warning)idrexcs   &  r   set_repopathr&   4   sj     
zLLFKLvvx 	 	;B6AYZ]Y^_` 	s   3< A/A**A/c                   a V '       g   . pM:\        V \        4      '       d   \        V3R lV 4      pMSP                  V R4      .pV Uu. uF
  q3f   K  VNK  	  ppV# u upi )aQ  Expend the name of the maintainers.

Args:
    maintainer_keys: (string) Key of the dictionary where the name to expend is saved.
    all_maintainers: (dict of dict) Look-up table where the names and emails of
the maintainers are stored.

Examples:
    >>> maintainer_keys = ['arthur', 'toto']

    >>> myteam = {'arthur': {'name': 'Arthur Pendragon',
                             'email': 'arthur@example.com'},
                  'toto': {'name': 'Toto',
                           'email: 'toto123@example.com'}
                  }

    >>> set_maintainers(maintainer_keys, all_maintainers)
c                 (   < SP                  V R 4      # )N)r   )xall_maintainerss   &r   <lambda>!set_maintainers.<locals>.<lambda>c   s    O$7$74$@r   N)
isinstancer   mapr   )maintainer_keysr*   maintainersr)   s   &f  r   set_maintainersr1   L   sb    ( 	OT	*	*@)+ '**?DAB);k11kK; <s   AAc                   \         P                  P                  V R4      p\         P                  P                  V4      '       gP   \         P                  ! V 4       F  pRV9   g   K  RV9  g   K  VRR	 u # 	  \
        P                  ! RV  24       R# \        P                  ! R\        P                  \        P                  ,          4      p\        V4      ;_uu_ 4       pVP                  4       pVP                  V4      pV'       d   VP                  ^4      uuRRR4       #  RRR4       \
        P                  ! RV R24       R#   + '       g   i     L,; i)
zoReturn the framework name for a given source dir

The framework name is the name of the toplevel CMake project
CMakeLists.txtz.qbsTestNzNo CMakeLists.txt in z^\s*project\s*\(\s*([\w\-_]+)zGFailed to find framework name: Could not find a 'project()' command in .)ospathr   existslistdirr   errorrecompileIMopenreadsearchgroup)fw_dircmakelists_pathf
project_recmakelists_contentmatchs   &     r   parse_fancynamerJ   l   s    
 ggll6+;<O77>>/**F#A{vQ"v $ 	-fX67<bddRTTkJJ	o		!VVX!!"45;;q>	 
	  
 MM[\k[llmno 
	s   ":EE	c                    Rp \         P                  R8X  d9    ^ RIHp \        P
                  P                  V! ^^R4      ^ ,          R4      p EM4\        P                  R8X  d   R\        P                  9   dq   \        P
                  P                  \        P                  R,          4      '       d7   \        P
                  P                  \        P                  R,          RR	4      p M\        P                  R
8X  d   R\        P                  9   dp   \        P
                  P                  \        P                  R,          4      '       d6   \        P
                  P                  \        P                  R,          R4      p V f4   \        P
                  P                  \        P                  ! 4       R	4      p \        P
                  P                  V 4      '       g   \        P                  ! V 4       V #     Lx; i)zFind/create a semi-long-term cache directory.

We do not use tempdir, except as a fallback, because temporary directories
are intended for files that only last for the program's execution.
Ndarwin)#NSSearchPathForDirectoriesInDomainsTKApiDoxposixHOMEz.cachekapidoxntAPPDATA)sysplatformAppKitrM   r7   r8   r   r   environr9   tempfile
gettempdirisdirmakedirs)cachedirrM   s     r   	cache_dirr]      s:    H
||x
	B
 ww||3B4@CH
 
G	RZZBGGNN2::f3E$F$Fww||BJJv$6)LH	D

"rww~~bjj6K'L'Lww||BJJy$99EH77<< 3 3 5yA77==""
HO	s   5G8 8G<c                J    ^ RI p^ RIp\        P                  ! RV 4       VP                  P                  4       pVP                  P                  . 4      Vn        VP                  P                  4       pVP                  P                  Vn        VP                  P                  WVRV4       \,        P.                  ! TR4       R#   \         d    \        P                  ! RT 4       . R	OpT'       d   TP                  R4       Y`T.,          p \        P                   ! T\        P"                  R7        L  \        P$                   d&   p\        P&                  ! TP(                  4      hRp?i\*         d#   p\        P                  ! R4        Rp? R# Rp?ii ; ii ; i)
aE  Wraps svn export.

Args:
    remote:     (string) the remote url.
    local:      (string) the local path where to download.
    overwrite:  (bool) whether to overwrite `local` or not. (optional,
default = False)

Returns:
    True if success.

Raises:
    FileNotFoundError: &nbsp;
    subprocess.CalledProcessError: &nbsp;
Nz(Using Python libsvn bindings to fetch %sTz%Using external svn client to fetch %sz--force)stderrzExternal svn client not foundF)svnexportz--quiet)svn.core
svn.clientr   debugclientcreate_contextcoresvn_auth_open
auth_batonsvn_opt_revision_tsvn_opt_revision_headr   ra   ImportErrorappend
subprocess
check_callSTDOUTCalledProcessErrorStandardExceptionoutputFileNotFoundErrorr7   utime)remotelocal	overwriter`   ctxlatestcmdes   &&&     r   
svn_exportr}      s1    @&Ijj'')//3,,.hh44

&s; HHUD  =vF*JJy!	!!#j.?.?@,, 	9..qxx88  	MM9:	sC   B,C A	F"&D99F E..F;F<FF"FF"c                   R.p\         P                  ! V!  p\        P                  ! V 4       EF#  p\        P                  P                  W4      p\        P                  P                  V4      '       dC   RpV F  p\        WG4      '       g   K  Rp M	  V'       d   \         P                  ! WQ4       K  K  \        P                  P                  V4      '       g   K  \        P                  P                  W4      p\        P                  P                  V4      '       d   \         P                  ! V4       \         P                  ! WXVR7       EK&  	  R# )zCopy the contents of a directory

Args:
    directory: (string) the directory to copy the contents of.
    dest: (string) the directory to copy them into.
r3   TF)ignoreN)shutilignore_patternsr7   r:   r8   r   isfiler   copyrZ   rmtreecopytree)		directorydestignoredr   fnrF   docopyidest_fs	   &&       r   copy_dir_contentsr      s       G##W-Fjj#GGLL'77>>!F2>>"F  A$ WW]]1WW\\$+Fww}}V$$f%OOAf55 $r   c                    \         e   \         # Rs \        P                  P                  \        P
                  ^ ,          4      p \        P                  P                  V RR4      p\        P                  P                  V4      '       g   \         # \        P                  P                  VR4      p\        P                  P                  V4      '       g!   \        P                  ! RV R24       \         #  \        V4      P                  4       pVP                  R4      ^,          P                  4       p\        \        P                  P                  W4      4      ;_uu_ 4       pVP                  4       P                  4       s RRR4       \         #   + '       g   i     \         # ; i  \          d)   p\        P                  ! RT 24        Rp?\         # Rp?ii ; i)	a  Get commit id of running code if it is running from git repository.

May return an empty string if it failed to extract the commit id.

Assumes .git/HEAD looks like this:

    ref: refs/heads/master

and assumes .git/refs/heads/master contains the commit id
N z..z.gitHEADzGetting git info failed: z is not a filez: )_KAPIDOX_VERSIONr7   r8   dirnamerT   argvr   rZ   r   r   r"   r@   readliner   striprA   r!   )bin_dirgit_dirgit_HEADlineref_namerF   r%   s          r   get_kapidox_versionr      sP    #ggoochhqk*Gggll7D&1G77==!!ww||GV,H77>>(##3H:^LM;H~&&(::d#A&,,."'',,w122a vvx~~/ 3  32 	  ; 	3C59::	;s7   7A/F+ &FF+ F(	F+ (F+ +G6GGc           
         . p\         P                  ! V 4       F\  w  r#pTP                  V Uu. uF:  qUP                  R4      '       g   K  \         P                  P                  W%4      NK<  	  up4       K^  	  V# u upi )zIReturns a list of path to files ending with .dot in subdirs of `dot_dir`.z.dot)r7   walkextendendswithr8   r   )dot_dirlstrootdirsfilesr)   s   &     r   find_dot_filesr     s^    
C!www/U

5O5aJJv<N)BGGLL)5OP  0J Ps   A;
#A;
)F)r   r   r7   r<   rn   r   rT   rX   r   r   r   r   r&   r1   rJ   r]   r}   r   r   r   r    r   r   <module>r      sf      	 	   
   P
)
0@.@*Z64  %Pr   