
    li2:                     b    d dl Z d dlmZ d dlmZmZmZmZmZ ddl	m
Z
mZ  G d de
          ZdS )    N)OrderedDict)DictLiteralOptionalSequenceUnion   )BaseProviderElementsTypec                      e Zd ZU dZdZee         ed<   dZee         ed<   dZ	ee         ed<   dZ
ee         ed	<   d
Zee         ed<   dZee         ed<   dZee         ed<   dZee         ed<    edefdefde	fde
fdefdefdefdeff          Zeeee         f         ed<   dZee         ed<   dZee         ed<   dZee         ed <   d!Zee         ed"<   d#Zee         ed$<    edefdefd%efdefdeff          Zeeee         f         ed&<   d'd(d)d*d*d)d+Zeeef         ed,<   d-Zee         ed.<   dAd0ee         d1efd2ZdBd0ee         d3ee         d1efd4ZdAd0ee         d1efd5Z	 	 	 	 	 dCd9ed0ee         d3eeee e         f                  d:ee!         d;e"d<         d1efd=Z#dAd>ee         d1efd?Z$dAd>ee         d1efd@Z%d/S )DProviderz*Implement default file provider for Faker.)zapplication/atom+xmlzapplication/ecmascriptzapplication/EDI-X12zapplication/EDIFACTzapplication/jsonzapplication/javascriptzapplication/octet-streamzapplication/oggzapplication/pdfzapplication/postscriptzapplication/rdf+xmlzapplication/rss+xmlzapplication/soap+xmlzapplication/font-woffzapplication/xhtml+xmlzapplication/xml-dtdzapplication/xop+xmlzapplication/zipzapplication/gzipapplication_mime_types)	zaudio/basicz	audio/L24z	audio/mp4z
audio/mpegz	audio/oggzaudio/vorbiszaudio/vnd.rn-realaudiozaudio/vnd.wavez
audio/webmaudio_mime_types)z	image/gifz
image/jpegzimage/pjpegz	image/pngzimage/svg+xmlz
image/tiffzimage/vnd.microsoft.iconimage_mime_types)zmessage/httpzmessage/imdn+xmlzmessage/partialzmessage/rfc822message_mime_types)zmodel/examplez
model/igesz
model/meshz
model/vrmlzmodel/x3d+binaryzmodel/x3d+vrmlzmodel/x3d+xmlmodel_mime_types)zmultipart/mixedzmultipart/alternativezmultipart/relatedzmultipart/form-datazmultipart/signedzmultipart/encryptedmultipart_mime_types)ztext/cmdztext/cssztext/csvz	text/htmlztext/javascriptz
text/plainz
text/vcardztext/xmltext_mime_types)z
video/mpegz	video/mp4z	video/oggzvideo/quicktimez
video/webmzvideo/x-matroskazvideo/x-ms-wmvzvideo/x-flvvideo_mime_typesapplicationaudioimagemessagemodel	multiparttextvideo
mime_types)flacmp3wavaudio_file_extensions)bmpgifjpegjpgpngtiffimage_file_extensions)csscsvhtmljsjsontxttext_file_extensions)mp4avimovwebmvideo_file_extensions)docdocxxlsxlsxpptpptxodtodsodppagesnumberskeypdfoffice_file_extensionsofficefile_extensionszC:\\)root	separator/)windowslinuxfile_systems_path_rules)sdvdxvdunix_device_prefixesNcategoryreturnc                     |r|n8|                      t          | j                                                            }|                      | j        |                   S )as  Generate a mime type under the specified ``category``.

        If ``category`` is ``None``, a random category will be used. The list of
        valid categories include ``'application'``, ``'audio'``, ``'image'``,
        ``'message'``, ``'model'``, ``'multipart'``, ``'text'``, and
        ``'video'``.

        :sample:
        :sample: category='application'
        )random_elementlistr   keysselfrQ   s     m/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/faker/providers/file/__init__.py	mime_typezProvider.mime_type   sQ      (^88T-@-@doFZFZF\F\A]A]-^-^""4?8#<===    	extensionc                 x    ||                      |          }| j                                        }|r| d| n|S )a  Generate a random file name with extension.

        If ``extension`` is ``None``, a random extension will be created
        under the hood using |file_extension| with the specified
        ``category``. If a value for ``extension`` is provided, the
        value will be used instead, and ``category`` will be ignored.
        The actual name part itself is generated using |word|. If
        extension is an empty string then no extension will be added,
        and file_name will be the same as |word|.

        :sample: size=10
        :sample: category='audio'
        :sample: extension='abcdef'
        :sample: category='audio', extension='abcdef'
        :sample: extension=''
        N.)file_extension	generatorword)rX   rQ   r\   filenames       rY   	file_namezProvider.file_name   sN    " ++H55I++--,5C(((Y(((8Cr[   c                     |9|                      t          | j                                                            }|                      | j        |                   S )a9  Generate a file extension under the specified ``category``.

        If ``category`` is ``None``, a random category will be used. The list of
        valid categories include: ``'audio'``, ``'image'``, ``'office'``,
        ``'text'``, and ``'video'``.

        :sample:
        :sample: category='image'
        )rT   rU   rE   rV   rW   s     rY   r_   zProvider.file_extension  sP     **40D0I0I0K0K+L+LMMH""4#7#ABBBr[      TrK   depthabsolutefile_system_rule)rK   rJ   c                    |<t          |t                    s't          |          r|                     |          }nd}| j                            |d          }|st          d          |d         }|d         }|                     ||          }	t          d|          D ]!}
