HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/LanguageSelector/__pycache__/ImConfig.cpython-310.pyc
o

�Rb��@s�ddlZddlZddlZGdd�de�ZedkrGe�Zede���ede�	��ed�e�
d�ede�	��ed	�e�
d
�dSdS)�Nc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�ImConfigcCsdS)N���selfrr�;/usr/lib/python3/dist-packages/LanguageSelector/ImConfig.py�__init__
szImConfig.__init__cCstj�d�S)Nz/usr/bin/im-config)�os�path�existsrrrr�	availableszImConfig.availablecCs(tt�ddg������}|�d�|S)N�	im-configz-l�none)�sorted�
subprocess�check_output�decode�split�append)r�inputMethodsrrr�getAvailableInputMethodss
z!ImConfig.getAvailableInputMethodscCs�t�ddg�����dd�\}}}|dkr|S	d}|dkr"|}ntj�d�r<td�D]}|�d�r;|��d	}nq,|s@|}|S)
Nrz-m��missing��defaultz/etc/X11/xinit/xinputrc�run_im�)	rrrrrr	r
�open�
startswith)r�systemConfig�
userConfig�
autoConfig�system_conf�linerrr�getCurrentInputMethods"�
�zImConfig.getCurrentInputMethodcCst�dd|g�dS)Nrz-n)r�call)r�imrrr�setInputMethod.szImConfig.setInputMethodN)�__name__�
__module__�__qualname__rrrr#r&rrrrrsr�__main__zavailable input methods: %szcurrent method: %szsetting method 'fcitx'�fcitxzremoving ~/.xinputrc�REMOVE)rr�locale�objectrr'r%�printrr#r&rrrr�<module>s&
