%PDF- %PDF-
Mini Shell

Mini Shell

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

�

=	f���ddl�ddlZddlZddlZddlZddlZddlZddlZgZ	ddlZejejdf�ejejdf�	ddlZejejdf�ejejdf�ejejdf�	ddlZejej"df�ejej$df�ejej&df�	ddlZejej*d	f�ejd
�ejd�eeD��cgc]
\}}e|���c}}�Zd�Zej4d
�Zej4d�Zej4d�Zd�Zd�Zd�Z d�Z!gd�Z"d�Z#d�Z$d�Z%Gd�de&�Z'Gd�d�Z(Gd�d�Z)Gd�d�Z*d �Z+d!�Z,d"�Z-e,e-fZ.d#�Z/d$�Z0dNd%�Z1dOd&�Z2dPd'�Z3dQd(�Z4d)�Z5d*�Z6d+�Z7d,�Z8d-d.d/d0d1d2d3d4�Z9d5�Z:d6�Z;dPd7�Z<d8�Z=d9�Z>d:�Z?d;�Z@d<ZAdRd=�ZBe,dd>e3e4e7e8e:e;e<d?�
ZCeCj��ZEe-eEd@<dAeEdB<eEj��ZFe5eFdC<eEj��ZGdDeGdE<eGj��ZHeHdC=eHj�e=e>e?e@dF��dGeCdH�dIeEdH�dJeFdH�dKeGdH�dLeHdH�dM�ZJy#Y���xYw#Y��0xYw#Y���xYw#Y���xYwcc}}w)S�)�*�N�utf_64�utf_32�utf_16�	utf_16_be�	utf_16_le�utf_8)zBEGIN:VCARDr)zBEGIN:VCARDr	c��t|d�S)z�This function detects unicode byte order markers and if present
    uses the codecs module instead to open the file instead with
    appropriate unicode decoding, else returns the file using standard
    open function�rtU)�open)�names �/usr/share/hplip/base/vcard.py�opentextfilerZs����e���z[^0-9]*z^[0-9]{10}$z
^[0-9]{7}$c��|S�N)�join�re�split�
_notdigits�len)�n�numss  r�phonenumber_normaliserps	��
�Hrc��tjt|��d|dd�d|dd�d|dd��Stjt|��
|dd�d|dd��S|S)N�(r�z) ��-)r�match�
_tendigits�_sevendigits)rs r�phonenumber_formatr$}s_��	�x�x�
�A��*� ��1�v�q��1�v�q���u�5�5�	���,��	"�	.��2�A���!�"��&�&��Hrc�D�t|�}|r|S|jdd�S)z>like L{formatname}, except we use the first matching component�nickname�)�nameparser_getfullname�get)r�	_fullnames  r�nameparser_formatsimplenamer+�s&��&�t�,�I�����8�8�J��#�#rc�t�d|vr|dSdjt|�D�cgc]}|s�|��	c}�Scc}w)z>Gets the full name, joining the first/middle/last if necessary�full� )r�nameparser_getparts)r�xs  rr(r(�s8��
��~��F�|���8�8� 3�D� 9�?�1�Q�Q�?�@�@��?s�5�5)�van�von�de�dic�T�|jd�}|j�}t|�dkr|ddfSt|�dk(r|dd|dfS|dg}g}|dg}|d=|d=t|�r�|ddj�|ddk(s|dj�tvrQ|dg|z}|d=t|�r:|ddj�|ddk(r�7|dj�tvr�Q|}dj|�dj|�dj|�fS)Nr-rr'�r���r.)r)rr�lower�	lastpartsr)rr�parts�f�m�ls      r�nameparser_getparts_FMLr>�s=�������A�
�G�G�I�E��5�z�Q���2�r�{���5�z�Q���a��"�e�A�h�'�'�
�q��
�A�
�A�	�r���A�
�a��
�b�	�

�e�*�%��)�A�,�,�,�.�%��)�A�,�>�%��)�/�/�BS�W`�B`�
�2�Y�K��M���"�I��e�*�%��)�A�,�,�,�.�%��)�A�,�>�%��)�/�/�BS�W`�B`�	�A�
�H�H�Q�K����!��c�h�h�q�k�2�2rc��|jd�}|jd�}t|�dkr|ddfS|d}d}d}|dj�}t|�dk\r'|d}t|�dkDrdj|dd�}|||fS)Nr-�,rr'rr.)r)rrr)rrr:�_last�_first�_middles      r�nameparser_getparts_LFMrD�s��������A�
�G�G�C�L�E�
�5�z�Q���2�r�{���!�H�E�
�F��G��!�H�N�N��E�
�5�z�Q���q����u�:��>��h�h�u�Q�R�y�)�G��G�U�#�#rc��dD]=}||vs�|jdd�|jdd�|jdd�fcSd|vr|jdd�ddfS|jd�}d|vrt|�St|�S)	zfReturns (first, middle, last) for name.  If the part doesn't exist
    then a blank string is returned)�first�middle�lastrFr'rGrHr-r&r@)r)�nameparser_getrDr>)r�irs   rr/r/�s���
)�Y����9��H�H�W�b�)�4�8�8�H�b�+A�4�8�8�F�TV�CW�X�X�Y�
�T������R�(�"�b�1�1����F�#�A�
�a�x�&�t�,�,�"�4�(�(rc��eZdZy)�VFileExceptionN)�__name__�
__module__�__qualname__�rrrLrL�s��rrLc�>�eZdZddiZd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
y
)�VFile�	MACINTOSH�	MAC_ROMANc� �||_d|_yr)�source�saved)�selfrVs  r�__init__zVFile.__init__s�������
rc��|SrrP�rXs r�__iter__zVFile.__iter__����rc�"�|j�Sr��__next__r[s r�nextz
VFile.next
����}�}��rc� �	|j�}|�
t��t|�dk7rn�,d}|jd�}|dkDr|d|j	�jd�}d|vsd|vrUd}|dd	k(s|d
d	k(rC|dd	k(rd}nd
}|j�}|ddvr|dd}|d||z}|dd	k(r�:|d
d	k(r�C|rL|j
�}|�n9t|�dk(rn*|dd
k7r	|ddk7rn||j�ddz
}|r�L|jd�}|dkr(tjd|z�t|�}|dz
}|d|}||dzdj�}|j�jd�}	g}
t|t�rd}nd}|	D]�}|jd�r
|ddxsd}�|jd�s|dk(s|
j|��F	|dk(s|dk(rtj |�}n+|dk(rt#j |�}d}nt%d|z����t|
�dk(rt%d|����|�;	t)j*|j,j/||��}
|
|�\}}|
dgk(s|
d gk(r|j�}|
|fS#t&$r5}t|t$�r|�t%dt|��d|�d|�d���d}~wwxYw#t0$rt%d|�d|����wxYw)!NTr�:�;zquoted-printablezencoding=quoted-printableFr7�=���)�	r.rr.rhzFixing up bad line: %szLATIN-1zCHARSET=�z	ENCODING=zQUOTED-PRINTABLE�ENCODING=QUOTED-PRINTABLEz
ENCODING=Bzunknown encoding: z
Exception z while processing encoding z
 on data '�'zLine contains no property: zunknown character set 'z' in parameters �BEGIN�END)�_getnextline�
StopIterationr�findr8r�
_lookahead�log�debug�strip�upper�
isinstance�str�
startswith�append�quopri�decodestring�base64rL�	Exception�codecs�
getdecoder�_charset_aliasesr)�LookupError)rX�line�normalcontinuations�colon�srJ�nextl�nextline�b4�items�newitems�charset�e�decoder�_s               rr`zVFile.__next__
s�����$�$�&�D��|�#�o�%��4�y�A�~���#���	�	�#����1�9��V�e��"�"�$�*�*�3�/�A�!�Q�&�*E��*J�&+�#��2�h�#�o��b��S���B�x�3������ �-�-�/�E��Q�x�;�.��a�b�	�����8�E�>�D��2�h�#�o��b��S��"����(�H�����8�}��!�����s�"�x��{�d�':���D�%�%�'���+�+�D�"��	�	�#����1�9�
�I�I�.��5�6���I�E��C�K�D�
�&�5�\���E�!�G�H�~�#�#�%�����
� � ��%�����d�C� ��G� �G��	s�A��|�|�J�'��A�B�%�,�9����<�<��,�Q�8J�5J�����"��
s��*�*�a�3N�.N�!�.�.�t�4�D��,�&�!�.�.�t�4�D�"�G�)�)=�a�)?�@�@��1	s�B�x�=�A�� �D�!J�K�K���
d� �+�+�D�,A�,A�,E�,E�g�w�,W�X�� �����Q���y� �H���$7��:�:�<�D���~���+�
s��a��/��G�$�ad�ef�ag�ij�lp�%q�r�r��
s���
d�$�V]�_a�%b�c�c�
d�s%�+AJ1�:K2�1	K/�:0K*�*K/�2L
c�d�|j�|j}d|_|S|j�Sr�rW�_readandstripline�rXr�s  rrnzVFile._getnextline�s0���:�:�!��:�:�D��D�J��K��)�)�+�+rc��|jj�}|�1t|�dk(ry|dddk(r|ddS|ddk(s|ddk(r|ddS|S)Nrrg�
r7�
�
)rV�readlinerr�s  rr�zVFile._readandstripline�sj���{�{�#�#�%�����4�y�A�~���b�c��f�$��C�R�y� ��b��T�!�T�"�X��%5��C�R�y� ��rc�`�|j�J�|j�|_|jSrr�r[s rrqzVFile._lookahead�s,���z�z�!�!�!��+�+�-��
��z�z�rN)rMrNrOr�rYr\rar`rnr�rqrPrrrRrR�s4���[�
���
��r�j,��rrRc�(�eZdZdZd�Zd�Zd�Zd�Zy)�VCardszUnderstands vcards in a vfilec��||_yr)�vfile)rXr�s  rrYzVCards.__init__�s	����
rc��|SrrPr[s rr\zVCards.__iter__�r]rc�"�|j�Srr_r[s rrazVCards.next�rbrc� �dx}}|jD]\}}||fdgdfk7r�d}n||fdgdfk7r
t��g}|jD]$\}}||fdgdfk7r|j||f��$n||fdgdfk7rtd��t	|�S)Nrl�VCARDTrmz'There is a BEGIN:VCARD but no END:VCARD)r�roryrL�VCard)rX�field�value�found�liness     rr`zVCards.__next__�s��������:�:�	�K�E�%��e�}�'��G� 4�4���E��	�
�%�=�g�Y��0�0��/�!����:�:�	�K�E�%��e�}�%��'� 2�2����u�U�m�-���	�
�%�=�e�W�g�.�.� �!J�K�K��U�|�rN)rMrNrO�__doc__rYr\rar`rPrrr�r��s��#����rr�c��eZdZdZd�Zd�Zd"d�Zd�Zd�Zd�Z	d�Z
e
Ze
Ze
Z
e
Ze
Ze
Ze
Ze
Ze
Ze
Zd	�Zd
�Zd�Zd�Zd
�Zd�ZeZd�ZeZd�Zd�Zd�Z d�Z!d#d�Z"d#d�Z#d�Z$d�Z%e$Z&d�Z'd�Z(d�Z)d�Z*d$d�Z+d�Z,d�Z-d�Z.d �Z/y!)%r�zA single vcardc��d|_d|_i|_i|_g|_|D�];\}}t|�sJ�|dgk(rd|_|dj
d�r/|djd�s|djd�rd|_t|�r9|djd	�|djd
�cxkDrdk\r
nnd|_	|dgk(r2|jd�}	|D�cgc]
}t|���}}||_��|ddk(rddg|ddn/|ddk(rddg|ddn|ddk(rddg|ddn|ddk(rddg|dd|jj||f���>|j|j|j�|j!|j�ycc}w#t$rt|d
z��wxYw)N)r6rzX-EVOLUTION-FILE-AS�	evolutionr�ITEMz.X-ABADRz
.X-ABLABEL�applez>!$_z_$!<�VERSION�.z is not a valid vcard versionzHOME.TEL�TEL�HOMErz
HOME.LABEL�LABELzWORK.TEL�WORKz
WORK.LABEL)�_version�_origin�_data�_groupsr�rrx�endswithrp�originr�int�
ValueErrorrLry�_parse�_update_groups)rXr�r;�v�ver�xxs      rrYzVCard.__init__�s�����
������
������
��$	'�C�A�a��q�6�M�6��*�+�+�*�����t���v�&�A�a�D�M�M�*�,E��1����Wc�Id�&����1�v�!�A�$�)�)�F�+�a��d�i�i��.?�D�1�D�%����Y�K���g�g�c�l��L�-0�1�r�3�r�7�1�C�1�!$��
����t�z�!�����!�A���1���%�!�6�*��!�A���1���#�����!�A���1���%�!�6�*��!�A���J�J����!�u�&�I$	'�L	
���D�J�J��
�
�+����D�J�J�'��12��!�L�(��+J�)J�K�K�L�s�&F,�*F'�<F,�'F,�,Gc��|jS)z2Returns a dict of the data parsed out of the vcard�r�r[s r�getdataz
VCard.getdatas���z�z�rc�:�|jj||�Sr)r�r))rX�key�defaults   rr)z	VCard.gets���z�z�~�~�c�7�+�+rc�r�||vr|Stdd�D]"}|t|�z|vs�|t|�zcSy)z�Returns the fieldname to use in the dict.

        For example, if name is "email" and there is no "email" field
        in dict, then "email" is returned.  If there is already an "email"
        field then "email2" is returned, etcr6韆N)�range�repr)rXr�dictrJs    r�
_getfieldnamezVCard._getfieldnamesD���t���K��q���	$�A��D��G�|�4�'��D��G�|�#�	$rc��|D]�\}}t|j��dk(r�#d|dvr|d|djd�dzd}n|d}|jdd�}t	|d|z|j
�}||||���y)Nrr�rr r��_field_)rrtrp�replace�getattr�_default_field)rXr��resultr�r�r;�t�funcs        rr�zVCard._parses��� �	'�K�E�%��5�;�;�=�!�Q�&���e�A�h���!�H�U�1�X�]�]�3�/��1�2�3���!�H���	�	�#�s�#�A��4��1��d�.A�.A�B�D����v�&�	'rc��t|jj��D]\}}|j|g|����y)zUpdate the groups info N)�listr�r��	_setvalue)rXr��kr�s    rr�zVCard._update_groups's:������*�*�,�-�	'�C�A�a��D�N�N�6�&�A�&�	'rc��yrrP�rXr�r�r�s    r�
_field_ignorezVCard._field_ignore/s��rc�L�|j|�||jd|�<y)Nr��unquoter�r�s    r�	_field_FNzVCard._field_FNAs"��59�\�\�%�5H��t�!�!�&�&�1�2rc�L�|j|�||jd|�<y)N�titler�r�s    r�_field_TITLEzVCard._field_TITLEE�"��6:�l�l�5�6I��t�!�!�'�6�2�3rc�L�|j|�||jd|�<y)Nr&r�r�s    r�_field_NICKNAMEzVCard._field_NICKNAMEIs"��9=���e�9L��t�!�!�*�f�5�6rc�L�|j|�||jd|�<y)N�notesr�r�s    r�_field_NOTEzVCard._field_NOTENr�rc�,�|j|�|d<y)N�uid)r�r�s    r�
_field_UIDzVCard._field_UIDRs�����U�+��u�
rc���|j|�}dx}x}x}x}}	|d}|d}|d}|d}|d}|� t|�r|||jd|�<|� t|�r|||jd|�<|� t|�r|||jd|�<|� t|�r|||jd	|�<|�"t|�r|||jd
|�<yyy#t$rY��wxYw)Nrrr6r�z	last namez
first namezmiddle name�prefix�suffix)�splitandunquote�
IndexErrorrr�)	rXr�r�r��
familyname�	givenname�additionalnames�honorificprefixes�honorificsuffixess	         r�_field_NzVCard._field_NZs4���$�$�U�+��[_�_�
�_�Y�_��_�3D�GX�	��q��J��a��I�#�A�h�O� %�a��� %�a����!�c�*�o�>H�F�4�%�%�k�6�:�;�� �S��^�?H�F�4�%�%�l�F�;�<��&�3��+?�@O�F�4�%�%�m�V�<�=��(�S�1B�-C�;L�F�4�%�%�h��7�8��(�S�1B�-C�;L�F�4�%�%�h��7�8�.D�(���	��	�s�C#�#	C/�.C/c��|j|�}t|�r|d||jd|�<|ddD]}|||jd|�<�y)Nr�organisationrzorganisational unit)r�rr�)rXr�r�r�r;s     r�
_field_ORGzVCard._field_ORGysc���$�$�U�+���u�:�AF�q��F�4�%�%�n�f�=�>��q�r��	J�A�HI�F�4�%�%�&;�V�D�E�	Jrc�h�|j|�}g}|ddD]E}|jd�r|td�djd�}n|g}|j	|��Gd}|D]}|dk(rd}|dk(rd}|dk(s�yd	|v}	|�|j|d
||	�y||d�}
|j|d
|
|	�y)Nr�TYPE=r@r��homer��business�X400�PREF�email)r��type�r�rxrr�extendr��rXr�r�r��typesr;�ffrr��	preferred�addrs           r�_field_EMAILzVCard._field_EMAIL�s������U�#�����q�r��	�A��|�|�G�$��s�7�|�}�%�+�+�C�0���S���L�L���
	����	�A��F�{����F�{����F�{��	��e�O�	��<��N�N�6�7�E�9�=�"�D�1�D��N�N�6�7�D�)�<rc�\�|j|�}g}|ddD]E}|jd�r|td�djd�}n|g}|j	|��Gd}|D]}|dk(rd}|dk(s�d}�d|v}	|�|j|d	||	�y||d
�}
|j|d	|
|	�y)Nrr�r@r�r�r�r�r��url)r
rrrs           r�
_field_URLzVCard._field_URL�s������U�#�����q�r��	�A��|�|�G�$��s�7�|�}�%�+�+�C�0���3���L�L���
	����	 �A��F�{����F�{���	 ��e�O�	��<��N�N�6�5�%��;� �$�/�D��N�N�6�5�$�	�:rc��d|dvr|dd|djd�}nd}|�tjd�y|j|ddt	|�i|d�y)Nr�rzspeeddial has no group�phone�	speeddialF)rprrrs�_setgroupvaluer�)rXr�r�r��groups     r�_field_X_SPEEDDIALzVCard._field_X_SPEEDDIAL�sf���%��(�?��!�H�0�e�A�h�m�m�C�0�1�E��E��=�
�I�I�.�/������;��E�
�1L� %�u�
.rc��|j|�}d|dvr|dd|djd�}nd}g}|ddD]E}|jd�r|td�dj	d�}n|g}|j|��Gdddddd�}|D�	cgc]}	|j
|	|	���}}	|D�	cgc]	}	|	d	vs�|	��}}	gd
�}
d|vrd}nd}|
D]
}||vs�d
}nd|v}d
}
d
}d|vrd}
d|vrd}t|�dk(s|dgk(rd}
t|�}|
r|r|j|dd|d�||�|r|r|j|dd|d�||�|
s|sd|vr|j|dd|d�||�n<|
rd|vr|j|dd|d�||�|rd|vr|j|dd|d�||�d|vr|j|dd|d�||�d|vr|j|dd|d�||�d|vr|j|dd|d�||�yycc}	wcc}	w)Nr�rrr�r@�DATA�CELL)�BBS�MODEM�ISDN�CAR�PCS)
r�r��MSGr��VOICE�FAXr�VIDEO�PAGERr)rrrrTFr�r�r�r
r�)r�numberr�r�faxzbusiness faxzhome fax�cellr�pager�data)	r�rprxrrrr)rr)rXr�r�r�rrr;r�munger��	antivoice�voicer�iswork�ishomes               r�
_field_TELzVCard._field_TEL�s������U�#���%��(�?��!�H�0�e�A�h�m�m�C�0�1�E��E����q�r��	�A��|�|�G�$��s�7�|�}�%�+�+�C�0���S���L�L���
	� �&�&�����+0�0�Q����1�a��0��0�"�6�q�Q�+5�&5��6��6�-�	��e���E��E��
����:�!�E��
�
�e�O�	������U�?��F��U�?��F��u�:��?�e��x�/��F�&�e�,���e�����"�Z�5�$I� �)�
-��e�����"�V�u�$E� �)�
-��f��%������"�U�e�$D� �)�
-�
�%�5�.��#�#�F�G�(6�%�H�$�i�1��%�5�.��#�#�F�G�(2�e�D�$�i�1��U�?�����"�V�u�$E� �)�
-��e������"�W��$F� �)�
-��U�?�����"�V�u�$E� �)�
-���Y1��6s�G<�0	H�:Hc	�"�|�|j||||�S|jj|d�}|�|||g|j|<y||dk7r%tj	d|�d|�dt
d���|rd|d<|dj
|�y)	z) Set value of an item of a group
        NrzGroup z has different types: z, Tr6r)r�r�r)rrrs�groups_type�update)rXr�rr�rr�
group_types       rrzVCard._setgroupvalue=s����=��>�>�&�$��y�A�A��\�\�%�%�e�T�2�
���#'��	�":�D�L�L����z�!�}�$��	�	�E�4�P[�\]�P^�_�`�� $�
�1�
��q�M� � ��'rc	��||vr|||<y|s|||j||�<y|g}dgttdd��zD]4}|t|�z|vr!|j	||t|�z��4ndgttdt|�dz��z}tt|��D]}||||t||�z<�y)Nr'r6�cr)r�r�r�rwryr)	rXr�rr�r�valuesr��suffixesr=s	         rr�zVCard._setvalueTs����v�� �F�4�L���7<�F�4�%�%�d�F�3�4������d�4��a���,�,�	�F��C��K��6�)��
�
�f�T�#�f�+�%5�6�7��		��4��U�1�S��[��]�3�4�4���s�8�}�%�	6�A�,2�1�I�F�4��H�Q�K�(�(�)�	6rc�j�|j|d��}|D�cgc]"}|jdd�j���$}}|D�cgc]}t|�s�|��}}|j	dd�}|r&dj|dj|�g�|d<ydj|�|d<ycc}wcc}w)Nr@��	seperatorrer'�
categories)r�r�rtrr)r�rXr�r�r�r0r�s      r�_field_CATEGORIESzVCard._field_CATEGORIESls����%�%�e�s�%�;��6<�=��!�)�)�C��$�*�*�,�=��=�#�.��s�1�v�!�.��.��J�J�|�T�*���#&�8�8�Q�����0@�,A�#B�F�<� �$'�8�8�F�#3�F�<� ��>��.s�'B+�B0�B0c��|j|d��}|D�cgc]"}|jdd�j���$}}|D�cgc]}t|�s�|��}}dj	|�||jd|�<ycc}wcc}w)Nr@r3rer'�	ringtones)r�r�rtrrr�r6s      r�_field_SOUNDzVCard._field_SOUNDzs���%�%�e�s�%�;��6<�=��!�)�)�C��$�*�*�,�=��=�#�.��s�1�v�!�.��.�:=�(�(�6�:J��t�!�!�+�v�6�7��>��.s�'B�B�Bc��d}d}|ddD]J}|jd�r|td�djd�}n|g}|D]}|dk(rd}|dk(s�d	}��L|j|�}dx}	x}
x}x}x}
x}}	|d
}	|d}
|d}|d}|d
}
|d}|d}i}|	�t|	�r|	|d<|
�t|
�r|
|d<|�t|�r||d<|�t|�r||d<|
�t|
�r|
|d<|�t|�r||d<|�t|�r||d<t|�r||d<|j|d||�yy#t$rY��wxYw)NFr�rr�r@r�r�r�Trr6rr��r�pobox�street2�street�city�state�
postalcode�countryr�address)rxrrr�r�r�)rXr�r�r�rrr;rr0r=�extendedaddress�
streetaddress�locality�regionrBrCrs                 r�
_field_ADRzVCard._field_ADR�s����	����q�r��	%�A��|�|�G�$��s�7�|�}�%�+�+�C�0���S���
%����;�!�D���;� $�I�	
%�	%��$�$�U�+��]a�a��a��a�-�a�(�a�V�a�j�SZ�		��!�H�E�#�A�h�O�!�!�H�M��Q�x�H��1�X�F��q��J��A�h�G������U��!�D��M��&�3��+?�-�D��O��$��]�);�*�D��N���C��M�#�D��L���#�f�+�"�D��M��!�c�*�o�!+�D�����3�w�<�%�D��O��t�9��D��L��N�N�6�9�d�I�>���5�	��	�s�7#E�	E�Ec�>�|djd�}|d}t|�dkDr|d}nd}|jd�s|jd�r|jdg||�y|dk(s|dk(r|j	dg||�yt
j
d	|z�y)
Nrr�rr'zX-PALM-CATEGORY�
CATEGORIESzX-PALM-NICKNAME�NICKNAMEzIgnoring PALM custom field: %s)rrrxr7r�rrrs�rXr�r�r�r�f0�f1s       r�
_field_X_PALMzVCard._field_X_PALM�s���
�1�X�^�^�C�
 ��
��U���r�7�Q�;��A��B��B�
�=�=�*�+�r�}�}�=N�/O��"�"�L�>�5�&�A�
�$�
$��.?�(?�� � �*��u�f�=�
�I�I�6��>�?rc��|djd�}|d}t|�dkDr|d}nd}|jd�s|jd�r|j|||�y|jd�s|jd�rtjd|z�ytjd|�d	|dd
�d��y)Nrr�rr'zX-PALM-zX-zIgnoring custom field: %szNo idea what to do with z (�P�))rrrxrPrrrsrMs       rr�zVCard._default_field�s���
�1�X�^�^�C�
 ��
��U���r�7�Q�;��A��B��B�
�=�=��#�r�}�}�Y�'?����u�e�V�4��
�]�]�4�
 �B�M�M�$�$7��I�I�1�E�9�:���	�	�u�e�C�R�j�I�Jrc���|jdd�jdd�jdd�jdd�jdd�jd	d�S)
N�\;re�\,r@z\nr�z\r\nr�r��r�)rXr�s  rr�z
VCard.unquote�sQ���}�}�U�C�(����s�#����t�$�����(�����%����d�#�	$rc���|jd|z�dkr.|j|�D�cgc]}|j|���c}Sg}d}d}|t|�krV|||k(r|j	|�d}|dz
}�/||dk(r||||dzz
}|dz
}�H|||z
}|dz
}|t|�kr�Vt|�r|j	|�|D�cgc]}|j|���c}Scc}wcc}w)N�\rr'rr6)rprr�rry)rXr�r4r��res�builds      rr�zVCard.splitandunquote�s���:�:�d�9�n�%�a�'�-2�[�[��-C�D��D�L�L��O�D�D�����
���#�e�*�n��Q�x�9�$��
�
�5�!����Q�����Q�x�4����q��1���%���Q�����U�1�X��E�
��F�A��#�e�*�n� �u�:��J�J�u��),�-�A����Q��-�-��3E��2.s�C+�C0c��|jS)zBest guess as to vcard version)r�r[s r�versionz
VCard.versions���}�}�rc��|jS)z-Best guess as to what program wrote the vcard)r�r[s rr�zVCard.origins���|�|�rc� �|j|Srr�)rX�items  r�__getitem__zVCard.__getitem__s���z�z�$��rc�,�t|j�Sr)r�r�r[s r�__repr__zVCard.__repr__!s���D�J�J��rN)r')F�re)0rMrNrOr�rYr�r)r�r�r�r��_field_LABEL�_field_BDAY�_field_ROLE�
_field_CALURI�_field_CALADRURI�_field_FBURL�
_field_REV�
_field_KEY�
_field_SOURCE�_field_PHOTOr�r�r�r�r�r��_field_NAMEr��_field_Orrrr)rr�r7r:�_field_CATEGORYrIrPr�r�r�r]r�rarcrPrrr�r��s����/(�d�,�
$�'�'�
�!�L��K��K�!�M�$�� �L��J��J�!�M� �L�
I�J�M�
J�,�M�8�K�J��H�=�D;�>.�f-�R(�.6�04�K�(�O�8?�v@�(K�*$�.�B�
�
 � rr�c�l�tj|�jdd�jdd�S)zTMy own routine to do qouted printable since the builtin one doesn't encode CR or NL!r�z=0Dr�z=0A)rz�encodestringr��r�s r�myqpencodestringru&s-�����u�%�-�-�d�E�:�B�B�4��O�Orc�f�|jdd�jdd�jdd�S)zJReturn a vCard v2 string.  Any embedded commas or semi-colons are removed.rYr'r@rerWrts r�format_stringv2rw+s-���=�=��r�"�*�*�3��3�;�;�C��D�Drc�f�|jdd�jdd�jdd�S)zOReturn a vCard v3 string.  Embedded commas and semi-colons are backslash quotedrYr'r@rVrerUrWrts r�format_stringv3ry0s-���=�=��r�"�*�*�3��6�>�>�s�E�J�Jrc�H�tj|�j�S)zReturn base 64 encoded string)r|rs�rstriprts r�
format_binaryr|8s�����u�%�,�,�.�.rc�B�t|td�tg�f�S)z�Determine if v is a sequence such as passed to value in out_line.
    Note that a sequence of chars is not a sequence for our purposes.rP)rvr)r�s r�_is_sequencer~>s���a�$��*�d�2�h�/�0�0rc	�6�|�g}nt|dd�}|tvr�t|�r`d}|D]}||�}t|�|k7s�d}n|r)|j	d�|D�cgc]
}t|���}}|j|�}nL||�}t|�|k7}|r4t|�}|j	d�nt|�rJ�|�||�}dj|g|z�dz}|t
|ddt|�z
�z
}|dd	k7sJ�|d	zScc}w)
a�Returns a single field correctly formatted and encoded (including trailing newline)

    @param name:  The field name
    @param attributes: A list of string attributes (eg "TYPE=intl,post" ).  Usually
                  empty except for TEL and ADR.  You can also pass in None.
    @param value: The field value.  You can also pass in a list of components which will be
                  joined with join_char such as the 6 components of N
    @param formatter:  The function that formats the value/components.  See the
                  various format_ functions.  They will automatically ensure that
                  ENCODING=foo attributes are added if appropriateNFTrjrerd�Fr7r�)r��_string_formattersr~ruryr�_line_reformatr)r�
attributesr��	formatter�	join_char�qpr;rZs        r�out_liner�DsA�����
��*�Q�-�(�
��&�&�����B��
���a�L��#�A�&�!�+��B��	
���!�!�"=�>�6;�<��)�!�,�<��<��N�N�5�)�E��e�$�E�!�%�(�E�1�B��(��/���!�!�"=�>���&�&�&�� ��e�$�E�

�(�(�D�6�*�$�
%�c�
)�C��>�%��R��C��[�1�1�C��r�7�d�?��?��t�8�O��'=s�!Dc���|dk(r|}t|�|kr|Sd}|dkDr
||d|z
}||d}t|�r-|d|d|zz
}t|�|kr	|S||d}t|�r�-|S)aTakes line string and inserts newlines
    and spaces on following continuation lines
    so it all fits in width characters

    @param width: how many characters to fit it in
    @param firstlinewidth: if >0 then first line is this width.
         if equal to zero then first line is same width as rest.
         if <0 then first line will go immediately to continuation.
         rr'Nz
 )r)r��width�firstlinewidthrZs    rr�r�vs��������
�4�y�>�!���
�C�����t�O�^�$�$���N�O�$��

�d�)��u�T�&�5�\�!�!���t�9�U�?���J��E�F�|���d�)��Jrc��d}|d|D]p}|tddt|�|�z
}t|�\}}}|tdd|||ddf|�z
}|jdd�}t	|�s�`|tdd||�z
}�r|S)Nr'�FN�Nr&rL)r�r+r/r)r)	�valsr��limitrZr�r;r<r=�nns	         r�	out_namesr��s���
�C�
�&�5�\�
=���x��d�$?��$B�I�N�N��#�A�&���!�A��x��T�A�a��"�R�=�)�<�<��
�U�U�:�r�
"���r�7��8�J��b�)�<�<�C�
=��Jrc��|D�cgc]}|jd���}}t|�rt|d||d��Sycc}w)N�categoryr@)r�r'�r)rr�)r�r�r�r��catss     r�out_categoriesr��s@��'+�,�!�A�E�E�*��,�D�,�
�4�y���t�T�9��D�D�
��	-s�;c��t||d��S)N�CATEGORY)r�)r��r�r�s  r�out_categories_appler��s���$�	��<�<rc�"�d}d}|D]�}|j|�}|jdd�}t|�r|dk(rd}|j�}|r
|dz}n|rd}t|�rd|zdd	g|d
k(zg}nd}|t||||�z
}d}��|S)Nr'Trr��work�,PREFr�r�z	,INTERNET�EMAILF)r)rrur�)	r�r�r��bpkeyrZrFr��valrs	         r�out_eur��s���
�C��E�
����e�e�E�l���u�u�V�R� ���t�9��z�!����:�:�<�D���G�|��
��D��t�9��D�L�"�[�!1�%�7�2B�!C�C�D�D��D��x��t�S�)�4�4����-�0�Jrc��t||dd�S)Nr�r��r�r�s  r�
out_emailsr��s���$�	�7�G�4�4rc��t||dd�S)N�URLr
r�r�s  r�out_urlsr��s���$�	�5�%�0�0rr�r�rrrrr)r��officer!r r"r#�nonec
���dgttdt|�dz��zD�cgc]}dt|�z��}}d}d}d}|D]�}|j	dd�}|�1|tdd	t|d
�d|��gt|d�|�z
}n[|t||d
zd	t|d
�d|��gt|d�|�z
}|t||dzdt|�|�z
}|dz
}d}��|Scc}w)Nr'r6rr
Trrr�r�r�r'r�rz.TELz.X-SPEEDDIALF)r�r�rrwr)r��_out_tel_mappingr$)	r�r�r0�phonesrZrF�idxr��sps	         r�out_telr��s/��')�d�4��a��D�	�!��0D�+E�&E�
F��g�c�!�f�n�
F�F�
F�
�C��E�
�C�
���
�U�U�;��
%��
�:��8�E�*:�1�V�9�*E�}�UZ�G[�\�]�,�Q�x�[�9�9�F�
F�C�
�8�F�3�K��.�*:�1�V�9�*E�}�UZ�G[�\�]�,�Q�x�[�9�9�F�
F�C�
�8�F�3�K��6��c�"�g�y�Q�Q�C��1�H�C���� �J��+Gs�C0c
�.�d}d}|D]�}|jdd�}t|�r|tdd||�z
}|jd�dk(rd}nd}d	|zd
|z}|td|gdD�cgc]}|j|d���c}|�z
}d
}��|Scc}w)Nr'T�company�ORGrr�r�r�r�r��ADR�Nr>r?r@rArBrCFr�)r�r�rZrFr��orr�s        r�out_adrr��s���
�C��E�
�
��
�E�E�)�R� ���q�6��8�E�4��I�6�6�C��5�5��=�F�"��D��D��t�|�M�%�0�0���x���v�?D�(E�����a���(E�GP�Q�	Q����
��J��(Es�)Bc�n�dj|d|D�cgc]}tdd|d|���c}�Scc}w)Nr'�NOTE�memo)rr�)r�r�r�r�s    r�out_noter�s5��
�7�7�$�v�PU�,�W�Q�H�V�T�1�V�9�i�@�W�X�X��Ws�2c��d}t|�dkD}|rd}nd}|D]2}|td|d|�t|d��gt|d�|�z
}d}�4|S)	Nr'rzPREF,r�r�rrF)rr�r�r$)r�r�rZ�_prefr�r�s      r�out_tel_scp6600r�sx��
�C���I��M�E������
����x��q�&'�)9�!�F�)�)D�E�F�(��8��5�y�B�	B������Jrc��d}ttt|�d��D]/}||}|jdd�s�|t	ddg|d|�z
}�1|S)Nr'r6r�r�z
TYPE=INTERNET)r��minrr)r�)r�r�rZ�_idxr�s     r�out_email_scp6600r�,se��
�C��c�#�d�)�Q�'�(�1����J���5�5��$���8�G�o�%6��G�*�i�1�
1�C�	1��Jrc�Z�|r)|djdd�rtdd|dd|�Sy)Nrr
r�r'�r)r�r�s  r�out_url_scp660r�8s2����Q����E�4�(���t�T�!�W�U�^�Y�?�?�
rc��|D]M}|jdd�dk(rd}nd}tdd|zgdD�cgc]}|j|d���c}|�cSycc}w)	Nrr�r�r�r�zTYPE=%sr�r'r�)r�r�r��_typer�s     r�out_adr_scp6600r�>sm��
�#���5�5����&�(��E��E���	�E� 1�2�/t�u�!����q�"��u�!�#�	#�#���vs�A)�names�
wallpapers�	addresses�numbersr5�emails�urlsr9�flags�memos�serialsc��|�'t|D�cgc]
}|tvs�|��c}�dk(sJ�|d}j�}|jt	dddd��|jt	dd|dd��|�t}ntD�cgc]	}||vs�|��}}|D]|}||vs�||vs�
||}d|j
jd|j
jvr|||||d�	�}n||||�}t|�s�k|j|��~|jt	d
dd|��|j�Scc}wcc}w)Nr�
_formatterrlr�r�r�r��_limit)r�rm)	r�_field_order�StringIO�writer��__code__�co_varnames�co_argcount�getvalue)	�entry�profile�limit_fieldsr;�fmt�io�fieldsr�r�s	         r�output_entryr�Qs[��"�-��|�E�!�q��/D�A�E�F�!�K�K�K�
�,�
�C�	�����B��B�H�H�X�g�t�W�d�
3�4��B�H�H�X�i��w�z�':�D�
A�B�����)�?��Q�,�->�!�?��?�
�	 ����:�!�w�,��1�:�D��$�-�-�3�3�4N�T�]�]�5N�5N�O�O��U�1�X�s�G�H�4E�F���U�1�X�s�+���5�z�������	 �
�B�H�H�X�e�T�7�C�
0�1��2�;�;�=���1F��@s�
E�E�	E�Ez2.1)
r�r�r�r�r5r�r�r�r�r�r�z3.0r�r5r�r�)r�r�r�r�z
vCard v2.1)�descriptionr�z
vCard v3.0�ApplezFull vCard v3.0zSanyo SCP-6600 (Katana))�vcard2�vcard3r��fullv3�scp6600rd)r�r)r)rKr)K�grzr|r~r�r�_boms�encodings.utf_64�	encodingsry�BOM64_BE�BOM64_LE�encodings.utf_32�	BOM_UTF32�BOM_UTF32_BE�BOM_UTF32_LE�encodings.utf_16�	BOM_UTF16�BOM_UTF16_BE�BOM_UTF16_LE�encodings.utf_8�BOM_UTF8�maxr�
_maxbomlenr�compilerr"r#rr$r+r(r9r>rDr/r}rLrRr�r�rurwryr�r|r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��profile_vcard2�copy�profile_vcard3�
profile_apple�profile_full�profile_scp6600r,�profiles)�bom�codecs00r�<module>rs���F��
�
�	�	�	�
�	����
�\�\�F�O�O�X�.�0�
�\�\�F�O�O�X�.�0���
�\�\�F�$�$�h�/�1�
�\�\�F�'�'��2�4�
�\�\�F�'�'��2�4���
�\�\�F�$�$�h�/�1�
�\�\�F�'�'��5�7�
�\�\�F�'�'��5�7�
��
�\�\�F�O�O�W�-�/����@�B����@�B��E�2�y�s�5�#�c�(�2�
3�
��"�R�Z�Z�	�
"�
�
�R�Z�Z�
�
&�
��r�z�z�,�'��
�
�$�A�6
)�	�3�>$�,)�.	�Y�	�
a�a�J)�)�ZT	 �T	 �pP�
E�
K�
&��7��/�1�/�d�>�"�=�
�<5�1�	�
���	������6�,Y�
�&	��	�L���@�
��	��
���
�	��� �$�$�&��.��|��"��z���#�#�%�
�2�
�l���"�"�$����X���#�#�%���L�!����
��
����)�^�E�(�^�E�#�]�E�-�,�G�5�'�*����w*���������
���3s7�>K"�$AK*�AK2�!K:�&L
�"K'�*K/�2K7�:K?

Zerion Mini Shell 1.0