%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/LanguageSelector/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/LanguageSelector/__pycache__/LangCache.cpython-312.pyc

�

k�!f;�	��ddlmZddlZejdde�ddlZddlZGd�de�ZGd�de�Z	Gd	�d
e
�ZGd�dej�Z
ed
k(rqddlmZdZede�Ze
eej$j'��Zed�edj-ej/�D�cgc]}d|z��	c}��yycc}w)�)�print_functionN�ignorezapt API not stable yetc��eZdZd�Zd�Zy)�LanguagePackageStatusc�J�||_||_d|_d|_d|_y)NF)�languageCode�pkgname_template�	available�	installed�doChange)�selfr�pkg_templates   �</usr/lib/python3/dist-packages/LanguageSelector/LangCache.py�__init__zLanguagePackageStatus.__init__
s'��(��� ,�����������
�c��d|j�d|j�dt|j��dt|j��dt|j
���
S)Nz LanguagePackageStatus(langcode: z
, pkgname z
, available: z
, installed: z, doChange: )rr	�strr
rr�r
s r�__str__zLanguagePackageStatus.__str__s?���!�!�4�#8�#8�#�d�n�n�:M��D�N�N�#�S����%7�9�	9rN)�__name__�
__module__�__qualname__rr�rrrr	s���9rrc�Z�eZdZdd�Zed��Zed��Zed��Zed��Zd�Z	y)	�LanguageInformationNc��||_||_i|_t|d�|jd<|jj	�D];}|j
|z}||v|_|js�(||j|_�=y)Nzlanguage-pack-%s�languagePack)	r�language�languagePkgListr�valuesr	r
�is_installedr)r
�cacherr�langpkg_status�pkgnames      rrzLanguageInformation.__init__s���)��� ��
�!���/D�\�Se�/f����^�,�"�2�2�9�9�;�	G�N�$�5�5��D�G�'.�%�'7�N�$��'�'�+0��>�+F�+F��(�		Grc�6�|js
|jsyy)zK returns True if only parts of the language support packages are installed TF)�notInstalled�
fullInstalledrs r�inconsistentz LanguageInformation.inconsistent)s���!�!�$�*<�*<�t�rc���|jj�D]B}|js�|jr
|js�)|js
|jr�Byy)zM return True if all of the available language support packages are installed FT�rr r
rr�r
�pkgs  rr'z!LanguageInformation.fullInstalled.sQ���'�'�.�.�0�	q�C��=�=�8��]�]�3�<�<����SV�S_�S_�kp�	q�rc���|jj�D]B}|js�|js
|js�)|jr
|jr�Byy)zN return True if none of the available language support packages are installed FTr*r+s  rr&z LanguageInformation.notInstalled5sQ���'�'�.�.�0�	q�C��=�=�8����s�|�|����SV�S_�S_�kp�	q�rc�^�|jj�D]}|js�yy)zM returns true if anything in the state of the language packs/support changes TF)rr rr+s  r�changeszLanguageInformation.changes<s.���'�'�.�.�0�	,�C����t�	,�rc�:�|j�d|j�d�S)Nz (�))rrrs rrzLanguageInformation.__str__Bs�� �M�M�4�+<�+<�=�=r)NN)
rrrr�propertyr(r'r&r/rrrrrrs]��G�"����������������
>rrc��eZdZy)�ExceptionPkgCacheBrokenN)rrrrrrr4r4Fs��rr4c�:�eZdZd�Zed��Zd�Zd�Zd�Zd�Z	y)�LanguageSelectorPkgCachec���tjj||�|jjdkDr
t��||_tj|�|_	y)Nr)
�apt�Cacher�	_depcache�broken_countr4�_localeinfo�language_support_pkgs�LanguageSupport�lang_support)r
�
localeinfo�progresss   rrz!LanguageSelectorPkgCache.__init__KsL���	�	���4��*��>�>�&�&��*�)�+�+�%���1�A�A�$�G��rc�8�|jjD]�}|jD]p}|jd�j	d�r�$|jd�j	d�r�E|j
dk7r�U|js�b|js�oy��y)z, verify that a network package lists exists �zcdrom:zhttp://security.ubuntu.comzDebian Package IndexTF)�_list�list�index_files�archive_uri�
startswith�label�exists�has_packages)r
�	metaindex�	indexfiles   r�havePackageListsz)LanguageSelectorPkgCache.havePackageListsRs��������		 �I�&�2�2�
 �	��(�(��,�7�7��A���(�(��,�7�7�8T�U���?�?�&<�<���#�#�	�(>�(>��
 �		 �rc�8�|jj�y)z clear the selections N)r:�initrs r�clearzLanguageSelectorPkgCache.clearas�������rc���g}g}|j�D]]}|js|jr|j|j�|j
s�C|j|j��_||fS)N)�get_changes�marked_install�marked_upgrade�append�name�
marked_delete)r
�to_inst�to_rmr,s    r�getChangesListz'LanguageSelectorPkgCache.getChangesListesj�������#�#�%�	'�C��!�!�S�%7�%7����s�x�x�(�� � ����S�X�X�&�		'�
���rc���|jj�D]�\}}|js�|jj	|j
|j��}	|jrK|D]E}|jd�s|jd|j
z�s�3||j��Gn|D]}||j����y#t$rt��wxYw)z$ commit changed status of list items)rzlanguage-pack-�-N)
r�itemsrr?�	by_localerrrH�endswith�mark_delete�mark_install�SystemErrorr4)r
�li�key�item�pkgsr$s      r�tryChangeDetailsz)LanguageSelectorPkgCache.tryChangeDetailsos����-�-�3�3�5�	4�K�S�$��}�}��(�(�2�2�2�?�?�d�n�n�2�]��4��~�~�(,�<�G�&�1�1�2B�C�&�/�/��b�o�o�0E�F� $�W�
� 9� 9� ;�<�
(,�9�G� ��M�6�6�8�9��	4��#�4�1�3�3�4�s� AC�!0C�C(c� �g}|jjj�D]_\}}|dk(r�t|||�}|jj�D�cgc]}|js�|��c}s�O|j|��a|Scc}w)z5 returns a list with language packs/support packages �zh)r<�_langr^rrr r
rV)r
�res�code�langrd�ss      r�getLanguageInformationz/LanguageSelectorPkgCache.getLanguageInformation�s����� �,�,�2�2�8�8�:�	�L�T�4��t�|��$�T�4��6�B��-�-�4�4�6�F�a�!�+�+��F��
�
�2��	��
��Gs�B�.BN)
rrrrr2rNrQr[rhrprrrr6r6Is0��H�������4�*
rr6�__main__)�
LocaleInfoz/usr/share/language-selector�languagelistzavailable language informationz, z%s)�
__future__r�warnings�filterwarnings�
FutureWarningr8r=�objectrr�	Exceptionr4r9r6rrr�datadirrdrA�
OpProgress�lc�print�joinrp)�xs0r�<module>r�s���%�������":�M�J�
��9�F�9�,>�&�,>�^	�i�	�E�s�y�y�E�P�z��%�,�G�	�N�G�	,�B�	!�"�S�\�\�%<�%<�%>�	?�B�	�
*�+�	�$�)�)�b�&?�&?�&A�B��T�1�W�B�
C�D���Cs�;C

Zerion Mini Shell 1.0