| j	        
                                 | |	 }	"|r||	z   n|	S )a  Generate an pathname to a file.

        This method uses |file_name| under the hood to generate the file
        name itself, and ``depth`` controls the depth of the directory
        path, and |word| is used under the hood to generate the
        different directory names.

        If ``absolute`` is ``True`` (default), the generated path starts
        with ``/`` and is absolute. Otherwise, the generated path is
        relative.

        If used, ``extension`` can be either a string, forcing that
        extension, a sequence of strings (one will be picked at random),
        or an empty sequence (the path will have no extension). Default
        behaviour is the same as |file_name|

        if ``file_system`` is set (default="linux"), the generated path uses
        specified file system path standard, the list of valid file systems include:
        ``'windows'``, ``'linux'``.

        :sample: size=10
        :sample: depth=3
        :sample: depth=5, category='video'
        :sample: depth=5, category='video', extension='abcdef'
        :sample: extension=[]
        :sample: extension=''
        :sample: extension=["a", "bc", "def"]
        :sample: depth=5, category='video', extension='abcdef', file_system='windows'
        N z!Specified file system is invalid.rG   rH   r   )
isinstancestrlenrT   rL   get	TypeErrorrc   ranger`   ra   )rX   rf   rQ   r\   rg   rh   fs_rulerG   	seperatorpath_s              rY   	file_pathzProvider.file_path  s    L  Is)C)C 9~~  //	::			.223CTJJ 	A?@@@vK(	NN8Y77q% 	? 	?An))++>Y>>>DD&0td{{D0r[   prefixc                     ||                      | j                  }|                      t          j                  }d| | }|S )zGenerate a Unix device file name.

        If ``prefix`` is ``None``, a random prefix will be used. The list of
        valid prefixes include: ``'sd'``, ``'vd'``, and ``'xvd'``.

        :sample:
        :sample: prefix='mmcblk'
        Nz/dev/)rT   rP   stringascii_lowercase)rX   rv   suffixrs   s       rY   unix_devicezProvider.unix_deviceH  sL     >(()BCCF))&*@AA'v'v''r[   c                 z    |                      |          }|t          |                                           z  }|S )zGenerate a Unix partition name.

        This method uses |unix_device| under the hood to create a device file
        name with the specified ``prefix``.

        :sample:
        :sample: prefix='mmcblk'
        )rv   )r{   rl   random_digit)rX   rv   rs   s      rY   unix_partitionzProvider.unix_partitionW  s=     $$F$33D%%''(((r[   )N)NN)re   NNTrK   )&__name__
__module____qualname____doc__r   r   rl   __annotations__r   r   r   r   r   r   r   r   r   r   r"   r)   r0   r5   rC   rE   rL   rP   r   rZ   rc   r_   intr   r   boolr   ru   r{   r~    r[   rY   r   r   	   sb        44&1L- & & &P+l3'   +l3'   -S)   
+l3' 
 
 
/,s+   *O\#&    
+l3' 
 
 
 0;{23&'&'*+&'./_%&'		
0 0JS,s++,   0<,   0<,   /,s+   0<,   1L-     5@K+,+,-.)*+,	
5 5OT#|C001    
 

 
 
	0 	0T#t)_ 	 	 	 /B,s+AAA> >(3- >3 > > > >D D(3- D8C= D\_ D D D D,C Cx} C C C C C  "&9=#'8?71 7171 3-71 E#x}"456	71
 4.71 ""4571 
71 71 71 71r (3- 3     Xc] c      r[   r   )rx   collectionsr   typingr   r   r   r   r   rj   r
   r   r   r   r[   rY   <module>r      s     # # # # # # ; ; ; ; ; ; ; ; ; ; ; ; ; ; ) ) ) ) ) ) ) )Y Y Y Y Y| Y Y Y Y Yr[   