
    ,j                           G d  d          Z dS )c                       e Zd ZdZddZed             Zed             Zed             Zed             Z	ed             Z
ed	             Zed
             ZdS )
ClientFilez
    Helper class that make it easier to handle file from the trame state

    This class behave like a decorator to the state variable so you can
    easily access its various properties and content.
    Nc                    d| _         d| _        d| _        d| _        d| _        ||                    d          | _         |                    d          | _        |                    d          | _        |                    d          | _        |                    d          | _        t          | j        t                    r#d                    | j                  | _        dS dS dS )z3Pass the state variable you want to decorate as argNnamesizelastModifiedtypecontent    )	_name_size_time
_mime_type_contentget
isinstancelistjoin)selffile_state_variables     O/DATA/AppData/hermes/venv/lib/python3.11/site-packages/trame/app/file_upload.py__init__zClientFile.__init__	   s    


*,0088DJ,0088DJ,00@@DJ155f==DO/33I>>DM$-.. 8 # 7 7 +*8 8r
   c                     | j         du S )z Return true if the file is emptyNr   r   s    r   is_emptyzClientFile.is_empty   s     }$$r
   c                     | j         S )z	File name)r   r   s    r   r   zClientFile.name        zr
   c                     | j         S )zFile size in Bytes)r   r   s    r   r   zClientFile.size#   r   r
   c                     | j         S )zModified time)r   r   s    r   modified_timezClientFile.modified_time(   r   r
   c                     | j         S )zMime type of the file)r   r   s    r   	mime_typezClientFile.mime_type-   s     r
   c                     | j         S )zBytes content of the filer   r   s    r   r	   zClientFile.content2   s     }r
   c                 6    d| j          d| j         d| j         S )z0Return a string summarizing the file informationzFile: z	 of size z
 and type )r   r   r"   r   s    r   infozClientFile.info7   s)     R	QQDIQQQQQr
   )N)__name__
__module____qualname____doc__r   propertyr   r   r   r    r"   r	   r%    r
   r   r   r      s         8 8 8 8  % % X%   X   X   X   X   X R R XR R Rr
   r   N)r   r+   r
   r   <module>r,      sA   9R 9R 9R 9R 9R 9R 9R 9R 9R 9Rr
   