o
    3gm                     @  s@   d dl mZ d dlZG dd dZedZdd Zdd	 ZdS )
    )annotationsNc                   @  s    e Zd ZdZdd Zdd ZdS )
MountEntryzR
    Represents a mount entry (device file, mount point and file system type)
    c                 C  s"   || _ || _|| _|d| _d S )N,)devpointfstypesplitoptions)selfr   r   r   r	    r   I/home/garg/my-data/venv/lib/python3.10/site-packages/plumbum/fs/mounts.py__init__   s   zMountEntry.__init__c                 C  s.   d | j}| j d| j d| j d| dS )Nr   z on z type z ())joinr	   r   r   r   )r
   r	   r   r   r   __str__   s   "zMountEntry.__str__N)__name__
__module____qualname____doc__r   r   r   r   r   r   r      s    r   z2(.+?)\s+on\s+(.+?)\s+type\s+(\S+)(?:\s+\((.+?)\))?c                  C  sF   ddl m}  g }|   D ]}t|}|sq|t|   q|S )zsreturns the system's current mount table (a list of
    :class:`MountEntry <plumbum.unixutils.MountEntry>` objects)r   )mount)plumbum.cmdr   
splitlinesMOUNT_PATTERNmatchappendr   groups)r   tablelinemr   r   r   mount_table   s   
r   c                   s   t  fddt D S )z_
    Indicates if a the given filesystem (device file or mount point) is currently mounted
    c                 3  s     | ]} |j |jhv V  qd S )N)r   r   ).0entryfsr   r   	<genexpr>+   s    zmounted.<locals>.<genexpr>)anyr   r"   r   r"   r   mounted'   s   r&   )
__future__r   rer   compiler   r   r&   r   r   r   r   <module>   s    
