Ë
    PU h   ã                  ój   — d Z ddlmZ ddlZddlZddlZddlZddlmZ 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 dd„Z	y)a  Config handler.

This module allows people to keep their jira server credentials outside their script,
in a configuration file that is not saved in the source control.

Also, this simplifies the scripts by not having to write the same initialization code for each script.
é    )ÚannotationsN)ÚJIRAc                ó  — d„ }t        |t        «      r|rdnd}n|}t        j                  dd|||dœd¬«      } |d«      }	|	rt	        j
                  d	|	› d
�«       | s&|	r$|j                  |	«       	 |j                  dd«      } | r“|	r|j                  |	«       |j                  | d«      }|j                  | d«      }|j                  | d«      }|j                  | d«      }|j                  | d«      }	 |j                  | d«      }nt        dt        z  «      ‚t        j                  }
||
d<   ||
d<   ||
d<   ||
d<   t        |
||f¬«      S # t        j                  $ r Y ŒÝw xY w# t        $ r |j                  | d«      }Y Œiw xY w)a|  Return a JIRA object by loading the connection details from the `config.ini` file.

    Args:
        profile (Optional[str]): The name of the section from config.ini file that stores server config url/username/password
        url (str): URL of the Jira server
        username (str): username to use for authentication
        password (str): password to use for authentication
        appid: appid
        autofix: autofix
        verify (Union[bool, str]): True to indicate whether SSL certificates should be verified or
            str path to a CA_BUNDLE file or directory with certificates of trusted CAs. (Default: ``True``)

    Returns:
        JIRA: an instance to a JIRA object.

    Raises:
        EnvironmentError

    Usage:

        >>> from jira.config import get_jira
        >>>
        >>> jira = get_jira(profile='jira')

    Also create a `config.ini` like this and put it in current directory, user home directory or PYTHONPATH.

    .. code-block:: none

        [jira]
        url=https://jira.atlassian.com
        # only the `url` is mandatory
        user=...
        pass=...
        appid=...
        verify=...

    c                óR  — dt         j                  j                  d«      g}|j                  t        j                  «       |D ]b  }t         j                  j                  t         j                  j                  || «      «      }t         j                  j                  |«      sŒ`|c S  y)zrFind the file named path in the sys.path.

        Returns the full path name if found, None if not found
        ú.ú~N)ÚosÚpathÚ
expanduserÚextendÚsysÚabspathÚjoinÚisfile)r
   ÚpathsÚdirnameÚpossibles       úC/var/www/timesheet/venv/lib/python3.12/site-packages/jira/config.pyÚfindfilezget_jira.<locals>.findfileA   sw   € ð
 ”b—g‘g×(Ñ(¨Ó-Ð.ˆØ�‰”S—X‘XÔØò 	 ˆGÜ—w‘w—‘¤r§w¡w§|¡|°G¸TÓ'BÓCˆHÜ�w‰w�~‰~˜hÕ'Ø’ð	 ð ó    ÚyesÚnoN)ÚuserÚpassÚappidÚautofixÚverifyT)ÚdefaultsÚallow_no_valuez
config.inizFound z config fileÚgeneralzdefault-jira-profileÚurlr   r   r   r   r   zf%s was not able to locate the config.ini file in current directory, user home directory or PYTHONPATH.Úserver)ÚoptionsÚ
basic_auth)Ú
isinstanceÚboolÚconfigparserÚConfigParserÚloggingÚdebugÚreadÚgetÚNoOptionErrorÚ
getbooleanÚ
ValueErrorÚOSErrorÚ__name__r   ÚDEFAULT_OPTIONS)Úprofiler!   ÚusernameÚpasswordr   r   r   r   ÚconfigÚconfig_filer#   s              r   Úget_jirar8      s­  € ò^ô �&œ$ÔÙ ‘ d‰àˆä×&Ñ&àØØØØñ
ð ô	€Fñ ˜<Ó(€KÙÜ�‰˜˜{˜m¨<Ð8Ô9áÙØ�K‰K˜Ô$ðØ Ÿ*™* YÐ0FÓG�ñ ÙØ�K‰K˜Ô$Ø—*‘*˜W eÓ,ˆCØ—z‘z '¨6Ó2ˆHØ—z‘z '¨6Ó2ˆHØ—J‘J˜w¨Ó0ˆEØ—j‘j ¨)Ó4ˆGð7Ø×*Ñ*¨7°HÓ=‘ô ØxÜñóð ô
 ×"Ñ"€GØ€GˆHÑØ €GˆIÑØ€GˆGÑØ€GˆHÑä˜¨X°xÐ,@ÔAÐAøô7  ×-Ñ-ò Ùðûô ò 7ØŸ™ G¨XÓ6’ð7ús$   Á3E Ã5E& ÅE#Å"E#Å&FÆF)Nzhttp://localhost:2990Úadminr9   NFT)
r3   z
str | Noner!   Ústrr4   r:   r5   r:   r   z
bool | str)
Ú__doc__Ú
__future__r   r'   r)   r	   r   Újira.clientr   r8   © r   r   ú<module>r?      st   ðñõ #ã Û Û 	Û 
å ð Ø&ØØØ
ØØðpBØðpBà	ðpBð ðpBð ð	pBð ôpBr   