Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/ftputil/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/ftputil/__pycache__/tool.cpython-38.pyc
U

O��g�	�@s>dZddlZddddgZdd�Zdd�Zd	d�Zddd�ZdS)
z
tool.py - helper code
�N�same_string_type_as�as_str�as_str_path�raise_for_empty_pathcCsDt|t�rt|t�r|�|�St|t�r<t|t�r<|�|�S|SdS)z�
    Return a string of the same type as `type_source` with the content from
    `string`.

    If the `type_source` and `string` don't have the same type, use `encoding`
    to encode or decode, whatever operation is needed.
    N)�
isinstance�bytes�str�encode�decode)Ztype_source�string�encoding�r
�9/opt/cppython/lib/python3.8/site-packages/ftputil/tool.pyrs


cCs.t|t�r|�|�St|t�r"|Std��dS)z�
    Return the argument `string` converted to a unicode string if it's a
    `bytes` object. Otherwise just return the string.

    If a conversion is necessary, use `encoding`.

    If `string` is neither `str` nor `bytes`, raise a `TypeError`.
    z*`as_str` argument must be `bytes` or `str`N)rrr
r�	TypeError)rrr
r
rrs
	


cCst�|�}t||�S)a�
    Return the argument `path` converted to a unicode string if it's a `bytes`
    object. Otherwise just return the string.

    If a conversion is necessary, use `encoding`.

    Instead of passing a `bytes` or `str` object for `path`, you can pass a
    `PathLike` object that can be converted to a `bytes` or `str` object.

    If the `path` can't be converted to a `bytes` or `str`, a `TypeError` is
    raised.
    )�os�fspathr)�pathrr
r
rr0s
rcCs:ddl}|dkr6|dkrd}nd|�d�}|j�|��dS)zi
    Raise an exception of class `exception_class` if `path` is an empty string
    (text or bytes).
    rN)��zpath argument is emptyzpath argument `z
` is empty)Z
ftputil.error�errorZ
FTPIOError)rZpath_argument_nameZftputil�messager
r
rrAs)r)�__doc__r�__all__rrrrr
r
r
r�<module>s

F1le Man4ger