HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/LanguageSelector/__pycache__/utils.cpython-38.pyc
U

ڀR]��@s.ddlZddlZddlZddd�Zdd�ZdS)�NTc
Cs�|D]�}tjdtj�|�d�}d}tj�|�r�t�|tj�r�t|��R}|D]F}	|	�	�}
|rl|
�
|�rld}|}	|s�|
|kr�d}|}	|�|	�d��qJW5QRX|s�|r�|�|�d��|�
�t�|j|�t�|d�qdS)zY find all strings that startswith findString and replace them with
        setString
    F)�delete�dirTzUTF-8i�N)�tempfileZNamedTemporaryFile�os�path�dirname�exists�access�R_OK�open�strip�
startswith�write�encode�flush�rename�name�chmod)Z
findStringZ	setStringZ	file_listr
�append�fname�outZfoundString�f�lineZtmp�r�8/usr/lib/python3/dist-packages/LanguageSelector/utils.py�find_string_and_replaces.
��
rcCs(|�d�d}tjd|gdd�}|��S)z9 generate locale name for LC_* environment variables
    �:rz)/usr/share/language-tools/language2localeT)Zuniversal_newlines)�split�
subprocessZcheck_output�rstrip)ZlanguageZ
first_elemZlocalerrr�language2locale)s�r )TT)rrrrr rrrr�<module>s