
    Ij&                        d Z ddlmZ ddlZddlZddlmZ erddlm	Z	 ddl
mZ ddlmZ erdd	lmZ  G d
 de          Z G d dee          ZdgZdS )zmacOS.    )annotationsN)TYPE_CHECKING)Iterator   )XDGMixin)PlatformDirsABC)Pathc                  :   e Zd ZdZd-dZd.dZed-d            Zed.d            Zed/d
            Z	ed/d            Z
ed-d            Zed.d            Zed-d            Zed.d            Zed-d            Zed/d            Zed-d            Zed-d            Zed-d            Zed-d            Zed-d            Zed-d            Zed-d            Zed-d            Zed-d            Zed-d            Zed-d            Zed-d            Zed-d            Zed-d            Zed-d             Zed-d!            Z ed-d"            Z!ed-d#            Z"ed.d$            Z#ed-d%            Z$ed-d&            Z%ed-d'            Z&d0d)Z'd0d*Z(d0d+Z)d,S )1_MacOSDefaultsa  Default platform directories for macOS without XDG environment variable overrides.

    Follows the guidance from `Apple's File System Programming Guide
    <https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html>`_.
    The XDG env var handling is in :class:`~platformdirs._xdg.XDGMixin`.

    returnstrc                f    |                      t          j                            d                    S )Nz~/Library/Application Support_append_app_name_and_versionospath
