$14 GRAYBYTE WORDPRESS FILE MANAGER $14

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/lib/python3.6/site-packages/syspurpose/__pycache__/

HOME
Current File : /lib/python3.6/site-packages/syspurpose/__pycache__//utils.cpython-36.pyc
3

�vh3�@s�ddlmZmZmZddlZddlZddlZddlZddlZddl	Z	ddl
mZdZ
ddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�ZdS)�)�print_function�division�absolute_importN)�ugettextz/etc/rhsm-host/cCsR|rDt|�tg�tf�gkr"|f}x |D]}tjjt|�d�q(Wtj|�dS)zDExit with a code and optional message(s). Saved a few lines of code.�
N)�type�sys�stderr�write�str�exit)�codeZmsgs�msg�r�/usr/lib/python3.6/utils.py�system_exit"s
rcCslytj|dd�WnTtk
rf}z8|jtjkr4dS|jtjkrVttjtd�j	|��WYdd}~XnXdS)z�
    Attempts to create the path given (less any file)
    :param path: path
    :return: True if changes were made, false otherwise
    i�)�modeFz(Cannot create directory {}
Are you root?NT)
�os�makedirs�OSError�errno�EEXIST�EACCESr�	EX_NOPERM�_�format)�path�errr�
create_dir-s"rcCs�y2tj|ddd��}t||�|j�WdQRXWnXtk
r�}z<|jtjkrTdS|jtjkrxtt	j
td�j|��n�WYdd}~XnXdS)z�
    Attempts to create a file, with the given contents
    :param path: The desired path to the file
    :param contents: The contents to write to the file, should json-serializable
    :return: True if the file was newly created, false otherwise
    �wzutf-8)�encodingNFz#Cannot create file {}
Are you root?T)
�io�open�write_to_file_utf8�flushrrrrrrrrr)r�contents�frrrr�create_file?s
r'cCstjjt�rdSdS)z�
    Are we running in a docker container or not?

    Assumes that if we see host rhsm configuration shared with us, we must
    be running in a container.
    TF)rr�exists�HOST_CONFIG_DIRrrrr�in_containerWsr*cCs>tjr
|S|dk	r6t|t�r6t|t�r6|jd�}|S|SdS)z�
    Transforms the provided string into unicode if it is not already
    :param obj: the string to decode
    :return: the unicode format of the string
    Nzutf-8)�sixZPY3�
isinstancerZunicode�decode)�objrrr�	make_utf8cs
r/cCs |jttj|dddd���dS)z�
    Writes out the provided data to the specified file, with user-friendly indentation,
    and in utf-8 encoding.
    :param file: The file to write to
    :param data: The data to be written
    :return:
    �FT)�indentZensure_asciiZ	sort_keysN)r
r/�json�dumps)�file�datarrrr#rsr#)N)Z
__future__rrrr!r2rrrr+Zsyspurpose.i18nrrr)rrr'r*r/r#rrrr�<module>s



Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
17 Jul 2025 8.41 AM
root / root
0755
__init__.cpython-36.opt-1.pyc
0.11 KB
15 Jul 2025 9.13 AM
root / root
0644
__init__.cpython-36.pyc
0.11 KB
15 Jul 2025 9.13 AM
root / root
0644
cli.cpython-36.opt-1.pyc
10.326 KB
15 Jul 2025 9.13 AM
root / root
0644
cli.cpython-36.pyc
10.326 KB
15 Jul 2025 9.13 AM
root / root
0644
files.cpython-36.opt-1.pyc
21.552 KB
15 Jul 2025 9.13 AM
root / root
0644
files.cpython-36.pyc
21.552 KB
15 Jul 2025 9.13 AM
root / root
0644
i18n.cpython-36.opt-1.pyc
1.554 KB
15 Jul 2025 9.13 AM
root / root
0644
i18n.cpython-36.pyc
1.554 KB
15 Jul 2025 9.13 AM
root / root
0644
main.cpython-36.opt-1.pyc
0.736 KB
15 Jul 2025 9.13 AM
root / root
0644
main.cpython-36.pyc
0.736 KB
15 Jul 2025 9.13 AM
root / root
0644
utils.cpython-36.opt-1.pyc
2.893 KB
15 Jul 2025 9.13 AM
root / root
0644
utils.cpython-36.pyc
2.893 KB
15 Jul 2025 9.13 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF