%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/hplip/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/hplip/__pycache__/fab.cpython-312.pyc

�

=	f�a��z	�dZdZdZdZddlZddlZddlZddl�ddlm	Z	m
Z
mZddlm
Z
	dd	lmZGd�dej,�Zej0eeeedeefeeef�Zej?ej@�ejCd
��\Z"Z#Z$Z%Z&Z'e&dk(r(e	jP�s>ejSdez�eZ%n'e	jT�sejSdez�eZ%e%ek(�r�e&dk(�r�ejWd�	ddl,�ddl-m.Z.dZ1dZ2e3e/jh�Z1e'�Pe5jmddd�Z'e'jo�dk(r*e8e9ju��Z'ej'de'z�e'jo�dk7r�dZ	e'jwd�\Z<Z=dj}e<eg�Z'ej'de'z�e@d�ZAde<zZBej'deBz�eAj�eBeDj��ZFeFre1j�eA�ndZ'e'dk(rej'd �n^ej'd!e'z�eHj�eHe'��e'eD_:	e:j�e:j�e:j�e'��e.�Z2e2j��e1j�e2�	ej'd"�e1j��e/jad�ye	j�e&�\Z3ZSeeSd#z�ZTejWd$�	e3e/jh�Z1eTj�d�ZVeVj��	ej'd"�e1j��y	dd%lXmXZXe�ZY	eYj��ej�d(�ej�d)�y#e$r"Zej'e�dd
lmZYdZ[���dZ[wwxYw#e$r&ejSd�e/jad�Y���wxYw#e?$re'Z<dj}e'eg�Z'Y��wwxYw#e:j�$rY���wxYw#eQ$rY��swxYw#eQ$re/jad�YywxYw#e$r&ejSd&�e/jad�Y��wxYw#eQ$rejSd'�Y��!wxYw)*z6.0zFax Address Bookzhp-fabz$A simple fax address book for HPLIP.�N)�*)�utils�tui�module)�input)�
import_module)�dyn_import_modc���eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zdd
�Zdd�Zd�ZeZd�Zd�Zd�ZeZd�ZeZd�ZeZd�ZeZd�Zd�ZeZd�Z e Z!d�Z"e"Z#d�Z$d�Z%y)�Consolec��tjj|�d|_t	j
�|_tjd�|_	y)NzBType 'help' for a list of commands. Type 'exit' or 'quit' to quit.z	hp-fab > )
�cmd�Cmd�__init__�intro�fax�FaxAddressBook�db�log�bold�prompt��selfs �/usr/share/hplip/fab.pyrzConsole.__init__6s;���������Z��
��%�%�'����h�h�{�+���c�.�t|j�y)z/Print a list of commands that have been enteredN)�print�_hist�r�argss  r�do_histzConsole.do_hist=s��
�d�j�j�rc��y�zExits from the console����rs  r�do_exitzConsole.do_exitA���rc��yr"r$rs  r�do_quitzConsole.do_quitEr&rc�$�|j|�S)z$Exit on system end of file character)r%rs  r�do_EOFzConsole.do_EOFJs���|�|�D�!�!rc�D�tjj||�y)z�Get help on commands
           'help' or '?' with no arguments prints a list of commands for which help is available
           'help <command>' or '? <command>' gives help on <command>
        N)r
r�do_helprs  rr,zConsole.do_helpNs��	������d�#rc��tjj|�g|_i|_i|_|j
d�y)z�Initialization before prompting user for commands.
           Despite the claims in the Cmd documentaion, Cmd.preloop() is not a stub.
        �N)r
r�preloopr�_locals�_globals�do_listrs rr/zConsole.preloopWs5��	���������
������
����R�rc�X�tjj|�td�y)z�Take care of any unfinished business.
           Despite the claims in the Cmd documentaion, Cmd.postloop() is not a stub.
        z
