§ 1jNÇãó—dZddlZddlZddlZddlZddlZddlmZmZddl m Z ddl m Z m Z mZmZmZmZmZmZmZmZmZmZmZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(erddl)m*Z*ej+Z,ed Z-ed Z.Gd „d e/¦«Z0Gd „d¦«Z1Gd„de1¦«Z2Gd„de1¦«Z3Gd„de1¦«Z4Gd„de4¦«Z5Gd„d¦«Z6Gd„d¦«Z7Gd„d¦«Z8Gd„d¦«Z9dS)z0Fake implementations for different file objects.éN)ÚS_IFREGÚS_IFDIR)Ú TracebackType) ÚListÚOptionalÚCallableÚUnionÚAnyÚDictÚcastÚAnyStrÚNoReturnÚIteratorÚTextIOÚTypeÚ TYPE_CHECKING)Úhelpers) ÚFakeStatResultÚBinaryBufferIOÚ TextBufferIOÚ is_int_typeÚis_unicode_stringÚ to_stringÚmatching_stringÚ real_encodingÚAnyPathÚ AnyStringÚget_locale_encodingÚ _OpenModesÚis_root)ÚFakeFilesystem)ÚFakeFileWrapperÚFakeDirWrapperÚStandardStreamWrapperÚFakePipeWrapper)ÚFakeFileÚ FakeDirectorycó,‡—eZdZdZdeddfˆfd„ ZˆxZS)ÚFakeLargeFileIoExceptionz|Exception thrown on unsupported operations for fake large files. Fake large files have a size with no real content. Ú file_pathÚreturnNcóP•—t¦« d|z¦«dS)Nz?Read and write operations not supported for fake large file: %s)ÚsuperÚ__init__)Úselfr*Ú __class__s €úd/builddir/build/BUILD/cloudlinux-venv-1.0.11/venv/lib/python3.11/site-packages/pyfakefs/fake_file.pyr.z!FakeLargeFileIoException.__init__Qs6ø€Ý ‰Œ×Òð "Ø$-ñ .ñ ô ð ð ð ó)Ú__name__Ú __module__Ú __qualname__Ú__doc__Ústrr.Ú __classcell__©r0s@r1r)r)LsUø€€€€€ððð  #ð ¨$ð ð ð ð ð ð ð ð ð ð r2r)cóH‡—eZdZdZdZeejzddddddfdede de ede dd e e d e e d e e dgdfd e e fd „Zede efd„¦«Zede e fd„¦«Zedefd„¦«Zejdeddfd„¦«Zedefd„¦«Zejdeddfd„¦«Zedefd„¦«Zejdeddfd„¦«Zde ddfd„Zde ddfd„Zdefd„Zdee edfde efd„Zdedefd„Zd-ded e e defd„Zede fd „¦«Z e jde ddfd!„¦«Z edefd"„¦«Z!e"j#d#kredefd$„¦«Z$d%e de%fˆfd&„ Z&d'e d(e%ddfˆfd)„ Z'de fd*„Z(d+e defd,„Z)ˆxZ*S).r&a�Provides the appearance of a real file. Attributes currently faked out: * `st_mode`: user-specified, otherwise S_IFREG * `st_ctime`: the time.time() timestamp of the file change time (updated each time a file's attributes is modified). * `st_atime`: the time.time() timestamp when the file was last accessed. * `st_mtime`: the time.time() timestamp when the file was last modified. * `st_size`: the size of the file * `st_nlink`: the number of hard links to the file * `st_ino`: the inode number - a unique number identifying the file * `st_dev`: a unique number identifying the (fake) file system device the file belongs to * `st_uid`: always set to USER_ID, which can be changed globally using `set_uid` * `st_gid`: always set to GROUP_ID, which can be changed globally using `set_gid` .. note:: The resolution for `st_ctime`, `st_mtime` and `st_atime` in the real file system depends on the used file system (for example it is only 1s for HFS+ and older Linux file systems, but much higher for ext4 and NTFS). This is currently ignored by pyfakefs, which uses the resolution of `time.time()`. Under Windows, `st_atime` is not updated for performance reasons by default. pyfakefs never updates `st_atime` under Windows, assuming the default setting. ) Úst_modeÚst_inoÚst_devÚst_nlinkÚst_uidÚst_gidÚst_sizeÚst_atimeÚst_mtimeÚst_ctimeÚ st_atime_nsÚ st_mtime_nsÚ st_ctime_nsNÚnamer;ÚcontentsÚ filesystemr!ÚencodingÚerrorsÚ side_effectÚ open_modesc ó>—|€td¦«‚||_||_||_t |jt j¦«t j¦«t j ¦«¦«|_ |dz dkr |tz}||j _ d|_ t|¦«|_|pd|_| |¦«|_|j�t'|j¦«nd|j _ d|_d|_i|_d|_||_dS)aY Args: name: Name of the file/directory, without parent path information st_mode: The stat.S_IF* constant representing the file type (i.e. stat.S_IFREG, stat.S_IFDIR), and the file permissions. If no file type is set (e.g. permission flags only), a regular file type is assumed. contents: The contents of the filesystem object; should be a string or byte object for regular files, and a dict of other FakeFile or FakeDirectory objects with the file names as keys for FakeDirectory objects filesystem: The fake filesystem where the file is created. encoding: If contents is a unicode string, the encoding used for serialization. errors: The error mode used for encoding/decoding errors. side_effect: function handle that is executed when file is written, must accept the file object as an argument. open_modes: The modes the file was opened with (e.g. can read, write etc.) Nzfilesystem shall not be Noneé rÚstrictÚ)Ú ValueErrorrJÚ _side_effectrHrÚ is_windows_fsrÚget_uidÚget_gidÚnowÚ stat_resultrr;rArrKrLÚ_encode_contentsÚ_byte_contentsÚlenÚepochÚ parent_dirÚxattrÚ opened_asrN) r/rHr;rIrJrKrLrMrNs r1r.zFakeFile.__init__†s€ð> Ð ÝÐ;Ñ<Ô<Ð <Ø,6ˆŒØ0;ˆÔØ ˆŒ Ý)Ø Ô $Ý ŒOÑ Ô Ý ŒOÑ Ô Ý ŒK‰MŒMñ  ô ˆÔð �b‰=˜AÒ Ð Ø •wÑ ˆGØ#*ˆÔÔ ØˆŒ Ý'4°XÑ'>Ô'>ˆŒ Ø!Ð- XˆŒ Ø/3×/DÒ/DÀXÑ/NÔ/NˆÔà(,Ô(;Ð(G�C�Ô#Ñ $Ô $Ð $ÈQð ÔÔ ðˆŒ Ø37ˆŒàˆŒ Ø$&ˆŒØ$ˆŒˆˆr2r+có—|jS)z&Return the contents as raw byte array.©r[©r/s r1Ú byte_contentszFakeFile.byte_contentsÁs €ðÔ"Ð"r2có¢—t|jt¦«r4|j |jp t ¦«|j¬¦«SdS)z9Return the contents as string with the original encoding.)rLN)Ú isinstancerdÚbytesÚdecoderKrrLrcs r1rIzFakeFile.contentsÆsV€õ �dÔ(­%Ñ 0Ô 0ð ØÔ%×,Ò,Ø” Ð6Õ!4Ñ!6Ô!6Ø”{ð-ñôð ðˆtr2có—|jjS)z*Return the creation time of the fake file.©rYrDrcs r1rDzFakeFile.st_ctimeÐó€ðÔÔ(Ð(r2Úvalcó—||j_dS)z'Set the creation time of the fake file.Nrj©r/rls r1rDzFakeFile.st_ctimeÕó€ð%(ˆÔÔ!Ð!Ð!r2có—|jjS)z(Return the access time of the fake file.©rYrBrcs r1rBzFakeFile.st_atimeÚrkr2có—||j_dS)z%Set the access time of the fake file.Nrqrns r1rBzFakeFile.st_atimeßror2có—|jjS)z.Return the modification time of the fake file.©rYrCrcs r1rCzFakeFile.st_mtimeärkr2có—||j_dS)z+Set the modification time of the fake file.Nrtrns r1rCzFakeFile.st_mtimeéror2rAcó—| |¦«|jrd|_|jr&|j ||j|j¦«||_d|_dS)a"Sets the self.st_size attribute and replaces self.content with `None`. Provided specifically to simulate very large files without regards to their content (which wouldn't fit in memory). Note that read/write operations with such a file raise :py:class:`FakeLargeFileIoException`. Args: st_size: (int) The desired file size Raises: OSError: if ``st_size`` is not a non-negative integer, or if ``st_size`` exceeds the available file system space rN)Ú_check_positive_intrAÚsizerJÚchange_disk_usagerHr=r[©r/rAs r1Úset_large_file_sizezFakeFile.set_large_file_sizeîsg€ð × Ò  Ñ)Ô)Ð)Ø Œ<ð ØˆDŒIØ Œ?ð OØ ŒO× -Ò -¨g°t´yÀ$Ä+Ñ NÔ NÐ N؈Œ Ø"ˆÔÐÐr2rxcóˆ—t|¦«r|dkr,|j tj|j¦«dSdS©Nr)rrJÚraise_os_errorÚerrnoÚENOSPCrH)r/rxs r1rwzFakeFile._check_positive_intsD€å˜4Ñ Ô ð D D¨1¢H HØ ŒO× *Ò *­5¬<¸¼Ñ CÔ CÐ CÐ CÐ Cð%- Hr2có—|jduS)zVReturn `True` if this file was initialized with size but no contents. Nrbrcs r1Ú is_large_filezFakeFile.is_large_file s€ðÔ" dÐ*Ð*r2có—t|¦«r�øà—x’x ‘”ˆHØŒ×*Ò*¨8Ñ4Ô4Ð4r2)érPcó@—|j |j¦«Sr„)rJÚ isjunctionrœrcs r1Ú is_junctionzFakeFile.is_junction�s€à”?×-Ò-¨d¬iÑ8Ô8Ð 8r2Úitemcó‚•—||jvrt|j|¦«St¦« |¦«S©z'Forward some properties to stat_result.)Ú stat_typesÚgetattrrYr-Ú__getattribute__)r/r¡r0s €r1Ú __getattr__zFakeFile.__getattr__…s;ø€à �4”?Ð "Ð "ݘ4Ô+¨TÑ2Ô2Ð 2݉wŒw×'Ò'¨Ñ-Ô-Ð-r2ÚkeyÚvaluec󆕗||jvrt|j||¦«St¦« ||¦«Sr£)r¤ÚsetattrrYr-Ú __setattr__)r/r¨r©r0s €r1r¬zFakeFile.__setattr__‹s?ø€à �$”/Ð !Ð !ݘ4Ô+¨S°%Ñ8Ô8Ð 8݉wŒw×"Ò" 3¨Ñ.Ô.Ð.r2có(—|j›d|jd›d�S)Nú(Úoú))rHr;rcs r1Ú__str__zFakeFile.__str__‘s €Ø”)Ð1Ð1 ¤ Ð1Ð1Ð1Ð1Ð1r2Úpermission_bitscóò—tj¦«|jjkr|j|z|kStj¦«|jjkr|j|dz z|dz kS|j|dz z|dz kS)aChecks if the given permissions are set in the fake file. Args: permission_bits: The permission bits as set for the user. Returns: `True` if the permissions are set in the correct class (user/group/other). r�é)rrVrYr?r;rWr@)r/r²s r1Úhas_permissionzFakeFile.has_permission”s€€õ Œ?Ñ Ô  Ô 0Ô 7Ò 7Ð 7Ø”< /Ñ1°_ÒDÐ DÝ Œ?Ñ Ô  Ô 0Ô 7Ò 7Ð 7Ø”< ?°aÑ#7Ñ8¸OÈqÑBØ+/ð9%ð9%àð9%ðð9%ð˜6Ô"ð 9%ð Ð-Ô.ð 9%ð ˜3”-ð 9%𘔠ð9%ð˜h¨  |°TÐ'9Ô:Ô;ð9%ð˜ZÔ(ð9%ð9%ð9%ð9%ðvð#˜x¨œð#ð#ð#ñ„Xð#ðð˜( 3œ-ðððñ„Xððð)˜%ð)ð)ð)ñ„Xð)ð„_ð(˜Eð( dð(ð(ð(ñ„_ð(ðð)˜%ð)ð)ð)ñ„Xð)ð„_ð(˜Eð( dð(ð(ð(ñ„_ð(ðð)˜%ð)ð)ð)ñ„Xð)ð„_ð(˜Eð( dð(ð(ð(ñ„_ð(ð#¨3ð#°4ð#ð#ð#ð#ð.D¨ðD°ðDðDðDðDð +˜tð+ð+ð+ð+ð %¨¨s°E¸4Ð/?Ô)@ð%ÀXÈeÄ_ð%ð%ð%ð%ð¨Vð¸ððððð6ð Vð°xÀ´}ðÐPTððððð.ð�cðððñ„Xðð „[ð˜Cð Dðððñ„[ðð2ð5�fð5ð5ð5ñ„Xð5ð( Ô˜7Ò"Ð"à ð 9 ð 9ð 9ð 9ñ Œð 9ð. ð.¨ð.ð.ð.ð.ð.ð.ð /˜sð/¨3ð/°4ð/ð/ð/ð/ð/ð/ð 2˜ð2ð2ð2ð2ð M¨cð M°dð Mð Mð Mð Mð Mð Mð Mð Mr2r&cóL‡—eZdZd ˆfd„ Zedefd„¦«Zdedefd„Z ˆxZ S) Ú FakeNullFilerJr!r+NcóZ•—t¦« |j|d¬¦«dS)NrR)rJrI)r-r.Údevnull)r/rJr0s €r1r.zFakeNullFile.__init__¥s+ø€Ý ‰Œ×Ò˜Ô+¸ ÈRÐÑPÔPÐPÐPÐPr2có—dS)Nr2©rcs r1rdzFakeNullFile.byte_contents¨s€àˆsr2rIcó—dS)NFrÃr…s r1rŠz!FakeNullFile.set_initial_contents¬s€Øˆur2)rJr!r+N) r3r4r5r.r¸rgrdr r»rŠr8r9s@r1r¿r¿¤sŒø€€€€€ðQðQðQðQðQðQðð˜uðððñ„Xðð¨Vð¸ððððððððr2r¿c ó~‡—eZdZdZ d dedddeeddfˆfd„ Zedee fd „¦«Z d ˆfd „ Z d „Z ˆxZ S) ÚFakeFileFromRealFileztRepresents a fake file copied from the real file system. The contents of the file are read on demand only. Nr*rJr!rMr+c󘕗t¦« tj |¦«||¬¦«d|_dS)a3 Args: file_path: Path to the existing file. filesystem: The fake filesystem where the file is created. Raises: OSError: if the file does not exist in the real file system. OSError: if the file already exists in the fake file system. )rHrJrMFN)r-r.ÚosrœÚbasenameÚ contents_read)r/r*rJrMr0s €r1r.zFakeFileFromRealFile.__init__¶sOø€õ ‰Œ×ÒÝ”×!Ò! )Ñ,Ô,Ø!Ø#ð ñ ô ð ð #ˆÔÐÐr2cóþ—|jsMd|_t|jd¦«5}| ¦«|_ddd¦«n #1swxYwYt j|j¦«j|_|jS)NTÚrb)rÊÚio_openr*Úreadr[rÈÚstatrB)r/Úfs r1rdz"FakeFileFromRealFile.byte_contentsÌsª€àÔ!ð /Ø!%ˆDÔ Ý˜œ¨Ñ.Ô.ð /°!Ø&'§f¢f¡h¤h�Ô#ð /ð /ð /ñ /ô /ð /ð /ð /ð /ð /ð /øøøð /ð /ð /ð /õœ ¤Ñ/Ô/Ô8ˆŒ ØÔ"Ð"s¤A Á AÁAcóZ•—d|_t¦« ||¦«dS©NT)rÊr-rŒ)r/rIrKr0s €r1rŒz!FakeFileFromRealFile.set_contentsÖs+ø€Ø!ˆÔÝ ‰Œ×Ò˜X xÑ0Ô0Ð0Ð0Ð0r2có—dS)zThe contents are never faked.FrÃrcs r1r‚z"FakeFileFromRealFile.is_large_fileÚó€àˆur2r„)r3r4r5r6r7rrr.r¸rgrdrŒr‚r8r9s@r1rÆrưsÔø€€€€€ððð+/ð #ð#àð#ð%ð#ð˜hÔ'ð #ð ð #ð#ð#ð#ð#ð#ð,ð#˜x¨œð#ð#ð#ñ„Xð#ð1ð1ð1ð1ð1ð1ðððððððr2rÆcój‡—eZdZdZejdfdedededfd„Z dde d eed e fd „Z e d eeeffd „¦«Ze d eefd „¦«Zded dfd„Zded efd„Zded efd„Zddede d dfd„Ze d efd„¦«Zejded dfd„¦«Zddd e fd„Zd efˆfd„ ZˆxZS)r'z,Provides the appearance of a real directory.NrHÚ perm_bitsrJr!có‚—t ||t|zd|¬¦«|xjdz c_i|_dS)a Args: name: name of the file/directory, without parent path information perm_bits: permission bits. defaults to 0o777. filesystem: if set, the fake filesystem where the directory is created rR)rJr‡N)r&r.rr>Ú_entries)r/rHrÖrJs r1r.zFakeDirectory.__init__âsE€õ ×Ò˜$ ¥g° Ñ&9¸2È*ÐÑUÔUÐUð ˆ Œ ˜Ñˆ Œ Ø,.ˆŒ ˆ ˆ r2rIrKr+cóV—|j tj|j¦«‚r„©rJr~rÚEISDIRrœ)r/rIrKs r1rŒzFakeDirectory.set_contentsõs€ØŒo×,Ò,­U¬\¸4¼9ÑEÔEÐEr2có—|jS)z/Return the list of contained directory entries.)rØrcs r1ÚentrieszFakeDirectory.entriesøs €ðŒ}Ðr2cóh—d„t|j ¦«d„¬¦«D¦«S)z^Return the list of contained directory entry names ordered by creation order. có—g|] }|d‘Œ S©rréÚ.0r¡s r1ú z.FakeDirectory.ordered_dirs..s,€ð ð ð àð �ŒGð ð ð r2có—|djS)Nr‡)r<)Úentrys r1úz,FakeDirectory.ordered_dirs..s €ÈÈaÌÌ€r2)r¨)ÚsortedrØÚitemsrcs r1Ú ordered_dirszFakeDirectory.ordered_dirsýsB€ð  ð å˜tœ}×2Ò2Ñ4Ô4Ð:WÐ:WÐXÑXÔXð ñ ô ð r2Ú path_objectcó¨—tj¦«sU|jjsI| tj¦«s*|j tj|j ¦«t|j ¦«}||j vr*|j tj |j ¦«||j|<||_|j€&|jxjdz c_|jj|_|xjdz c_|xjdz c_|j|_|jdkr-|j |j|j |j¦«dSdS)a5Adds a child FakeFile to this directory. Args: path_object: FakeFile instance to add as a child of this directory. Raises: OSError: if the directory has no write permission (Posix only) OSError: if the file or directory to be added already exists Nr‡)rr rJrUrµÚ PERM_WRITEr~rÚEACCESrœrrHrÝÚEEXISTrØr^r<Úlast_inor>r=ryrx)r/rêÚpath_object_names r1Ú add_entryzFakeDirectory.add_entrysO€õ”Ñ!Ô!ð Dà”OÔ1ð Dð×'Ò'­Ô(:Ñ;Ô;ð Dð ŒO× *Ò *­5¬<¸¼Ñ CÔ CÐ Cå )¨+Ô*:Ñ ;Ô ;ÐØ ˜tœ|Ð +Ð +Ø ŒO× *Ò *­5¬<¸¼Ñ CÔ CÐ Cà*5ˆŒ Ð&Ñ'Ø!%ˆ ÔØ Ô Ð %Ø ŒOÐ $Ô $¨Ñ )Ð $Ô $Ø!%¤Ô!9ˆKÔ Ø ˆ Œ ˜Ñˆ Œ ØÐÔ Ñ!ÐÔØ!œ[ˆ ÔØ Ô  1Ò $Ð $Ø ŒO× -Ò -ØÔ  +Ô"2°D´Kñ ô ð ð ð ð %Ð $r2Ú pathname_namecó`—| |¦«}|jt|¦«S)a)Retrieves the specified child file or directory entry. Args: pathname_name: The basename of the child object to retrieve. Returns: The fake file or directory object. Raises: KeyError: if no child exists by the specified name. )Ú_normalized_entrynamerÝr)r/ròs r1Ú get_entryzFakeDirectory.get_entry)s,€ð×2Ò2°=ÑAÔAˆ ØŒ|�I mÑ4Ô4Ô5Ð5r2cóZ‡—|jjsˆfd„|jD¦«}|r|dЉS)Ncóh•—g|].}| ¦«‰ ¦«k¯,|‘Œ/SrÃ)Úlower)rârHròs €r1rãz7FakeDirectory._normalized_entryname..:s>ø€ðððØ°·²±´À×ATÒATÑAVÔAVÒ1VÐ1V�Ð1VÐ1VÐ1Vr2r)rJÚis_case_sensitiverÝ)r/ròÚmatching_namess ` r1rôz#FakeDirectory._normalized_entryname8sTø€ØŒÔ0ð 2ððððØ!%¤ðñôˆNðð 2Ø .¨qÔ 1� ØÐr2TÚ recursivecó—| |¦«}| |¦«}|jj�r"t ¦«s=|jt jzdkr%|j tj |¦«|j  |¦«r¼d}tj dkrƒttd¦«sntjd¬¦«}t"jdkr%|dj dkr|djd krd }n$|dj d kr|djd krd }|r%|j tj |¦«ndt j¦«sQ| t jt jz¦«s%|j tj |¦«|rQt-|t.¦«r<|jr4| t5|j¦«d¦«|j°4n2|jd kr'|j |j ||j¦«|xjd zc_|xjd zc_|jdksJ‚|jt?|¦«=d S)a(Removes the specified child file or directory. Args: pathname_name: Basename of the child object to remove. recursive: If `True` (default), the entries in contained directories are deleted first. Used to propagate removal errors (e.g. permission problems) from contained entries. Raises: KeyError: if no child exists by the specified name. OSError: if user lacks permission to delete the file, or (Windows only) the file is open. rTÚposixÚ O_TMPFILEr´)Úlimit)r�é Ú TemporaryFilez_os.unlink(name)FÚopenerr‡N) rôrõrJrUr r;rrìr~rríÚ has_open_filerÈrHÚhasattrÚ tracebackÚ extract_stackr¼r½ÚlinerµÚPERM_EXErfr'rÝÚ remove_entryÚlistr>ryrxr=r)r/ròrûråÚ raise_errorÚsts r1r zFakeDirectory.remove_entryAsd€ð×2Ò2°=ÑAÔAˆ Ø—’˜}Ñ-Ô-ˆØ Œ?Ô (ñ LÝ‘9”9ð L ¤µÔ1CÑ!CÀqÒ!HÐ!HØ”×.Ò.­u¬|¸]ÑKÔKÐKØŒ×,Ò,¨UÑ3Ô3ð PØ"� Ý”7˜gÒ%Ð%­gµb¸+Ñ.FÔ.FÐ%õ#Ô0°qÐ9Ñ9Ô9�BÝÔ'¨'Ò1Ð1à˜qœEœJ¨/Ò9Ð9Ø " 1¤¤ Ð.@Ò @Ð @à*/˜Køð˜aœ5œ:¨Ò1Ð1°b¸´e´jÐDVÒ6VÐ6VØ*/˜KØðPØ”O×2Ò2µ5´<ÀÑOÔOÐOøå”?Ñ$Ô$ð L¨T×-@Ò-@ÝÔ"¥WÔ%5Ñ5ñ.ô.ð Lð”×.Ò.­u¬|¸]ÑKÔKÐKà ð X� E­=Ñ9Ô9ð XØ”-ð ;Ø×"Ò"¥4¨¬ Ñ#6Ô#6°qÔ#9Ñ:Ô:Ð:ð”-ð ;øà Œ^˜qÒ Ð Ø ŒO× -Ò -¨u¬z¨k¸=È%Ì,Ñ WÔ WÐ Wà ˆ Œ ˜Ñˆ Œ Ø ˆŒ˜!шŒØŒ~ Ò"Ð"Ð"Ð"à ŒL� =Ñ1Ô1Ð 2Ð 2Ð 2r2cób—td„|j ¦«D¦«¦«S)zUReturn the total size of all files contained in this directory tree. có(—g|]}|dj‘ŒS)r‡)rxrás r1rãz&FakeDirectory.size..~s€ÐBÐBÐB T�D˜”G”LÐBÐBÐBr2)ÚsumrÝrèrcs r1rxzFakeDirectory.sizeys/€õ ÐBÐB¨T¬\×-?Ò-?Ñ-AÔ-AÐBÑBÔBÑCÔCÐCr2rAcóV—|j tj|j¦«‚)z-Setting the size is an error for a directory.rÚrzs r1rxzFakeDirectory.size€s €ðŒo×,Ò,­U¬\¸4¼9ÑEÔEÐEr2Ú dir_objectcó0—|}|r||krdS|j}|°dS)zmReturn `True` if dir_object is a direct or indirect parent directory, or if both are the same object.TF)r^)r/rr˜s r1Úhas_parent_objectzFakeDirectory.has_parent_object…s9€ð(,ˆØð !Ø�jÒ Ð Ø�tØ”.ˆCðð !ðˆur2cóê•—t¦« ¦«dz}|jD]F}|j| ¦«}| d¦«D]}|r |dz|zdz}ŒŒG|S)Nz: ú z )r-r±rÝÚsplit)r/Ú descriptionr¡Ú item_descrr0s €r1r±zFakeDirectory.__str__�s�ø€Ý‘g”g—o’oÑ'Ô'¨%Ñ/ˆ Ø”Lð Cð CˆDØœ  TÔ*×2Ò2Ñ4Ô4ˆIØ!Ÿš¨Ñ-Ô-ð Cð C�ØðCØ"-°Ñ"4°tÑ";¸dÑ"B�Køð CðÐr2r„)T)r3r4r5r6rÚPERM_DEFr7r·rr.r r»rŒr¸r r&rÝrrérñÚAnyFilerõrôr rxrºrr±r8r9s@r1r'r'ßs@ø€€€€€Ø6Ð6ð !Ô)Ø15ð /ð/àð/ðð/ðÐ-Ô.ð /ð/ð/ð/ð&FðF VðF°xÀ´}ðFÐPTðFðFðFðFðð˜˜c 8˜mÔ,ðððñ„Xððð ˜d 3œið ð ð ñ„Xð ð  Xð °$ð ð ð ð ðD 6 sð 6¨wð 6ð 6ð 6ð 6ð°3ð¸3ððððð63ð63¨#ð63¸$ð63È$ð63ð63ð63ð63ðpðD�cðDðDðDñ„XðDð  „[ðF˜CðF DðFðFðFñ„[ðFð¨OðÀððððð˜ððððððððððr2r'c 󺇗eZdZdZ ddedddedeefˆfd„ Zed e e e ffd „¦«Z ed e fˆfd „ ¦«Zejd e d dfd „¦«ZˆxZS)ÚFakeDirectoryFromRealDirectoryz~Represents a fake directory copied from the real file system. The contents of the directory are read on demand only. NÚ source_pathrJr!Ú read_onlyÚ target_pathc󌕗|p|}tj|¦«}t¦« t tj |¦«d¦«|j|¬¦«|j|_|j |_ |j |_ |j |_ |j |_ ||_ ||_d|_dS)ao Args: source_path: Full directory path. filesystem: The fake filesystem where the directory is created. read_only: If set, all files under the directory are treated as read-only, e.g. a write access raises an exception; otherwise, writing to the files changes the fake files only as usually. target_path: If given, the target path of the directory, otherwise the target is the same as `source_path`. Raises: OSError: if the directory does not exist in the real file system r‡)rHrÖrJFN)rÈrÏr-r.rrœrr;rDrBrCr@r?rrrÊ)r/rrJrrÚ real_statr0s €r1r.z'FakeDirectoryFromRealDirectory.__init__Ÿs·ø€ð*"Ð0 [ˆ Ý”G˜KÑ(Ô(ˆ Ý ‰Œ×ÒÝ�2œ7Ÿ=š=¨Ñ5Ô5°aÔ8Ñ9Ô9ØÔ'Ø!ð ñ ô ð ð "Ô*ˆŒ Ø!Ô*ˆŒ Ø!Ô*ˆŒ ØÔ&ˆŒ ØÔ&ˆŒ Ø&ˆÔØ"ˆŒØ"ˆÔÐÐr2r+có<—|j�sd|_|j}tj|j¦«D]æ}tj |j|¦«}tj ||¦«}tj |¦«r|j ||¦«Œ‚tj  |¦«r#|j  ||j |¬¦«ŒÄ|j  ||j |¬¦«Œç|j S)z[Return the list of contained directory entries, loading them if not already loaded.T)r)rÊrœrÈÚlistdirrr”ÚislinkrJÚadd_real_symlinkÚisdirÚadd_real_directoryrÚ add_real_filerØ)r/Úbaserårrs r1rÝz&FakeDirectoryFromRealDirectory.entriesÅs€ðÔ!ñ Ø!%ˆDÔ Ø”9ˆDÝœ DÔ$4Ñ5Ô5ð ð �Ý œgŸlšl¨4Ô+;¸UÑCÔC� Ý œgŸlšl¨4°Ñ7Ô7� Ý”7—>’> +Ñ.Ô.ð Ø”O×4Ò4°[À+ÑNÔNÐNÐNÝ”W—]’] ;Ñ/Ô/ðØ”O×6Ò6Ø# T¤^Àð7ñôððð”O×1Ò1Ø# T¤^Àð2ñôðððŒ}Ðr2có<•—|jsdSt¦«jSr})rÊr-rx)r/r0s €r1rxz#FakeDirectoryFromRealDirectory.sizeÛs!ø€ðÔ!ð Ø�1݉wŒwŒ|Ðr2rAcóV—|j tj|j¦«‚r„rÚrzs r1rxz#FakeDirectoryFromRealDirectory.sizeâs€àŒo×,Ò,­U¬\¸4¼9ÑEÔEÐEr2r„)r3r4r5r6rr»rr.r¸r r7r&rÝr·rxrºr8r9s@r1rr™sø€€€€€ððð*.ð $#ð$#àð$#ð%ð$#ðð $#ð ˜gÔ&ð $#ð$#ð$#ð$#ð$#ð$#ðLð˜˜c 8˜mÔ,ðððñ„Xðð*ð�cðððððñ„Xðð  „[ðF˜CðF DðFðFðFñ„[ðFðFðFðFðFr2rcó‚—eZdZdZ d@dedededededd d ee d ed ed ee dee de dededefd„Z dAd„Z dee edeedeeddfd„Zde defd„Zdefd„Zde fd„ZdBd„Zd ee ddfd!„Zedefd"„¦«Zede fd#„¦«Zd$e ddfd%„ZdBd&„ZdBd'„ZdBd(„ZdCd*e d+e ddfd,„Zde fd-„ZdBd.„Z d/e!ddfd0„Z"d1e de#fd2„Z$d1e de#fd3„Z%d1e de#fd4„Z&d5e ddfd6„Z'de#fd7„Z(de fd8„Z)d1e de*fd9„Z+de#fd:„Z,de#fd;„Z-defd<„Z.dBd=„Z/de0e1e e1e!ffd>„Z2d?„Z3dS)Dr"z²Wrapper for a stream object for use by a FakeFile object. If the wrapper has any data written to it, it will propagate to the FakeFile object on close() or flush(). FÚ file_objectr*rNÚ allow_updateÚdelete_on_closerJr!ÚnewlineÚbinaryÚclosefdrKrLÚ bufferingÚraw_ioÚ opened_as_fdÚ is_streamcód—||_||_||_||_| |_|j|_| |_||_||_ ||_ d|_ | |_ |j dkr|std¦«‚|j dks|stj|_ | o| dk|_|j}| p t%¦«|_| pd} |rt)|¦«nt+|| || ¬¦«|_d|_d|_d|_|rt5|¦«|_|jrd|jjs|j d¦«n=|j |j¦«|j ¦«|_|r |s Jd¦«‚||_||_|j |_!d|_"dS) NFrzcan't have unbuffered text I/Oéÿÿÿÿr‡rQ)rKr0rLz(delete_on_close=True requires filesystem)#r-r*rNr.Ú_closefdr]Ú _file_epochr4Ú_binaryr5r6Ú_changedÚ _buffer_sizerSÚioÚDEFAULT_BUFFER_SIZEÚ_use_line_bufferrdrÚ _encodingrrÚ_ioÚ _read_whenceÚ _read_seekÚ _flush_posr\ÚappendÚseekÚtellÚ _filesystemr/r`rHÚfiledes)r/r-r*rNr.r/rJr0r1r2rKrLr3r4r5r6rIs r1r.zFakeFileWrapper.__init__îsØ€ð$'ˆÔØ"ˆŒØ$ˆŒØ(ˆÔ؈Œ Ø&Ô,ˆÔ؈Œ ؈Œ Ø(ˆÔØ"ˆŒØˆŒ Ø%ˆÔØ Ô  Ò !Ð !¨&Ð !ÝÐ=Ñ>Ô>Ð >à Ô  "Ò $Ð $¨FÐ $Ý "Ô 6ˆDÔ Ø$*  Ð =¨y¸Aª~ˆÔàÔ,ˆØ!Ð:Õ%8Ñ%:Ô%:ˆŒØÐ#˜8ˆðð �N˜8Ñ $Ô $Ð $娠8°WÀVðñôð ŒðˆÔ؈ŒØˆŒØ ð 6Ý! (™mœmˆDŒOØÔ ð 6Ø”Ô-ð6Ø”H—M’M !Ñ$Ô$Ð$Ð$à”H—M’M $¤/Ñ2Ô2Ð2Ø&*¤h§m¢m¡o¤o�D”Oà ð JØÐ IÐ IÐIÑ IÔ I�:Ø%ˆÔØ.ˆÔð Ô)ˆŒ Ø&*ˆŒ ˆ ˆ r2r+có—|S)ú=To support usage of this fake file with the 'with' statement.rÃrcs r1Ú __enter__zFakeFileWrapper.__enter__2ó€àˆ r2Úexc_typeÚexc_valÚexc_tbNcó.—| ¦«dS)rLN©Úclose©r/rOrPrQs r1Ú__exit__zFakeFileWrapper.__exit__6ó€ð � Š ‰ Œ ˆ ˆ ˆ r2ÚmessagecóŒ—|jr*|j tj|j¦«t j|¦«‚r„)r4rIr~rÚEBADFr*r>ÚUnsupportedOperation)r/rXs r1Ú_raisezFakeFileWrapper._raise?s;€Ø Œ;ð IØ Ô × +Ò +­E¬K¸¼Ñ HÔ HÐ HÝÔ% gÑ.Ô.Ð.r2có—|jS)zTReturn the FakeFile object that is wrapped by the current instance. ©r-rcs r1Ú get_objectzFakeFileWrapper.get_objectDs €ðÔÐr2cój—|j�|jS|j tj¦«dS)ú.Return the file descriptor of the file object.N)rJrIr~rrZrcs r1ÚfilenozFakeFileWrapper.filenoJs1€à Œ<Ð #Ø”<Ð Ø Ô×'Ò'­¬ Ñ4Ô4Ð4Ð4Ð4r2có:—| |j¦«dS)zClose the file.N©Úclose_fdrJrcs r1rTzFakeFileWrapper.closePó€à � Š �d”lÑ#Ô#Ð#Ð#Ð#r2Úfdcó‚—| ¦«sdS|js– | ¦«nP#t$rC}|jtjkr(|jsJ‚|j |j¦«‚d}~wwxYw|jj r$|j rtj ¦«|j _|€J‚|jr|j |¦«n+|jj|}|€J‚| |¦«|jr3|j | ¦«j¦«dSdS)z-Close the file for the given file descriptor.N)Ú_is_openr4ÚflushÚOSErrorrrZrJrIÚclose_open_filerUr<rrXr-rCr9Ú open_filesÚremover/Ú remove_objectr_rœ)r/rgÚerms r1rezFakeFileWrapper.close_fdTsc€ð�}Š}‰Œð Ø ˆFðŒ{ð :ð Ø— ’ ‘ ” � � øÝð ð ð Ø”7�eœkÒ)Ð)ð œ<Ð'Ð'˜<ØÔ$×4Ò4°T´\ÑBÔBÐBØøøøøð  øøøðÔÔ-ð :°$´-ð :Ý,3¬K©M¬M�Ô Ô)àˆ~ˆ~ˆ~Ø Œ=ð $Ø Ô × ,Ò ,¨RÑ 0Ô 0Ð 0Ð 0àÔ)Ô4°RÔ8ˆJØÐ)Ð)Ð)Ø × Ò ˜dÑ #Ô #Ð #Ø Ô ð Ø Ô × *Ò *Ø—’Ñ!Ô!Ô&ñ ô ð ð ð ð ð sŸ4´ B¾>A<Á<Bcó,—| ¦« S)z(Simulate the `closed` attribute on file.)rircs r1ÚclosedzFakeFileWrapper.closedvs€ð—=’=‘?”?Ð"Ð"r2cóL—|jjr|jrdnd}|jjr|dzn|S|jjr'|jr|jjrdndS|jjrdndS|jjr|jrdnd }|jjr|dzn|S|jrd nd }|jjr|dzn|S) NÚabÚaú+zrb+Úwbzw+ÚwÚxbÚxrÌÚr)rNrFr;Úcan_readÚtruncateÚmust_not_existÚ can_write)r/Úms r1ÚmodezFakeFileWrapper.mode{sÔ€à Œ?Ô !ð >Øœ Ð-��¨#ˆAØ"œoÔ6Ð=�1�s‘7�7¸AÐ =Ø Œ?Ô #ð =ØŒ|ð CØ $¤Ô 8ÐB�u�u¸dÐBØœ?Ô3Ð<�4�4¸Ð <Ø Œ?Ô )ð >Øœ Ð-��¨#ˆAØ"œoÔ6Ð=�1�s‘7�7¸AÐ =Ø”LÐ )ˆDˆD cˆØœ/Ô3Ð:ˆq�3‰wˆw¸Ð:r2Úold_poscóЗ|j} | ¦«dS#t$r<|j |¦«|j ¦«||_‚wxYw)z0Try to flush and reset the position if it fails.N)rErjrkrBrGr})r/r‚Ú flush_poss r1Ú _try_flushzFakeFileWrapper._try_flushŠsl€à”Oˆ ð Ø �JŠJ‰LŒLˆLˆLˆLøÝð ð ð à ŒH�MŠM˜'Ñ "Ô "Ð "Ø ŒH× Ò Ñ Ô Ð Ø'ˆDŒOØ ð  øøøs ‰ŸAA%cóÀ—|jrdS| ¦«|j�r?|jjre|j ¦«}| ¦«|jj }|€J‚|||j d…z}|  |¦«n2|j  ¦«|j ¦«}|j  ||j¦«}| ¦«|r?|jjrd|_n+t'j¦«}||j_||j_|jj|_| ¦«dSt5|j ¦«¦«}d}|jj �t5|jj ¦«}||kr&|j t8j¦«dSdS)zFlush file contents to 'disk'.NTr)r6Ú_check_open_filer.rNrFrBÚgetvalueÚ_sync_ior-rdrEÚ_set_stream_contentsrjrŒrAÚupdate_flush_posrIrUr<rrXrDrCr]r:Ú_flush_related_filesr\r~rrZ)r/rIÚ old_contentsrˆÚ current_timeÚ buf_lengthÚcontent_lengths r1rjzFakeFileWrapper.flush–sÈ€à Œ>ð Ø ˆFà ×ÒÑÔÐà Ô ñ =ØŒÔ%ð /Øœ8×,Ò,Ñ.Ô.�Ø— ’ ‘”�Ø#Ô/Ô=� Ø#Ð/Ð/Ð/Ø'¨(°4´?Ð3DÐ3DÔ*EÑE�Ø×)Ò)¨(Ñ3Ô3Ð3Ð3à”—’Ñ Ô Ð Øœ8×,Ò,Ñ.Ô.�ØÔ&×3Ò3°H¸d¼nÑMÔMˆGØ × !Ò !Ñ #Ô #Ð #Øð =ØÔ#Ô1ð=Ø$(�D”M�Må#*¤;¡=¤=�LØ0<�DÔ$Ô-Ø0<�DÔ$Ô-Ø#Ô/Ô5ˆDÔ Ø × %Ò %Ñ 'Ô 'Ð 'Ð 'Ð 'å˜TœX×.Ò.Ñ0Ô0Ñ1Ô1ˆJ؈NØÔÔ-Ð9Ý!$ TÔ%5Ô%CÑ!DÔ!D�à Ò+Ð+ØÔ ×/Ò/µ´ Ñ<Ô<Ð<Ð<Ð<ð,Ð+r2cóB—|j ¦«|_dSr„)rBrHrErcs r1r‹z FakeFileWrapper.update_flush_pos¼s€Øœ(Ÿ-š-™/œ/ˆŒˆˆr2cóÔ—|jjdd…D]R}|�N|D]K}||urEt|t¦«r0|j|jkr |jjs| ¦«ŒLŒSdS©Nr�)rIrmrfr"r-rNrFr‰)r/rmÚ open_files r1rŒz$FakeFileWrapper._flush_related_files¿s’€ØÔ*Ô5°a°b°bÔ9ð -ð -ˆJØÐ%Ø!+ð-ð-�Ià!¨Ð-Ð-Ý& yµ/ÑBÔBð.à Ô,° Ô0EÒEÐEØ )Ô 4Ô ;ðFð"×*Ò*Ñ,Ô,Ð,øøð -ð -r2rÚoffsetÚwhencecóÔ—| ¦«|jjs|j ||¦«n||_||_|js| ¦«dSdS)z"Move read/write pointer in 'file'.N) r‡rNrFrBrGrDrCr6rj)r/r•r–s r1rGzFakeFileWrapper.seekËsn€à ×ÒÑÔÐØŒÔ%ð 'Ø ŒH�MŠM˜& &Ñ )Ô )Ð )Ð )à$ˆDŒOØ &ˆDÔ ØŒ~ð Ø �JŠJ‰LŒLˆLˆLˆLð ð r2cóÀ—| ¦«|js| ¦«|jjs|j ¦«S|jr}|j ¦«}|j |j |j¦«|j ¦«|_ d|_|j |¦«|j S)zoReturn the file's current position. Returns: int, file's current position in bytes. r) r‡r6rjrNrFrBrHrCrGrD)r/Ú write_seeks r1rHzFakeFileWrapper.tellÖs´€ð ×ÒÑÔÐØŒ~ð Ø �JŠJ‰LŒLˆLàŒÔ%ð #Ø”8—=’=‘?”?Ð "Ø Ô ð &ØœŸš™œˆJØ ŒH�MŠM˜$œ/¨4Ô+<Ñ =Ô =Ð =Ø"œhŸmšm™oœoˆDŒOØ !ˆDÔ Ø ŒH�MŠM˜*Ñ %Ô %Ð %ØŒÐr2có —|j|jjkrdS|jj}|€J‚| |¦«|jj|_dS)z;Update the stream with changes to the file object contents.N)r:r-r]rdrŠr…s r1r‰zFakeFileWrapper._sync_ioêsZ€à Ô ˜tÔ/Ô5Ò 5Ð 5Ø ˆFàÔ#Ô1ˆØÐ#Ð#Ð#Ø ×!Ò! (Ñ+Ô+Ð+ØÔ+Ô1ˆÔÐÐr2rIcó"—|j ¦«}|j d¦«|j ¦«|j |¦«|jjs|j |¦«dSdSr})rBrHrGr}ÚputvaluerNrF)r/rIr–s r1rŠz$FakeFileWrapper._set_stream_contentsôs€€Ø”—’‘”ˆØ Œ� Š �aÑÔÐØ Œ×ÒÑÔÐØ Œ×Ò˜(Ñ#Ô#Ð#ØŒÔ%ð "Ø ŒH�MŠM˜&Ñ !Ô !Ð !Ð !Ð !ð "ð "r2rHcó@‡‡—t‰j|¦«Šˆˆfd„}|S)a_Wrap a stream attribute in a read wrapper. Returns a read_wrapper which tracks our own read pointer since the stream object has no concept of a different read and write pointer. Args: name: The name of the attribute to wrap. Should be a read call. Returns: The read_wrapper function. cóâ•—‰j ‰j‰j¦«‰|i|¤Ž}‰j ¦«‰_d‰_‰j dd¦«|S)a¯Wrap all read calls to the stream object. We do this to track the read pointer separate from the write pointer. Anything that wants to read from the stream object while we're in append mode goes through this. Args: *args: pass through args **kwargs: pass through kwargs Returns: Wrapped stream object method ré)rBrGrDrCrH)ÚargsÚkwargsÚ ret_valueÚio_attrr/s €€r1Ú read_wrapperz4FakeFileWrapper._read_wrappers..read_wrapper siø€ð ŒH�MŠM˜$œ/¨4Ô+<Ñ =Ô =Ð =ؘ Ð0¨Ð0Ð0ˆIØ"œhŸmšm™oœoˆDŒOØ !ˆDÔ Ø ŒH�MŠM˜!˜QÑ Ô Ð ØÐ r2©r¥rB)r/rHr¤r£s` @r1Ú_read_wrapperszFakeFileWrapper._read_wrappersüs=øø€õ˜$œ( DÑ)Ô)ˆð ð ð ð ð ð ð(Ðr2có@‡‡—t‰j|¦«Šˆˆfd„}|S)zÂWrap a stream attribute in an other_wrapper. Args: name: the name of the stream attribute to wrap. Returns: other_wrapper which is described below. cóΕ—‰j ¦«}‰|i|¤Ž}|‰j ¦«kr%‰j ¦«‰_d‰_|S)á¨Wrap all other calls to the stream Object. We do this to track changes to the write pointer. Anything that moves the write pointer in a file open for appending should move the read pointer as well. Args: *args: Pass through args. **kwargs: Pass through kwargs. Returns: Wrapped stream object method. r)rBrHrDrC)r r¡r™r¢r£r/s €€r1Ú other_wrapperz5FakeFileWrapper._other_wrapper..other_wrapper+s\ø€ðœŸš™œˆJؘ Ð0¨Ð0Ð0ˆIؘTœXŸ]š]™_œ_Ò,Ð,Ø"&¤(§-¢-¡/¤/�”Ø$%�Ô!àÐ r2r¥)r/rHrªr£s` @r1Ú_other_wrapperzFakeFileWrapper._other_wrapper s=øø€õ˜$œ( DÑ)Ô)ˆð ð ð ð ð ð ð,Ðr2có@‡‡—t‰j|¦«Šˆˆfd„}|S)zÁWrap a stream attribute in a write_wrapper. Args: name: the name of the stream attribute to wrap. Returns: write_wrapper which is described below. cóò•—‰j ¦«}‰|i|¤Ž}‰j ¦«}‰jo d|dv}|‰jz ‰jks|rd||z ‰jkp|}|s3‰j |¦«‰j ¦«‰ |¦«|s‰|i|¤Ž}‰jj r%‰j ¦«‰_ d‰_ |S)r©rr) rBrHr@rEr=rGr}r…rNrFrDrC) r r¡r‚r¢Únew_posÚ use_line_bufÚ flush_allr£r/s €€r1Ú write_wrapperz5FakeFileWrapper._write_wrapper..write_wrapperNs ø€ð”h—m’m‘o”oˆGؘ Ð0¨Ð0Ð0ˆIØ”h—m’m‘o”oˆGð Ô0ÐD°T¸TÀ!¼W°_ˆLؘœÑ(¨4Ô+<Ò<Ð<À Ð<Ø# gÑ-°Ô0AÒAÐQÀ\� ð!ð(Ø”H—M’M 'Ñ*Ô*Ð*Ø”H×%Ò%Ñ'Ô'Ð'Ø—’ Ñ(Ô(Ð(Ø ð9Ø ' ¨Ð 8°Ð 8Ð 8�IØŒÔ%ð &Ø"&¤(§-¢-¡/¤/�”Ø$%�Ô!ØÐ r2r¥)r/rHr±r£s` @r1Ú_write_wrapperzFakeFileWrapper._write_wrapperCs>øø€õ˜$œ( DÑ)Ô)ˆð" ð" ð" ð" ð" ð" ðHÐr2rxcóò—|jjdd…D]a}|�]|D]Z}||urTt|t¦«r?|j|jkr/t t|¦«jjr|xj|z c_Œ[ŒbdSr“) rIrmrfr"r-r rNrFrD)r/rxrmr”s r1Ú_adapt_size_for_related_filesz-FakeFileWrapper._adapt_size_for_related_filestsž€ØÔ*Ô5°a°b°bÔ9ð 5ð 5ˆJØÐ%Ø!+ð5ð5�Ià!¨Ð-Ð-Ý& yµ/ÑBÔBð.à Ô,° Ô0EÒEÐEÝ ¥°)Ñ<Ô<ÔGÔNðFð"Ð,Ô,°Ñ4Ð,Ô,øøð 5ð 5r2có.‡‡—‰jjŠˆˆfd„}|S)zwWrap truncate() to allow flush after truncate. Returns: Wrapper which is described below. cóh•—‰jjr%‰j ‰j‰j¦«‰|i|¤Ž}‰ ¦«‰jsÈ|‰j_ t‰j  ¦«¦«}||kr�‰j |¦«‰j  d||z z¦«‰j  ‰j  ¦«‰j¦«|‰_‰ ||z ¦«‰ ¦«|S)z0Wrap truncate call to call flush after truncate.r�)rNrFrBrGrDrCrjr6r-rxr\rˆrœrŒrArEr´)r r¡rxÚ buffer_sizer£r/s €€r1Útruncate_wrapperz;FakeFileWrapper._truncate_wrapper..truncate_wrapperˆsø€àŒÔ%ð BØ”— ’ ˜dœo¨tÔ/@ÑAÔAÐAØ�7˜DÐ+ FÐ+Ð+ˆDØ �JŠJ‰LŒLˆLØ”>ð KØ(,�Ô Ô%Ý! $¤(×"3Ò"3Ñ"5Ô"5Ñ6Ô6� Ø Ò%Ð%Ø”H—M’M +Ñ.Ô.Ð.Ø”H×%Ò% e¨t°kÑ/AÑ&BÑCÔCÐCØÔ$×1Ò1°$´(×2CÒ2CÑ2EÔ2EÀtÄ~ÑVÔVÐVØ&*�D”OØ×6Ò6°t¸kÑ7IÑJÔJÐJà �JŠJ‰LŒLˆL؈Kr2)rBr})r/r¸r£s` @r1Ú_truncate_wrapperz!FakeFileWrapper._truncate_wrapper€s6øø€ð ”(Ô#ˆð ð ð ð ð ð ð& Ðr2có—|jjS)z5Return the content size in bytes of the wrapped file.)r-rArcs r1rxzFakeFileWrapper.size�s€àÔÔ'Ð'r2có4—|j ¦«rt|j¦«‚| d¦«p|dk}|dk}| d¦«p|}|s|r| ¦«|jjs|r| ¦«S|j s|j s|r|  ¦«S|rX|  ¦«|j s| ¦«|jjst#j¦«|j_|r| ¦«S|jjr.|r| |¦«S|s| |¦«S|r| |¦«St3|j|¦«S)NrÎÚnextr}Úwrite)r-r‚r)r*Ú startswithr‡rNr|Ú _read_errorr5r.Ú _write_errorr‰r6rjrIrUrrXrBr¹rFr¦r«r²r¥rB)r/rHÚreadingr}Úwritings r1r§zFakeFileWrapper.__getattr__¡s°€Ø Ô × )Ò )Ñ +Ô +ð ;Ý*¨4¬>Ñ:Ô:Ð :à—/’/ &Ñ)Ô)Ð;¨T°Vª^ˆØ˜:Ò%ˆØ—/’/ 'Ñ*Ô*Ð6¨hˆà ð $�gð $Ø × !Ò !Ñ #Ô #Ð #ØŒÔ'ð &¨Gð &Ø×#Ò#Ñ%Ô%Ð %ØÔ ð '¨Ô):ð '¸wð 'Ø×$Ò$Ñ&Ô&Ð &à ð :Ø �MŠM‰OŒOˆOØ”>ð Ø— ’ ‘ ” � ØÔ#Ô1ð :Ý,3¬K©M¬M�Ô Ô)Ø ð ,Ø×)Ò)Ñ+Ô+Ð +Ø Œ?Ô !ð 1Øð 1Ø×*Ò*¨4Ñ0Ô0Ð0Øð 1Ø×*Ò*¨4Ñ0Ô0Ð0Ø ð -Ø×&Ò& tÑ,Ô,Ð ,å�t”x Ñ&Ô&Ð&r2có‡—ˆfd„}|S)NcóŠ•—|r*|ddkr‰jjr‰jr ‰jrdndS‰ d¦«dS)z+Throw an error unless the argument is zero.rr2rRzFile is not open for reading.N)rIrUr4r;r\©r r¡r/s €r1Ú read_errorz/FakeFileWrapper._read_error..read_errorÃsXø€àð 7˜˜Qœ 1š ˜ ØÔ#Ô1ð7°d´kð7Ø"&¤,Ð6˜3˜3°BÐ6Ø �KŠKÐ7Ñ 8Ô 8Ð 8Ð 8Ð 8r2rÃ)r/rÆs` r1r¿zFakeFileWrapper._read_errorÂs$ø€ð 9ð 9ð 9ð 9ð 9ðÐr2có‡—ˆfd„}|S)Ncó’•—‰jr)‰jjr|rt|d¦«dkrdS‰ d¦«dS)zThrow an error.rzFile is not open for writing.N)r4rIrUr\r\rÅs €r1Ú write_errorz1FakeFileWrapper._write_error..write_errorÍsTø€àŒ{ð ØÔ#Ô1ð°dð½sÀ4ÈÄ7¹|¼|ÈqÒ?PÐ?Pؘ1Ø �KŠKÐ7Ñ 8Ô 8Ð 8Ð 8Ð 8r2rÃ)r/rÉs` r1rÀzFakeFileWrapper._write_errorÌs$ø€ð 9ð 9ð 9ð 9ð 9ðÐr2có–—|j�A|jt|jj¦«kr|jj|j}|�||vrdSdS)NTF)rJr\rIrm)r/rms r1rizFakeFileWrapper._is_openÖsP€Ø Œ<Ð #¨¬ µs¸4Ô;KÔ;VÑ7WÔ7WÒ(WÐ(WØÔ)Ô4°T´\ÔBˆJØÐ%¨$°*Ð*<Ð*<Ø�t؈ur2có^—|js#| ¦«std¦«‚dSdS)NzI/O operation on closed file)r6rirSrcs r1r‡z FakeFileWrapper._check_open_fileÝs>€ØŒ~ð = d§m¢m¡o¤oð =ÝÐ;Ñ<Ô<Ð <ð =ð =ð =ð =r2cóv—|jjs| d¦«|j ¦«S©NzFile is not open for reading)rNr|r\rBÚ__iter__rcs r1rÎzFakeFileWrapper.__iter__ás6€ØŒÔ'ð 8Ø �KŠKÐ6Ñ 7Ô 7Ð 7ØŒx× Ò Ñ"Ô"Ð"r2cól—|jjs| d¦«t|j¦«SrÍ)rNr|r\r¼rBrcs r1Ú__next__zFakeFileWrapper.__next__æs0€ØŒÔ'ð 8Ø �KŠKÐ6Ñ 7Ô 7Ð 7Ý�D”H‰~Œ~Ðr2)F)r+r"©r+Nrà)4r3r4r5r6r&r rr»rr7r·r.rMrÚ BaseExceptionrrVrr\r_rbrTrer¸rrr�r…rjr‹rŒrGrHr‰rgrŠrr¦r«r²r´r¹rxr r§r¿rÀrir‡r rrÎrÐrÃr2r1r"r"çs—€€€€€ððð, ð!B+ðB+àðB+ððB+ðð B+ð ð B+ð ð B+ð%ðB+ð˜#”ðB+ððB+ððB+ð˜3”-ðB+𘔠ðB+ððB+ððB+ððB+ð ð!B+ðB+ðB+ðB+ðHððððà˜4  Ô.Ô/ðð˜-Ô(ðð˜Ô'ð ð ð ðððð/˜cð/ hð/ð/ð/ð/ð  ˜Hð ð ð ð ð 5˜ð5ð5ð5ð5ð $ð$ð$ð$ð ˜8 Cœ=ð ¨Tð ð ð ð ðDð#˜ð#ð#ð#ñ„Xð#ðð ;�cð ;ð ;ð ;ñ„Xð ;ð  #ð ¨$ð ð ð ð ð$=ð$=ð$=ð$=ðL*ð*ð*ð*ð -ð -ð -ð -ð ð ˜3ð ¨ð °Dð ð ð ð ð�cððððð(2ð2ð2ð2ð"¨Uð"°tð"ð"ð"ð"ð" 3ð"¨8ð"ð"ð"ð"ðH! 3ð!¨8ð!ð!ð!ð!ðF/ 3ð/¨8ð/ð/ð/ð/ðb 5°#ð 5¸$ð 5ð 5ð 5ð 5ð  8ð ð ð ð ð:(�cð(ð(ð(ð(ð' ð'¨ð'ð'ð'ð'ðB˜Xððððð˜hððððð˜$ððððð=ð=ð=ð=ð#˜% ¨¤ ¨x¸¬Ð >Ô?ð#ð#ð#ð#ð ððððr2r"cóØ—eZdZdZdefd„Zdefd„Zdefd„Zddede fd „Z d e defd „Z dd „Z de edd fd„Zdefd„Zdd„Zde eede ede edd fd„Zd S)r$zCWrapper for a system standard stream to be used in open files list.Ú stream_objectcó"—||_d|_dSr„)Ú_stream_objectrJ)r/rÔs r1r.zStandardStreamWrapper.__init__ïs€Ø+ˆÔØ&*ˆŒ ˆ ˆ r2r+có—|jSr„)rÖrcs r1r_z StandardStreamWrapper.get_objectós €ØÔ"Ð"r2cóŠ—|j�|jSttjt jtj¦«¦«‚)z:Return the file descriptor of the wrapped standard stream.©rJrkrrZrÈÚstrerrorrcs r1rbzStandardStreamWrapper.filenoöó0€à Œ<Ð #Ø”<Ð Ý•e”k¥2¤;­u¬{Ñ#;Ô#;Ñ<Ô<З||_||_||_d|_dSr„)r-r*rIrJ)r/r-r*rJs r1r.zFakeDirWrapper.__init__s&€ð 'ˆÔØ"ˆŒØ%ˆÔØ&*ˆŒ ˆ ˆ r2r+có—|jS)zKReturn the FakeFile object that is wrapped by the current instance.r^rcs r1r_zFakeDirWrapper.get_object(s €ðÔÐr2cóŠ—|j�|jSttjt jtj¦«¦«‚)rarÙrcs r1rbzFakeDirWrapper.fileno-rÛr2Ncó:—| |j¦«dS©zClose the directory.Nrdrcs r1rTzFakeDirWrapper.close3rfr2rgcóB—|€J‚|j |¦«dSrî)rIrlrãs r1rezFakeDirWrapper.close_fd7s(€àˆ~ˆ~ˆ~Ø Ô×(Ò(¨Ñ,Ô,Ð,Ð,Ð,r2r8ÚnumBytescó6—|j |¦«S)zRead from the directory.)r-rΩr/rðs r1rÎzFakeDirWrapper.read<s€àÔ×$Ò$ XÑ.Ô.Ð.r2rIcóT—|j |¦«t|¦«S)zWrite to the directory.)r-r½r\r…s r1r½zFakeDirWrapper.write@s%€à Ô×Ò˜xÑ(Ô(Ð(Ý�8‰}Œ}Ðr2có—|S)úBTo support usage of this fake directory with the 'with' statement.rÃrcs r1rMzFakeDirWrapper.__enter__ErNr2rOrPrQcó.—| ¦«dS)rõNrSrUs r1rVzFakeDirWrapper.__exit__IrWr2rÑrè)r+r#)r3r4r5r6r'rr.r_r·rbrTrrergrÎr½rMrrÒrrVrÃr2r1r#r#se€€€€€ØKÐKð +à"ð +ðð +ð%ð +ð +ð +ð +ð ˜Mð ð ð ð ð =˜ð=ð=ð=ð=ð $ð$ð$ð$ð-˜8 Cœ=ð-¨Tð-ð-ð-ð-ð /ð/˜Sð/¨%ð/ð/ð/ð/ð˜eð¨ððððð ððððà˜4  Ô.Ô/ðð˜-Ô(ðð˜Ô'ð ð ð ðððððr2r#c ó—eZdZdZ ddddededefd„Zdd „Zd e e e d e e d e e d dfd„Z dd„Zd efd„Zd ded efd„Zdd„Zded efd„Zdd„Zde ed dfd„Zd efd„Zd efd„Zd efd„ZdS)!r%zdWrapper for a read or write descriptor of a real pipe object to be used in open files list. rRrJr!rgrr�cóŒ—||_||_||_d|_d|_d|_|rt ||¦«|_dSdSr„)rIrgrr-rJÚ real_fileÚopen)r/rJrgrr�s r1r.zFakePipeWrapper.__init__XsU€ð&ˆÔ؈ŒØ"ˆŒØˆÔØ&*ˆŒ ؈ŒØ ð ,Ý! " d™^œ^ˆDŒNˆNˆNð ,ð ,r2r+có—|S)ú=To support usage of this fake pipe with the 'with' statement.rÃrcs r1rMzFakePipeWrapper.__enter__hrNr2rOrPrQNcó.—| ¦«dS)rüNrSrUs r1rVzFakePipeWrapper.__exit__lrWr2có—|jSr„r^rcs r1r_zFakePipeWrapper.get_objectus €ØÔÐr2cóŠ—|j�|jSttjt jtj¦«¦«‚)z3Return the fake file descriptor of the pipe object.rÙrcs r1rbzFakePipeWrapper.filenoxrÛr2r8rðcóx—|jr|j |¦«Stj|j|¦«S)zRead from the real pipe.)rùrÎrÈrgròs r1rÎzFakePipeWrapper.read~s6€à Œ>ð 1Ø”>×&Ò& xÑ0Ô0Ð 0ÝŒw�t”w Ñ)Ô)Ð)r2có—dS)zFlush the real pipe?NrÃrcs r1rjzFakePipeWrapper.flush„rár2rIcóx—|jr|j |¦«Stj|j|¦«S)zWrite to the real pipe.)rùr½rÈrgr…s r1r½zFakePipeWrapper.write‡s6€à Œ>ð 2Ø”>×'Ò'¨Ñ1Ô1Ð 1ÝŒx˜œ Ñ*Ô*Ð*r2có:—| |j¦«dS)zClose the pipe descriptor.Nrdrcs r1rTzFakePipeWrapper.close�rfr2cóÚ—|€J‚|jj|}|€J‚| |¦«|jr|j ¦«dSt j|j¦«dS)z9Close the pipe descriptor with the given file descriptor.N)rIrmrnrùrTrÈrg)r/rgrms r1rezFakePipeWrapper.close_fd‘sw€àˆ~ˆ~ˆ~ØÔ%Ô0°Ô4ˆ ØÐ%Ð%Ð%Ø×Ò˜$ÑÔÐØ Œ>ð Ø ŒN× Ò Ñ "Ô "Ð "Ð "Ð "å ŒH�T”WÑ Ô Ð Ð Ð r2có—|j S©z0The pipe end can either be readable or writable.©rrcs r1ÚreadablezFakePipeWrapper.readableœs €à”>Ð!Ð!r2có—|jSrrrcs r1ÚwritablezFakePipeWrapper.writable s €àŒ~Ðr2có—dS)zA pipe is not seekable.FrÃrcs r1ÚseekablezFakePipeWrapper.seekable¤rÔr2)rR)r+r%rÑrè)r3r4r5r6r·r»r7r.rMrrrÒrrVr_rbrgrÎrjr½rTrerr r rÃr2r1r%r%SsÛ€€€€€ðððð ,ð,à$ð,ð ð,ðð ,ð ð ,ð,ð,ð,ð ððððà˜4  Ô.Ô/ðð˜-Ô(ðð˜Ô'ð ð ð ðððð ð ð ð ð=˜ð=ð=ð=ð=ð *ð*˜Sð*¨%ð*ð*ð*ð*ð #ð#ð#ð#ð+˜eð+¨ð+ð+ð+ð+ð $ð$ð$ð$ð ˜8 Cœ=ð ¨Tð ð ð ð ð"˜$ð"ð"ð"ð"ð˜$ððððð˜$ððððððr2r%):r6rr>rÈr¼rrÏrrÚtypesrÚtypingrrrr r r r r rrrrrÚpyfakefsrÚpyfakefs.helpersrrrrrrrrrrrrr Úpyfakefs.fake_filesystemr!rúrÍÚAnyFileWrapperrÚ Exceptionr)r&r¿rÆr'rr"r$r#r%rÃr2r1úrsßðð7Ð6à € € € Ø € € € Ø € € € Ø € € € ØÐÐÐððððððððð ÐÐÐÐÐððððððððððððððððððððððððððððððð ÐÐÐÐÐððððððððððððððððððððððððððððððð ð8Ø7Ð7Ð7Ð7Ð7Ð7ð Œ'€àðô€ð Ð+Ô ,€ð  ð  ð  ð  ð  ˜yñ  ô  ð  ðIMðIMðIMðIMðIMñIMôIMðIMðX ð ð ð ð �8ñ ô ð ð,ð,ð,ð,ð,˜8ñ,ô,ð,ð^wðwðwðwðw�HñwôwðwðtKFðKFðKFðKFðKF ]ñKFôKFðKFð\BðBðBðBðBñBôBðBðJ+ð+ð+ð+ð+ñ+ô+ð+ð\6ð6ð6ð6ð6ñ6ô6ð6ðrSðSðSðSðSñSôSðSðSðSr2