expanduserselfs    \/workspace/show-city-briefing-agent/.venv/lib/python3.11/site-packages/platformdirs/macos.py_base_user_app_support_dirz)_MacOSDefaults._base_user_app_support_dir   s'    001C1CDc1d1deee    	list[str]c                    dt           j        v }|r%t           j                            d          d         nd}|r|                     | d          gng }|                    |                     d                     |S )N/opt/pythonr    z/sharez/Library/Application Supportsysprefixsplitr   appendr   is_homebrewhomebrew_prefix	path_lists       r   _base_site_dirsz_MacOSDefaults._base_site_dirs   s    #sz1@KS#***=99!<<QSWbjT66/7Q7Q7QRRSShj	::;YZZ[[[r   c                *    |                                  S )zZData directory tied to the user, e.g. ``~/Library/Application Support/$appname/$version``.r   r   s    r   user_data_dirz_MacOSDefaults.user_data_dir&        ..000r   c                *    |                                  S Nr&   r   s    r   _site_data_dirsz_MacOSDefaults._site_data_dirs+       ##%%%r   r	   c                6    |                      | j                  S )z`Data path shared by users. Only return the first item, even if ``multipath`` is set to ``True``.) _first_item_as_path_if_multipathsite_data_dirr   s    r   site_data_pathz_MacOSDefaults.site_data_path/   s     44T5GHHHr   c                6    |                      | j                  S )zbConfig path shared by users. Only return the first item, even if ``multipath`` is set to ``True``.)r1   site_config_dirr   s    r   site_config_pathz_MacOSDefaults.site_config_path4   s     44T5IJJJr   c                *    |                                  S )z;Config directory tied to the user, same as `user_data_dir`.r(   r   s    r   user_config_dirz_MacOSDefaults.user_config_dir9   r*   r   c                *    |                                  S r,   r-   r   s    r   _site_config_dirsz _MacOSDefaults._site_config_dirs>   r/   r   c                f    |                      t          j                            d                    S )zNCache directory tied to the user, e.g. ``~/Library/Caches/$appname/$version``.z~/Library/Cachesr   r   s    r   user_cache_dirz_MacOSDefaults.user_cache_dirB   s)     001C1CDV1W1WXXXr   c                    dt           j        v }|r%t           j                            d          d         nd}|r|                     | d          gng }|                    |                     d                     |S )Nr   r   r   z
/var/cachez/Library/Cachesr   r"   s       r   _site_cache_dirsz_MacOSDefaults._site_cache_dirsG   s    #sz1@KS#***=99!<<QS[fnT66/7U7U7UVVWWln	::;LMMNNNr   c                l    | j         }| j        rt          j                            |          n|d         S )a  Cache directory shared by users, e.g. ``/Library/Caches/$appname/$version``. If we're using a Python binary managed by `Homebrew <https://brew.sh>`_, the directory will be under the Homebrew prefix, e.g. ``$homebrew_prefix/var/cache/$appname/$version``. If `multipath <platformdirs.api.PlatformDirsABC.multipath>` is enabled, and we're in Homebrew, the response is a multi-path string separated by ":", e.g. ``$homebrew_prefix/var/cache/$appname/$version:/Library/Caches/$appname/$version``.r   )r>   	multipathr   pathsepjoinr   dirss     r   site_cache_dirz_MacOSDefaults.site_cache_dirO   s0     $(,Crzt$$$DGCr   c                6    |                      | j                  S )zaCache path shared by users. Only return the first item, even if ``multipath`` is set to ``True``.)r1   rE   r   s    r   site_cache_pathz_MacOSDefaults.site_cache_pathU   s     44T5HIIIr   c                *    |                                  S )z:State directory tied to the user, same as `user_data_dir`.r(   r   s    r   user_state_dirz_MacOSDefaults.user_state_dirZ   r*   r   c                6    |                                  d         S )z9State directory shared by users, same as `site_data_dir`.r   r-   r   s    r   site_state_dirz_MacOSDefaults.site_state_dir_   s     ##%%a((r   c                f    |                      t          j                            d                    S )zJLog directory tied to the user, e.g. ``~/Library/Logs/$appname/$version``.z~/Library/Logsr   r   s    r   user_log_dirz_MacOSDefaults.user_log_dird   s)     001C1CDT1U1UVVVr   c                ,    |                      d          S )zHLog directory shared by users, e.g. ``/Library/Logs/$appname/$version``.z/Library/Logs)r   r   s    r   site_log_dirz_MacOSDefaults.site_log_diri   s     00AAAr   c                @    t           j                            d          S )z;Documents directory tied to the user, e.g. ``~/Documents``.z~/Documentsr   r   r   r   s    r   user_documents_dirz!_MacOSDefaults.user_documents_dirn        w!!-000r   c                @    t           j                            d          S )z;Downloads directory tied to the user, e.g. ``~/Downloads``.z~/DownloadsrQ   r   s    r   user_downloads_dirz!_MacOSDefaults.user_downloads_dirs   rS   r   c                @    t           j                            d          S )z9Pictures directory tied to the user, e.g. ``~/Pictures``.z
~/PicturesrQ   r   s    r   user_pictures_dirz _MacOSDefaults.user_pictures_dirx        w!!,///r   c                @    t           j                            d          S )z5Videos directory tied to the user, e.g. ``~/Movies``.z~/MoviesrQ   r   s    r   user_videos_dirz_MacOSDefaults.user_videos_dir}        w!!*---r   c                @    t           j                            d          S )z3Music directory tied to the user, e.g. ``~/Music``.z~/MusicrQ   r   s    r   user_music_dirz_MacOSDefaults.user_music_dir   s     w!!),,,r   c                @    t           j                            d          S )z7Desktop directory tied to the user, e.g. ``~/Desktop``.z	~/DesktoprQ   r   s    r   user_desktop_dirz_MacOSDefaults.user_desktop_dir   s     w!!+...r   c                @    t           j                            d          S )z9Projects directory tied to the user, e.g. ``~/Projects``.z
~/ProjectsrQ   r   s    r   user_projects_dirz _MacOSDefaults.user_projects_dir   rX   r   c                @    t           j                            d          S )z;Public share directory tied to the user, e.g. ``~/Public``.z~/PublicrQ   r   s    r   user_publicshare_dirz#_MacOSDefaults.user_publicshare_dir   r[   r   c                @    t           j                            d          S )z;Templates directory tied to the user, e.g. ``~/Templates``.z~/TemplatesrQ   r   s    r   user_templates_dirz!_MacOSDefaults.user_templates_dir   rS   r   c                @    t           j                            d          S )z;Fonts directory tied to the user, e.g. ``~/Library/Fonts``.z~/Library/FontsrQ   r   s    r   user_fonts_dirz_MacOSDefaults.user_fonts_dir   s     w!!"3444r   c                f    |                      t          j                            d                    S )zNPreference directory tied to the user, e.g. ``~/Library/Preferences/AppName``.z~/Library/Preferencesr   r   s    r   user_preference_dirz"_MacOSDefaults.user_preference_dir   s)     001C1CD[1\1\]]]r   c                @    t           j                            d          S )z6Bin directory tied to the user, e.g. ``~/.local/bin``.z~/.local/binrQ   r   s    r   user_bin_dirz_MacOSDefaults.user_bin_dir   s     w!!.111r   c                    dS )z7Bin directory shared by users, e.g. ``/usr/local/bin``.z/usr/local/bin r   s    r   site_bin_dirz_MacOSDefaults.site_bin_dir   s
      r   c                @    t           j                            d          S )zAApplications directory tied to the user, e.g. ``~/Applications``.z~/ApplicationsrQ   r   s    r   user_applications_dirz$_MacOSDefaults.user_applications_dir   s     w!!"2333r   c                    dgS )Nz/Applicationsrm   r   s    r   _site_applications_dirsz&_MacOSDefaults._site_applications_dirs   s      r   c                l    | j         }| j        rt          j                            |          n|d         S )z?Applications directory shared by users, e.g. ``/Applications``.r   )rr   r@   r   rA   rB   rC   s     r   site_applications_dirz$_MacOSDefaults.site_applications_dir   s0     +(,Crzt$$$DGCr   c                f    |                      t          j                            d                    S )z_Runtime directory tied to the user, e.g. ``~/Library/Caches/TemporaryItems/$appname/$version``.z~/Library/Caches/TemporaryItemsr   r   s    r   user_runtime_dirz_MacOSDefaults.user_runtime_dir   s)     001C1CDe1f1fgggr   c                    | j         S )z>Runtime directory shared by users, same as `user_runtime_dir`.)rv   r   s    r   site_runtime_dirz_MacOSDefaults.site_runtime_dir   s     $$r   Iterator[str]c              #  6   K   | j         V  | j        E d{V  dS )z4:yield: all user and site configuration directories.N)r8   r:   r   s    r   iter_config_dirsz_MacOSDefaults.iter_config_dirs   s6      """"))))))))))r   c              #  6   K   | j         V  | j        E d{V  dS )z+:yield: all user and site data directories.N)r)   r.   r   s    r   iter_data_dirsz_MacOSDefaults.iter_data_dirs   s6          ''''''''''r   c              #  6   K   | j         V  | j        E d{V  dS )z,:yield: all user and site cache directories.N)r<   r>   r   s    r   iter_cache_dirsz_MacOSDefaults.iter_cache_dirs   s6      !!!!((((((((((r   N)r   r   )r   r   )r   r	   )r   ry   )*__name__
__module____qualname____doc__r   r&   propertyr)   r.   r3   r6   r8   r:   r<   r>   rE   rG   rI   rK   rM   rO   rR   rU   rW   rZ   r]   r_   ra   rc   re   rg   ri   rk   rn   rp   rr   rt   rv   rx   r{   r}   r   rm   r   r   r   r      s        f f f f    1 1 1 X1 & & & X& I I I XI K K K XK 1 1 1 X1 & & & X& Y Y Y XY    X D D D XD
 J J J XJ 1 1 1 X1 ) ) ) X) W W W XW B B B XB 1 1 1 X1 1 1 1 X1 0 0 0 X0 . . . X. - - - X- / / / X/ 0 0 0 X0 . . . X. 1 1 1 X1 5 5 5 X5 ^ ^ ^ X^ 2 2 2 X2       X  4 4 4 X4 ! ! ! X! D D D XD
 h h h Xh % % % X%* * * *
( ( ( (
) ) ) ) ) )r   r   c                      e Zd ZdZdS )MacOSaF  Platform directories for the macOS operating system.

    Follows the guidance from `Apple documentation
    <https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html>`_.
    Makes use of the `appname <platformdirs.api.PlatformDirsABC.appname>`, `version
    <platformdirs.api.PlatformDirsABC.version>`, `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`.

    XDG environment variables (e.g. ``$XDG_DATA_HOME``) are supported and take precedence over macOS defaults.

    N)r   r   r   r   rm   r   r   r   r      s        	 	 	 	r   r   )r   
__future__r   os.pathr   r   typingr   collections.abcr   _xdgr   apir   pathlibr	   r   r   __all__rm   r   r   <module>r      s    " " " " " "  



             )((((((                   B) B) B) B) B)_ B) B) B)J
 
 
 
 
Hn 
 
 
 r   