Exiting...N)r
r�postlooprrs rr4zConsole.postloopbs��	�������
�l�rc�N�|xj|j�gz
c_|S)z� This method is called after the line has been input but before
            it has been interpreted. If you want to modifdy the input line
            before execution (for example, variable substitution) do it here.
        )r�strip�r�lines  r�precmdzConsole.precmdis��
	
�
�
�t�z�z�|�n�$�
��rc��|S)z�If you want to stop the console, return something that evaluates to true.
           If you want to do some post command processing, do it here.
        r$)r�stopr8s   r�postcmdzConsole.postcmdqs	���rc��y)zDo nothing on empty input lineNr$rs r�	emptylinezConsole.emptylinews��rc�.�tjd�y)Nz2Unrecognized command. Use 'help' to list commands.)r�errorr7s  r�defaultzConsole.default{s���	�	�F�Grc��|�s	|r-ttjd��j�}n,ttjd��j�}|j	�dk(rttj
d��y|s|rytjd���|r1|jj|��Htjd���|jj|��tjd���	|S|j�}|r3|jj|��tjd�y|S|jj|��tjd�y|S)	Nz?Enter the name to add to the group (<enter>=done*, c=cancel) ? zEnter name (c=cancel) ? �c�Canceledr.zName must not be blank.z4Name already exists. Please choose a different name.z.Name not found. Please enter a different name.)
rrrr6�lowerr�redr@r�get)rr�
fail_if_match�alt_text�nicknames     r�get_nicknamezConsole.get_nickname~s<�����$�S�X�X�.o�%p�q�w�w�y�H�$�S�X�X�.H�%I�J�P�P�R�H��>�>�#�s�*��#�'�'�*�-�.����!��	�	�";�<� �!��w�w�{�{�8�,�8��	�	�"X�Y� ��w�w�{�{�8�,�4��	�	�"R�S� �����z�z�|�H���7�7�;�;�x�(�4��I�I�T�U����	�7�7�;�;�x�(�0��I�I�N�O���rc��|jj�}|s�	|r-ttj	d��j�}n,ttj	d��j�}|j
�dk(rttjd��y|s|rytjd���|dk(rtd�y|r||vr0tjd	���||vrtjd
���	|S|j�}|r||vrtjd	�y|S||vrtjd
�y|S)Nz4Enter the group to join (<enter>=done*, c=cancel) ? zEnter the group (c=cancel) ? rCrDr.z!The group name must not be blank.�Allz<Cannot specify group 'All'. Please choose a different group.z6Group already exists. Please choose a different group.z0Group not found. Please enter a different group.)
r�get_all_groupsrrrr6rErrFr@)rrrHrI�
all_groups�	groupnames      r�
get_groupnamezConsole.get_groupname�s9���W�W�+�+�-�
���� %�c�h�h�/e�&f� g� m� m� o�I� %�c�h�h�/N�&O� P� V� V� X�I��?�?�$��+��#�'�'�*�-�.�� ��!��	�	�"E�F� ���%��X�Y�� � �J�.��	�	�"Z�[� �!�
�2��	�	�"T�U� �����
�
��I���
�*��I�I�V�W����	�J�.��I�I�P�Q���rc��|rg|j�j�d}|jd�r|jd�y|jd�r|j	d�y|jd�|j	d�y)zl
        List names and/or groups.
        list [names|groups|all|]
        dir [names|groups|all|]
        r�namr.N�gro)r6�split�
startswith�do_names�	do_groups)rr�scopes   rr2zConsole.do_list�sn����J�J�L�&�&�(��+�E����u�%��
�
�b�!������'����r�"���
�
�b�����r�rc
��|jj�}tj|�t	tjd��t
|�dkDr�tj�}d|_	t|j��D]D\}}|jd�r�|j||d|ddj|d�f��F|j�t	�y
t	d	�t	�y
)z+
        List names.
        names
        z
