o
    pf                     @   s   d Z ddl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j
r+ddlmZmZ g dZG d	d
 d
ejZeeG dd de	ZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZdS )zManage filesystems in platform-specific application directories.

These classes abstract away the different requirements for user data
across platforms, which vary in their conventions. They are all
subclasses of `~fs.osfs.OSFS`.

    N)AppDirs   )	make_repr)OSFS)OptionalText)
UserDataFSUserConfigFS
SiteDataFSSiteConfigFSUserCacheFS	UserLogFSc                       s    e Zd ZdZ fddZ  ZS )_CopyInitMetaa[  A metaclass that performs a hard copy of the `__init__`.

    This is a fix for Sphinx, which is a pain to configure in a way that
    it documents the ``__init__`` method of a class when it is inherited.
    Copying ``__init__`` makes it think it is not inherited, and let us
    share the documentation between all the `_AppFS` subclasses.

    c                    s*   | d|d j ttj| | |||S )N__init__r   )
setdefaultr   superabcABCMeta__new__)mcls	classnamebasescls_dict	__class__ A/home/ertert/spirit/venv/lib/python3.10/site-packages/fs/appfs.pyr   -   s   z_CopyInitMeta.__new__)__name__
__module____qualname____doc__r   __classcell__r   r   r   r   r   #   s    	r   c                       s>   e Zd ZdZdZ				d fdd	Zdd Zd	d
 Z  ZS )_AppFSz"Abstract base class for an app FS.NFTc                    s8   t ||||| _|| _tt| jt| j| j|d dS )a  Create a new application-specific filesystem.

        Arguments:
            appname (str): The name of the application.
            author (str): The name of the author (used on Windows).
            version (str): Optional version string, if a unique location
                per version of the application is required.
            roaming (bool): If `True`, use a *roaming* profile on
                Windows.
            create (bool): If `True` (the default) the directory
                will be created if it does not exist.

        )createN)r   app_dirs_creater   r"   r   getattrapp_dir)selfappnameauthorversionroamingr#   r   r   r   r   ;   s
   

z_AppFS.__init__c                 C   s:   t | jj| jj| jjd f| jjd f| jjdf| jdfdS )NFT)r*   r+   r,   r#   )	r   r   r   r$   r)   	appauthorr+   r,   r%   r(   r   r   r   __repr__W   s   


z_AppFS.__repr__c                 C   s   d | jj | jjS )Nz	<{} '{}'>)formatr   r   lowerr$   r)   r.   r   r   r   __str__b   s   z_AppFS.__str__)NNFT)	r   r   r   r    r'   r   r/   r2   r!   r   r   r   r   r"   2   s    r"   c                   @      e Zd ZdZdZdS )r   zA filesystem for per-user application data.

    May also be opened with
    ``open_fs('userdata://appname:author:version')``.

    user_data_dirNr   r   r   r    r'   r   r   r   r   r   i       r   c                   @   r3   )r	   zA filesystem for per-user config data.

    May also be opened with
    ``open_fs('userconf://appname:author:version')``.

    user_config_dirNr5   r   r   r   r   r	   t   r6   r	   c                   @   r3   )r   zA filesystem for per-user application cache data.

    May also be opened with
    ``open_fs('usercache://appname:author:version')``.

    user_cache_dirNr5   r   r   r   r   r      r6   r   c                   @   r3   )r
   zA filesystem for application site data.

    May also be opened with
    ``open_fs('sitedata://appname:author:version')``.

    site_data_dirNr5   r   r   r   r   r
      r6   r
   c                   @   r3   )r   zA filesystem for application config data.

    May also be opened with
    ``open_fs('siteconf://appname:author:version')``.

    site_config_dirNr5   r   r   r   r   r      r6   r   c                   @   r3   )r   zA filesystem for per-user application log data.

    May also be opened with
    ``open_fs('userlog://appname:author:version')``.

    user_log_dirNr5   r   r   r   r   r      r6   r   )r    typingr   sixappdirsr   _reprr   osfsr   TYPE_CHECKINGr   r   __all__r   r   add_metaclassr"   r   r	   r   r
   r   r   r   r   r   r   <module>   s&    
6