§ 1j‹ãó\—dZddlZddlZddlZddlZddlmZddlmZGd„d¦«Z dS)aÜA fake shutil module implementation that uses fake_filesystem for unit tests. Note that only `shutildisk_usage()` is faked, the rest of the functions shall work fine with the fake file system if `os`/`os.path` are patched. :Includes: FakeShutil: Uses a FakeFilesystem to provide a fake replacement for the shutil module. :Usage: The fake implementation is automatically involved if using `fake_filesystem_unittest.TestCase`, pytest fs fixture, or directly `Patcher`. éN)ÚRLock)ÚCallablecó´—eZdZdZe¦«Zeed¦«oejZ eed¦«oej Z eed¦«oej Z ejZgd¢Zejdks ejdkre gd¢¦«ed „¦«Zd „Zd „Zd „Zd edefd„Zd„Zejdkr)ejdkrddœd„Zddejddfd„Zejfd„Zd„Z dS)ÚFakeShutilModulezâUses a FakeFilesystem to provide a fake replacement for shutil module. Automatically created if using `fake_filesystem_unittest.TestCase`, the `fs` fixture, the `patchfs` decorator, or directly the `Patcher`. Ú_USE_CP_COPY_FILE_RANGEÚ_HAS_FCOPYFILEÚ_USE_CP_SENDFILE)ÚcopyÚcopyfileÚrmtree)éé Úwin32)Úcopy2ÚcopytreeÚmovecó—dS)zqReturn the list of patched function names. Used for patching functions imported from the module. )Ú disk_usage©róúq/builddir/build/BUILD/cloudlinux-venv-1.0.11/venv/lib/python3.11/site-packages/pyfakefs/fake_filesystem_shutil.pyÚdirzFakeShutilModule.dir;s €ð ˆrcó:—||_t|_d|_dS)z�Construct fake shutil module using the fake filesystem. Args: filesystem: FakeFilesystem used to provide file system information rN)Ú filesystemÚshutilÚ shutil_moduleÚ _patch_level)Úselfrs rÚ__init__zFakeShutilModule.__init__Bs!€ð %ˆŒÝ#ˆÔ؈ÔÐÐrcó,—|xjdz c_|jdkrdS|jr d|j_|jr d|j_|jr d|j_|jr6tj dkr|jj |j_ dSd|j_ dSdS)NéF©r é)rÚhas_fcopy_filerrÚuse_copy_file_rangerÚ use_sendfiler Úuse_fd_functionsÚsysÚ version_infoÚ_rmtree_unsafeÚ _rmtree_implÚ_use_fd_functions©rs rÚ_start_patching_global_varsz,FakeShutilModule._start_patching_global_varsLs»€Ø ÐÔ˜QÑÐÔØ Ô ˜qÒ Ð Ø ˆFØ Ô ð 6Ø05ˆDÔ Ô -Ø Ô #ð ?Ø9>ˆDÔ Ô 6Ø Ô ð 8Ø27ˆDÔ Ô /Ø Ô ð =ÝÔ 7Ò*Ð*àÔ&Ô5ðÔ"Ô/Ð/Ð/ð8=�Ô"Ô4Ð4Ð4ð  =ð =rcó,—|xjdzc_|jdkrdS|jr d|j_|jr d|j_|jr d|j_|jr6tj dkr|jj |j_ dSd|j_ dSdS)Nr!rTr")rr$rrr%rr&r r'r(r)Ú_rmtree_safe_fdr+r,r-s rÚ_stop_patching_global_varsz+FakeShutilModule._stop_patching_global_vars^s»€Ø ÐÔ˜QÑÐÔØ Ô ˜qÒ Ð Ø ˆFØ Ô ð 5Ø04ˆDÔ Ô -Ø Ô #ð >Ø9=ˆDÔ Ô 6Ø Ô ð 7Ø26ˆDÔ Ô /Ø Ô ð <ÝÔ 7Ò*Ð*àÔ&Ô6ðÔ"Ô/Ð/Ð/ð8<�Ô"Ô4Ð4Ð4ð  <ð .wrappedusÆø€àÔ!ð 6ð 6Ø×0Ò0Ñ2Ô2Ð2ð6ؘ1˜dÐ- fÐ-Ð-à×3Ò3Ñ5Ô5Ð5ð  6ð 6ð 6ð 6ñ 6ô 6ð 6ð 6øð ×3Ò3Ñ5Ô5Ð5Ð5øøøð  6ð 6ð 6ð 6øøøð 6ð 6ð 6ð 6ð 6ð 6s'‰A ŸA¦A ÁAÁA Á A$Á'A$)Ú functoolsÚwraps)rr2r9s`` rÚwith_patched_globalsz%FakeShutilModule.with_patched_globalsps@øø€õ Œ˜Ñ Ô ð 6ð 6ð 6ð 6ð 6ñ Ô ð 6ðˆrcó6—|j |¦«S)zåReturn the total, used and free disk space in bytes as named tuple or placeholder holder values simulating unlimited space if not set. Args: path: defines the filesystem device which is queried )rÚget_disk_usage)rÚpaths rrzFakeShutilModule.disk_usage€s€ðŒ×-Ò-¨dÑ3Ô3Ð3rT©Úfollow_symlinkscó —|j |¦«r8|j |tj |¦«¦«}| |||¬¦«| |||¬¦«|S)z¶Since Python 3.12, there is an optimization fow Windows, using the Windows API. We just remove this and fall back to the previous implementation. r@)rÚisdirÚ joinpathsÚosr?Úbasenamer Úcopystat)rÚsrcÚdstrAs rrzFakeShutilModule.copy2‹sy€ð Œ×$Ò$ SÑ)Ô)ð LØ”o×/Ò/°µR´W×5EÒ5EÀcÑ5JÔ5JÑKÔK�à �MŠM˜#˜s°OˆMÑ DÔ DÐ DØ �MŠM˜#˜s°OˆMÑ DÔ DÐ D؈JrFNc óp—|tjkr|j}|j |||||||¦«S©z*Make sure the default argument is patched.)rrrr)rrHrIÚsymlinksÚignoreÚ copy_functionÚignore_dangling_symlinksÚ dirs_exist_oks rrzFakeShutilModule.copytree—sH€ð¥¤ Ò,Ð,Ø $¤ � ØÔ%×.Ò.ØØØØØØ(Øñôð rcóh—|tjkr|j}|j |||¦«SrK)rrrr)rrHrIrNs rrzFakeShutilModule.move®s1€à¥¤ Ò,Ð,Ø $¤ � ØÔ%×*Ò*¨3°°]ÑCÔCÐ CrcóŽ—||jvr(| t|j|¦«¦«St|j|¦«S)z;Forwards any non-faked calls to the standard shutil module.)Úfunctions_to_patchr<Úgetattrr)rÚnames rÚ __getattr__zFakeShutilModule.__getattr__´sD€à �4Ô*Ð *Ð *Ø×,Ò,­W°TÔ5GÈÑ-NÔ-NÑOÔOÐ OÝ�tÔ)¨4Ñ0Ô0Ð0r)!Ú__name__Ú __module__Ú __qualname__Ú__doc__rr6Úhasattrrrr%rr$r r&r,r'rSr(r)ÚplatformÚextendÚ staticmethodrrr.r1rr<rrrrrVrrrrr's΀€€€€ððð�%‘'”'€Kð ˆ�Ð1Ñ2Ô2ÐU°vÔ7Uðð�W˜VÐ%5Ñ6Ô6ÐP¸6Ô;P€NØ�7˜6Ð#5Ñ6Ô6ÐR¸6Ô;R€LØÔ/ÐØ7Ð7Ð7ÐØ Ô˜'Ò!Ð! S¤\°WÒ%<Ð%<Ø×!Ò!Ð"?Ð"?Ð"?Ñ@Ô@Ð@àððñ„\ðð ððð=ð=ð=ð$<ð<ð<ð$ hð°8ððððð 4ð4ð4ð Ô˜7Ò"Ð" s¤|°wÒ'>Ð'>à59ð ð ð ð ð ð ØØ œ,Ø%*Øð ð ð ð ð.06¬|ð Dð Dð Dð Dð 1ð1ð1ð1ð1rr) rZr:rErr(Ú threadingrÚtypingrrrrrúras˜ðððð ÐÐÐØ € € € Ø € € € Ø € € € ØÐÐÐÐÐØÐÐÐÐÐðQ1ðQ1ðQ1ðQ1ðQ1ñQ1ôQ1ðQ1ðQ1ðQ1r