Names:
r)�Namez
Fax Number�Notes�Member of Group(s)�__r�notes�, �groups�(None)N�r�get_all_recordsr�debugrr�lenr�	Formatter�header�list�itemsrV�add�join�output�rr�all_entries�f�name�es      rrWzConsole.do_names�s���
�g�g�-�-�/���	�	�+��
�c�h�h�|�$�%��{��a���
�
��A�L�A�H��� 1� 1� 3�4�
P���a����t�,��E�E�4��5��1�W�:�t�y�y��8��7M�N�O�
P�
�H�H�J�
	��
�(�O�
�rc��|jj�}tj|�t	tjd��t
|�r�tj�}d|_	|D]]}|j|dj|jj|�D�cgc]}|jd�r�|��c}�f��_|j�t	�yt	d�t	�ycc}w)z-
        List groups.
        groups
        z	
Groups:
)�Group�Membersr`r^rbN)rrNrrerrrfrrgrhrkrl�
group_membersrVrm)rrrOrp�group�xs      rrXzConsole.do_groupss���
�W�W�+�+�-�
��	�	�*��
�c�h�h�}�%�&��z�?��
�
��A�+�A�H�#�
o�����u�d�i�i�D�G�G�4I�4I�%�4P�(k�q�XY�Xd�Xd�ei�Xj��(k�l�m�n�
o�
�H�H�J�
	��
�(�O�
���
)ls�-D�Dc	�\�|j|d��}|sy|jj|�}tj	|�ttj
d|z��d}d}d}|d}	ttj
d|z��j�}|j�d	k(rttjd
��y|s|stjd��||s|}d}	|D]}
|
dvs�tjd
�d}	n|	rn��|d}ttj
d|z��j�}|j�d	k(rttjd
��y|s|}|drtd�g}
|dD][}|dk(r�	tjd|zd��\}	}|	s ttjd
��y|s�K|
j|��]td�	|jddd��}|j�d	k(rttjd
��y|sn�|jj!�}||vrStj#d�tjdd��\}	}|	sttjd
��y|s��||dvrtjd���|
j|���|jj%||||||
|�|j'|�t�y)zI
        Edit an name.
        edit [name]
        modify [name]
        F�rHNz!
Edit/modify information for %s:
r.rTz&Fax Number (<enter>='%s', c=cancel) ? rCrD�Fax number must not be empty.�0123456789-(+) *#zOInvalid characters in fax number. Fax number may only contain '0123456789-(+) 'r_z!Notes (<enter>='%s', c=cancel) ? raz
Leave or Stay in a Group:
rMzStay in group %s �*(y=yes* (stay), n=no (leave), c=cancel) ? ��
choice_promptz
Join New Group(s):
�rHrI�Group not found.zIs this a new groupz!(y=yes* (new), n=no, c=cancel) ? �TGroup already specified. Choose a different group name or press <enter> to continue.)rKrrGrrerrrr6rErFr@r�enter_yes_no�appendrQrN�warn�set�do_show)rrrJrr�lastname�	firstname�title�save_faxnum�faxnum�okrC�
save_notesr_�
new_groups�g�ans�	add_grouprOs                  r�do_editzConsole.do_edit)s����$�$�T��$�?�����G�G�K�K��!���	�	�!��
�c�h�h�<�x�G�H�I�@���	�����h����3�8�8�$L�{�$Z�[�\�b�b�d�F��|�|�~��$��c�g�g�j�)�*���+��	�	�9�:���$���B��
���/�/��I�I�o�p��B��	
��5�-�0�w�Z�
��c�h�h�B�Z�O�P�Q�W�W�Y���;�;�=�C���#�'�'�*�%�&����E��X�;��1�2��
��8��	%�A��E�z���&�&�':�Q�'>�J�L�G�B����c�g�g�j�)�*����!�!�!�$�	%�	�&�'���*�*�2�U�T�*�R�I���� �C�'��c�g�g�j�)�*�������/�/�1�J��
�*����+�,��*�*�+@�"E�G���C���#�'�'�*�-�.�����A�h�K�'��	�	�p�q�����i�(�9�<	
�����H�e�Y��&�*�e�T����X��
�rc��|j|d��}|sy|jj|�}g}td�|D]h}|j	d�stjd|zd��\}}n�3|s ttjd	��y|s�X|j|��jtd
�	|jddd�
�}|j�dk(rttjd	��y|j�sn|j|��i|jj||�t�y)zQ
        Edit a group.
        editgrp [group]
        modifygrp [group]
        FrzNz
Existing Names in Group:
r^zShould '%s' stay in this group r}r~rDz
Add New Names to Group:
Tr.r�rC)
rQrrvrrVrr�rrFr�rKrE�
update_groups)	rrrw�old_entries�new_entriesrrr�r�rJs	         r�
do_editgrpzConsole.do_editgrp�s+���"�"�4�u�"�=���f��g�g�+�+�E�2����
�,�-��	&�A��<�<��%��*�*�+L�q�+P�"N�P���C����c�g�g�j�)�*����"�"�1�%�	&�	�+�,���(�(��5�4�(�P�H��~�~��3�&��c�g�g�j�)�*���>�>�#�����x�(��	
�����e�[�1�
�rc	��|j|d��}|syttjd|z��d}d}d}	t	tjd��j�}|j
�dk(rttjd��y|stjd	��wd}|D]}|d
vs�tjd�d}n|rn��t	tjd
��j�}	|	j�j
�dk(rttjd��yg}
|jj�}	t	tjd��j�}|j
�dk(rttjd��y|sn�|dk(rttjd����||vrqtjd�	t	tjd��j
�j�}
|
dvrtjd��U	|
dk(r��||
vrtjd���|
j|���(|
jd�|jj||||||
|	�|j|�y)zD
        Add an name.
        add [name]
        new [name]
        TrzNz
Enter information for %s:
r.zFax Number (c=cancel) ? rCrDr{r|zQInvalid characters in fax number. Fax number may only contain '0123456789-(+) *#'FzNotes (c=cancel) ? z,Member of group (<enter>=done*, c=cancel) ? rMzCannot specify 'All'.r�z%Is this a new group (y=yes*, n=no) ? )r.�n�yz1Please enter 'y', 'n' or press <enter> for 'yes'.r�r�)rKrrrrr6rErFr@rrNr�r�r�r�)rrrJr�r�r�r�r�rCr_rarOr��
user_inputs              r�do_addzConsole.do_add�se���$�$�T��$�>����
�c�h�h�6��A�B�C�(���	�����3�8�8�$>�?�@�F�F�H�F��|�|�~��$��c�g�g�j�)�*����	�	�9�:���B��
���/�/��I�I�q�r��B��	
��5�'�*�c�h�h�4�5�6�<�<�>���;�;�=��� �C�'��#�'�'�*�%�&�����W�W�+�+�-�
���c�h�h�'U�W�X�^�^�`�I���� �C�'��c�g�g�j�)�*�����E�!��c�g�g�5�6�7���
�*����+�,��!&�s�x�x�0W�'X�!Y�!_�!_�!a�!g�!g�!i�J�!��7��	�	�"U�V� ����$���F�"��	�	�p�q���M�M�)�$�C�F	�
�
�e�������H�e�Y��&�&�%�P����X�rc�T�|j|d��}|syg}	|jddd��}|j�dk(rttjd��y|j�sn|j
|��i|jj||�t�y)	zL
        Add a group.
        addgrp [group]
        newgrp [group]
        TrzNr.Fr�rCrD)	rQrKrErrrFr�rr�)rrrw�entriesrJs     r�	do_addgrpzConsole.do_addgrpRs����"�"�4�t�"�<���f�����(�(��5�4�(�P�H��~�~��3�&��c�g�g�j�)�*���>�>�#���N�N�8�$��	
