
    vj                          G d  d      Z y)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y)
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| _        ||j                  d      | _         |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        t        | j                  t              r!dj                  | j                        | _        yyy)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     B/DATA/.local/lib/python3.12/site-packages/trame/app/file_upload.py__init__zClientFile.__init__	   s    


*,008DJ,008DJ,00@DJ155f=DO/33I>DM$--. # 7 / +r
   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        zz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                 T    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*     		{)DII;j@PQQr
   )N)__name__
__module____qualname____doc__r   propertyr   r   r   r    r"   r	   r%    r
   r   r   r      s    8  % %           R Rr
   r   N)r   r+   r
   r   <module>r,      s   9R 9Rr
   