o
    ⹏i                      @  s   d Z ddlmZ ddlZddlZ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
 d
eZG dd de	eZdgZdS )zmacOS.    )annotationsN)TYPE_CHECKING   )XDGMixin)PlatformDirsABC)Pathc                   @  s  e Zd ZdZed+ddZed,ddZed-d
dZed+ddZed,ddZ	ed+ddZ
ed+ddZed-ddZed+ddZed+ddZed+ddZed+ddZed+ddZed+d d!Zed+d"d#Zed+d$d%Zed+d&d'Zed+d(d)Zd*S )._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                 C     |  tjdS )zb:return: data directory tied to the user, e.g. ``~/Library/Application Support/$appname/$version``z~/Library/Application Support_append_app_name_and_versionospath
expanduserself r   O/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/platformdirs/macos.pyuser_data_dir      z_MacOSDefaults.user_data_dir	list[str]c                 C  sP   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_listr   r   r   _site_data_dirs   s
   
z_MacOSDefaults._site_data_dirsr   c                 C     |  | jS )zh:return: 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   r   r   r   site_data_path&      z_MacOSDefaults.site_data_pathc                 C     | j S )zC:return: config directory tied to the user, same as `user_data_dir`r   r   r   r   r   user_config_dir+      z_MacOSDefaults.user_config_dirc                 C  r(   )N)r"   r   r   r   r   _site_config_dirs0   s   z _MacOSDefaults._site_config_dirsc                 C  r   )zV:return: cache directory tied to the user, e.g. ``~/Library/Caches/$appname/$version``z~/Library/Cachesr   r   r   r   r   user_cache_dir4   r   z_MacOSDefaults.user_cache_dirc                 C  sf   dt jv }|rt jdd nd}|r| | dgng }|| d | jr/tj|S |d S )a7  
        :return: 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   r   z
/var/cachez/Library/Caches)	r   r   r   r   r   	multipathr   pathsepjoinr   r   r   r   site_cache_dir9   s   

z_MacOSDefaults.site_cache_dirc                 C  r#   )zi:return: cache path shared by users. Only return the first item, even if ``multipath`` is set to ``True``)r$   r1   r   r   r   r   site_cache_pathK   r'   z_MacOSDefaults.site_cache_pathc                 C  r(   )zB:return: state directory tied to the user, same as `user_data_dir`r)   r   r   r   r   user_state_dirP   r+   z_MacOSDefaults.user_state_dirc                 C  r   )zR:return: log directory tied to the user, e.g. ``~/Library/Logs/$appname/$version``z~/Library/Logsr   r   r   r   r   user_log_dirU   r   z_MacOSDefaults.user_log_dirc                 C     t jdS )zC:return: documents directory tied to the user, e.g. ``~/Documents``z~/Documentsr   r   r   r   r   r   r   user_documents_dirZ   r'   z!_MacOSDefaults.user_documents_dirc                 C  r5   )zC:return: downloads directory tied to the user, e.g. ``~/Downloads``z~/Downloadsr6   r   r   r   r   user_downloads_dir_   r'   z!_MacOSDefaults.user_downloads_dirc                 C  r5   )zA:return: pictures directory tied to the user, e.g. ``~/Pictures``z
~/Picturesr6   r   r   r   r   user_pictures_dird   r'   z _MacOSDefaults.user_pictures_dirc                 C  r5   )z=:return: videos directory tied to the user, e.g. ``~/Movies``z~/Moviesr6   r   r   r   r   user_videos_diri   r'   z_MacOSDefaults.user_videos_dirc                 C  r5   )z;:return: music directory tied to the user, e.g. ``~/Music``z~/Musicr6   r   r   r   r   user_music_dirn   r'   z_MacOSDefaults.user_music_dirc                 C  r5   )z?:return: desktop directory tied to the user, e.g. ``~/Desktop``z	~/Desktopr6   r   r   r   r   user_desktop_dirs   r'   z_MacOSDefaults.user_desktop_dirc                 C  r   )zg:return: runtime directory tied to the user, e.g. ``~/Library/Caches/TemporaryItems/$appname/$version``z~/Library/Caches/TemporaryItemsr   r   r   r   r   user_runtime_dirx   r   z_MacOSDefaults.user_runtime_dirc                 C  r(   )zF:return: runtime directory shared by users, same as `user_runtime_dir`)r=   r   r   r   r   site_runtime_dir}   r+   z_MacOSDefaults.site_runtime_dirN)r	   r
   )r	   r   )r	   r   )__name__
__module____qualname____doc__propertyr   r"   r&   r*   r,   r-   r1   r2   r3   r4   r7   r8   r9   r:   r;   r<   r=   r>   r   r   r   r   r      sL    r   c                   @  s   e Zd ZdZdS )MacOSaO  
    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@   rA   rB   r   r   r   r   rD      s    rD   )rB   
__future__r   os.pathr   r   typingr   _xdgr   apir   pathlibr   r   rD   __all__r   r   r   r   <module>   s    s