�����e�W�-�
�rc
���|jj�}tj|�t	tjd��t
|�dkDr�tj�}d|_	t|j��D]D\}}|jd�r�|j||d|ddj|d�f��F|j�t	�y	)
z2
        View all name data.
        view
        z
View all Data:
r)r[�Faxr\r]r^rr_r`raNrcrns      r�do_viewzConsole.do_viewos���
�g�g�-�-�/���	�	�+��
�c�h�h�+�,�-��{��a���
�
��A�E�A�H��� 1� 1� 3�4�
P���a����t�,��E�E�4��5��1�W�:�t�y�y��8��7M�N�O�
P�
�H�H�J�
�rc���|j|d��}|sy|jj|�}|r�tj�}d|_|j
d|f�|j
d|df�|j
d|d	f�|j
d
dj|d�f�|j�t�ytjd
�t�y)zW
        Show a name (all details).
        show [name]
        details [name]
        FrzN)�Key�ValuezName:zFax Number:rzNotes:r_zMember of Group(s):r`raz:Name not found. Use the 'names' command to view all names.)rKrrGrrgrhrkrlrmrr@r)rrrqrrrps     rr�zConsole.do_show�s���� � ��U� �;���V��G�G�K�K������
�
��A�'�A�H�
�E�E�7�D�/�"�
�E�E�=�!�E�(�+�,�
�E�E�8�Q�w�Z�(�)�
�E�E�(�$�)�)�A�h�K�*@�A�B�
�H�H�J�
	��
