%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/ibus-table/engine/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/ibus-table/engine/__pycache__/factory.cpython-312.pyc

�

��Xe&����ddlmZddlmZddlZddlZddlZddlmZd�Zd�Z	ddl
mZedd	�dd
lm
Z
ddlZddlZej d�Zed�aGd�d
e
j(�Zy)�)�Dict)�OptionalN��dgettextc��td|�S)N�
ibus-tabler��as �'/usr/share/ibus-table/engine/factory.py�<lambda>rs
��h�|�Q�'��c��|S)N�r	s rrrs��q�r
)�require_version�IBusz1.0)rrc�v��eZdZdZd
dej
deddf�fd�
Zdedejfd�Z
d�fd	�Z�xZS)�
EngineFactoryzTable IM Engine Factory�bus�db�returnNc���	tttjd���atdkDrtjd||�d|_	i|_
|r�tjj|�jdd�|_tjj|�jdd�}tj ||��|_	|jjj#�|j|ji|_
||_t&�|�Q|j+�t,j.�	�d|_d|_y#t
tf$rtd�aY��PwxYw)
N�IBUS_TABLE_DEBUG_LEVELr�z&EngineFactory.__init__(bus=%s, db=%s)
�.db��-user.db��filename�user_db)�
connection�object_path)�int�str�os�getenv�DEBUG_LEVEL�	TypeError�
ValueError�LOGGER�debugr�dbdict�path�basename�replace�dbusname�tabsqlitedb�TabSqliteDb�commitr�super�__init__�get_connectionr�PATH_FACTORY�	engine_id�engine_path)�selfrr�udb�	__class__s    �rr4zEngineFactory.__init__+s)���	!��c�"�)�)�,D�"E�F�G�K���?��L�L�B�C��L�59���:<���
��G�G�,�,�R�0�8�8���C�D�M��'�'�"�"�2�&�.�.�u�j�A�C�!�-�-�r�3�G�D�G��G�G�J�J�����=�=����1�D�K����
���C�$6�$6�$8�%)�%6�%6�	�	8��������'�:�&�	!��a�&�K�	!�s�'E�E;�:E;�engine_namec�^�tdkDrtjd|�tjdd|�}d}tj
d�}||j	d|�z|_	|j�s+||jv�rd}tjd	�r<tjjttjd	��d
�}tjj||dz�}|dz}tjj|�sBtjjd
�}tjj||dz�}t!j"||��}|jj%�||j|<t'j(|j*|jt|j,�z|j|�}	|xj,dz
c_|	S#tj/d|�t1d|z��xYw)Nrz/EngineFactory.do_create_engine(engine_name=%s)
z^table:rz)/com/redhat/IBus/engines/table/%s/engine/z[^a-zA-Z0-9_/]�_z/usr/share/ibus-table/tables�IBUS_TABLE_LOCATION�tablesrrz~/.ibus/byo-tablesrzfailed to create engine %szCannot create engine %s)r&r)r*�re�sub�compiler8rr+r$r%r,�joinr#�exists�
expanduserr0r1r2�table�	TabEnginerr7�	exception�	Exception)
r9r<�engine_base_path�	path_patt�db_dirrr:�
byo_db_dir�_sq_db�engines
          r�do_create_enginezEngineFactory.do_create_engineDs�����?��L�L�B��
��f�f�Z��[�9��F���J�J�0�1�	�+�i�m�m�C��.M�M���	D��7�7�"�d�k�k�1�;�F��y�y�!6�7�!#�������	�	�*?� @�A�8�"M�������f�k�%�.?�@�B�%�j�0�C��7�7�>�>�"�-�%'�W�W�%7�%7�8L�%M�
��W�W�\�\�*�k�E�6I�J��(�4�4�b�#�N�F��I�I�$�$�&�/5�D�K�K��,��_�_�T�X�X�%)�%5�%5��D�N�N�8K�%K�%)�[�[��%=�?�F�
�N�N�a��N��M��	D����9�;�G��5�{�B�C�C�s
�)FH�&H,c���tdkDrtjd�|jD]}|j|j	��!t
�|��y)z*Destructor, which finish some task for IMErzEngineFactory.do_destroy()
N)r&r)r*r+�
sync_usrdbr3�destroy)r9�_dbr;s  �r�
do_destroyzEngineFactory.do_destroyhsM�����?��L�L�7�8��;�;�	*�C��K�K���'�'�)�	*�	���r
)r)rN)
�__name__�
__module__�__qualname__�__doc__r�Busr#r4rGrHrQrV�
__classcell__)r;s@rrr)sI���!��D�H�H��#��t��2"D�C�"D�E�O�O�"D�H	�	r
r)�typingrrr$rA�logging�gettextrr>�N_�gir�
gi.repositoryrrGr0�	getLoggerr)r"r&�Factoryrrr
r�<module>resf��.��	�	���'������������	��	�	�<�	(���!�f��H�D�L�L�Hr

Zerion Mini Shell 1.0