�I�I�R�S�
�rc�z�|j|d��}|sy|jj|�t�y)zE
        Remove a name.
        rm [name]
        del [name]
        FrzN)rKr�deleter)rrrJs   r�do_rmz
Console.do_rm�s3���$�$�T��$�?���������x� �
�rc�z�|j|d��}|sy|jj|�t�y)zN
        Remove a group.
        rmgrp [group]
        delgrp [group]
        FrzN)rQr�delete_groupr)rrrws   r�do_rmgrpzConsole.do_rmgrp�s5���"�"�4�u�"�=���f������U�#�
�rc�@�tjtt�y)z
About fab.N)r�	log_title�	__title__�__version__rs  r�do_aboutzConsole.do_about�s��
���	�;�/rc��|j�j�}|stjd�y|d}t	|�dkDr|dj�}nd}|dvrtjd|z�ytjj|�stjd|z�y|dk(rrtjj|�dj�}|d	k(rd
}n:|dk(rd}n2t|d
�jd�j�}d|vrd
}nd}|dk(r-td|z�|jj|�\}}n0|dvr,td|z�|jj|�\}}s tj�t�y|j!d�t�y)z]
        Import LDIF
        import <filename> [type]
        [type] = vcf|ldif|auto
        z+You must specify a filename to import from.Nr��auto)r��ldif�vcf�vcardzInvalid type: %szFile %s not found.z.vcfr�z.ldifr��rizbegin:vcardzImporting from LDIF file %s...)r�r�zImporting from VCF file %s...r.)r6rUrr@rfrE�os�path�exists�splitext�open�readrr�import_ldif�import_vcardr2)rr�filename�typ�ext�headr��	error_strs        r�	do_importzConsole.do_import�s����z�z�|�!�!�#����I�I�C�D����7���t�9�q�=��q�'�-�-�/�C��C��6�6��I�I�(�3�.�/���w�w�~�~�h�'��I�I�*�X�5�6���&�=��'�'�"�"�8�,�Q�/�5�5�7�C��f�}���������H�c�*�/�/��5�;�;�=�� �D�(��C� �C��&�=��2�X�=�>� �G�G�/�/��9�M�B�	�
�$�
$��1�H�<�=� �G�G�0�0��:�M�B�	���I�I�i� �	��
�L�L���
�rN)TF)&�__name__�
__module__�__qualname__rr r%r(r*r,r/r4r9r<r>rArKrQr2�do_dirrWrXr��	do_modifyr��do_modifygrpr��do_newr��	do_newgrpr�r��
do_detailsr��do_delr��	do_delgrpr�r�r$rrrr4s���,����
"�$�	����
�H�-�`3�j�*�F��0�.H�T�I�-�^�L�d�N�F��4�I��0�8�J���F���I�0�5rrF)�handle_device_printer�qt3zU%s GUI mode requires GUI support (try running with --qt4). Entering interactive mode.zU%s GUI mode requires GUI support (try running with --qt3). Entering interactive mode.zhp-fab(qt3))�FaxAddrBookFormz,Unable to load Qt3 support. Is it installed?r��ui�loc�systemzUsing system locale: %srC�utf8�.z&Trying to load .qm file for %s locale.zhplip_%s.qmzName of .qm file: %szUsing default 'C' localezUsing locale: %szStarting GUI loop...z
.fabwindowzhp-fab(qt4))rz1Fax address book disabled - Python 2.3+ required.z
User exit.r.zDone.)\r�r��__mod__�__doc__r
�getoptr��base.g�baserrr�base.sixext.movesr�	importlibr�ImportErrorrrrre�
base.utilsr	rr�Module�GUI_MODE�INTERACTIVE_MODE�UI_TOOLKIT_QT3�UI_TOOLKIT_QT4�UI_TOOLKIT_QT5�mod�setUsage�USAGE_FLAG_NONE�parseStdOpts�opts�
device_uri�printer_name�mode�
ui_toolkitr��canEnterGUIModer@�canEnterGUIMode4�
set_module�qt�ui.faxaddrbookformr��sys�exit�app�addrbook�QApplication�argv�	user_confrGrE�str�
QTextCodec�localerU�lrxrl�
ValueError�QTranslator�trans�qm_file�load�prop�localization_dir�loaded�installTranslator�QLocale�
setDefault�	setlocale�LC_ALL�	normalize�Error�show�
setMainWidget�	exec_loop�KeyboardInterrupt�
import_dialog�
ui_packager��	FABWindow�fab�exec_r�console�cmdloop�infor$rr�<module>rs���.���	�
��
0���
�	��#�#�#�;�'�I�c�g�g�I�\�f�m�m�G�Y��W�d��/�0�#�^�^�D�F�����V�
#�
#�$����5��1�6��j�,��j�#���� �5� � �"��	�	�i�ls�s�t���!�5�!�!�#��	�	�i�ls�s�t����8���U�����}�%�	��:�
�����3�8�8�$���;��-�-��e�X�6�C��y�y�{�h�&��*�+�+�-�.���	�	�3�c�9�:��9�9�;�#���A�
)��y�y��~���1��h�h��1�v�&��

�I�I�>��D�E���%�E�#�a�'�G��I�I�,�w�6�7��Z�Z���)>�)>�?�F���%�%�e�,����#�:��I�I�0�1��I�I�(�3�.�/����w�s�|�,��D�K�
�� � �����0@�0@��0E�F�#�$���
�
�����(�#�	��I�I�,�-��M�M�O�	�����$7�5�#6�#6�z�#B� ��j�
�:��4�
5��	���}�%���s�x�x�(�C��,�,�t�$�C��H�H�J�
��	�	�0�1��	�	�����i�G� ������H�H�R�L��H�H�W���e�;��I�I�a�L�:�:��;��d�	��I�I�D�E��H�H�Q�K�	��(�
)����h�h��Q�x�(��
)��0�<�<�
��
��!�	��	��*%�
������
�����	�	�E�F��������� ��	�	�,�� �s��N;�	O%�'P�*+P4�>!Q
�!Q�:Q2�R �;O"�O�O"�%'P�P�P1�0P1�4Q�Q�
Q�Q�Q/�.Q/�2'R�R� R:�9R:

Zerion Mini Shell 1.0