%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/persisted/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/persisted/__pycache__/sob.cpython-312.pyc

�

Ϫ�f�����dZddlZddlZddlZddlmZmZddlmZddl	m
Z
mZGd�de�Zee�Gd�d	��Z
e
ZGd
�dej�Zd�Zd
�Zd�Zgd�Zy)z`
Save and load Small OBjects to and from files, using various formats.

Maintainer: Moshe Zadka
�N)�	Interface�implementer)�styles)�log�runtimec��eZdZdZd�Zdd�Zy)�IPersistablez9An object which can be saved in several formats to a filec��y�zWSet desired format.

        @type style: string (one of 'pickle' or 'source')
        N���styles �7/usr/lib/python3/dist-packages/twisted/persisted/sob.py�setStylezIPersistable.setStyle���Nc��y)�xSave object to file.

        @type tag: string
        @type filename: string
        @type passphrase: string
        Nr)�tag�filename�
passphrases   r�savezIPersistable.save!rr�NNN)�__name__�
__module__�__qualname__�__doc__rrrrrr	r	s��C��rr	c�6�eZdZdZd�Zd�Zd�Zd�Zd�Zd	d�Z	y)
�
Persistent�picklec� �||_||_y�N)�original�name)�selfr#r$s   r�__init__zPersistent.__init__.s�� ��
���	rc��||_yrr
)r%rs  rrzPersistent.setStyle2s��
��
rc���|r|}|dz}||fS|r,|j�d|�d|��}|j�d|�d|��}||fS|j�d|��}|j�d|��}||fS)Nz-2�-z-2.�.)r$)r%r�extr�	finalnames     r�_getFilenamezPersistent._getFilename9s���� �I� �4�'�H��(�"�"�
��)�)��A�c�U�#�c�U�3�H��9�9�+�Q�s�e�1�S�E�2�I��(�"�"��)�)��C��u�-�H��9�9�+�Q�s�e�,�I��(�"�"rc�l�t|d�5}||j|�ddd�y#1swYyxYw)N�wb)�openr#)r%r�dumpFunc�fs    r�	_saveTempzPersistent._saveTempEs1��
�(�D�
!�	'�Q��T�]�]�A�&�	'�	'�	'�s�*�3c�L�|jdk(rddlm}d}||fSdd�}d}||fS)N�sourcer)�
jellyToSource�tasc�2�tj||d�y)N�)r �dump)�obj�files  rr1z&Persistent._getStyle.<locals>.dumpFuncPs�����C��q�)r�tapr")r�twisted.persisted.aotr6)r%r1r+s   r�	_getStylezPersistent._getStyleIs8���:�:��!�G��C��H�}��	
*��C��H�}�rNc���|j�\}}|�td��|j|||�\}}tjd|j
zdz|zdz�|j
||�tjdk(r4tjj|�rtj|�tj||�tjd�y)rNzpassphrase must be NonezSaving z application to z...�win32zSaved.)r?�	TypeErrorr-r�msgr$r3r�platformType�os�path�isfile�remove�rename)r%rrrr+r1r,s       rrzPersistent.saveVs������(�
��X��!��5�6�6�"�/�/��#�s�C��	�8����	�D�I�I�%�(:�:�Y�F��N�O����x��*����7�*�r�w�w�~�~�i�/H��I�I�i� �
�	�	�(�I�&�����rr)
rrrrr&rr-r3r?rrrrrr*s%���E���
#�'��rrc��eZdZdZd�Zd�Zy)�_EverythingEphemeralrc��||_y)zS
        @param mainMod: The '__main__' module that this class will proxy.
        N)�mainMod)r%rMs  rr&z_EverythingEphemeral.__init__ps����rc��	t|j|�S#t$r<|jr�t	j
d|z�t
j�cYSwxYw)Nz#Warning!  Loading from __main__: %s)�getattrrM�AttributeError�initRunrrCr�	Ephemeral)r%�keys  r�__getattr__z _EverythingEphemeral.__getattr__vsR��	*��4�<�<��-�-���	*��|�|�����=��C�D��'�'�)�)�	*�s��AA�AN)rrrrQr&rTrrrrKrKms���G��*rrKc��d}|dk(rddlm}ntjd}}t	||�}ttjd�}|tjd<d|_|5	||�}|jtjd<	ddd�tj�d|_td�}|�|j|�|S#|jtjd<wxYw#1swY�gxYw)	z�Load an object from a file.

    Deserialize an object from a file. The file can be encrypted.

    @param filename: string
    @param style: string (one of 'pickle' or 'source')
    �rr5r)�unjellyFromSource�rb�__main__�N)r>rWr �loadr0rK�sys�modulesrQrMr�	doUpgrader	r)rr�mode�_load�fp�ee�value�persistables        rr[r[�s����D����D��k�k�4�t��	
�h��	�B�	�c�k�k�*�5�	6�B� �C�K�K�
���B�J�	�1�	1��"�I�E�')�j�j�C�K�K�
�#�1������B�J��u�d�+�K������U�#��L��')�j�j�C�K�K�
�#��1�1�s$�%C3�'C�/C3�C0�0C3�3C<c��t|�5}|j�}ddd�d|i}t|d�}t|||�||}|S#1swY�.xYw)z�Load the value of a variable in a Python file.

    Run the contents of the file in a namespace and return the result of the
    variable named C{variable}.

    @param filename: string
    @param variable: string
    N�__file__�exec)r0�read�compile�eval)r�variable�fileObj�data�d�codeObjrcs       r�loadValueFromFilerp�s_��
�h���7��|�|�~���	�X��A��d�H�f�-�G���!�Q��
�h�K�E��L�
��s�A
�
Ac�`�tjj|�d}dddddddd�|S)NrZ�pythonr r5)z.tacz.etacz.pyz.tapz.etapz.tasz.etas)rErF�splitext)rr+s  r�	guessTypert�sD��
�'�'�
�
�8�
$�Q�
'�C���������
��r)rpr[r�
Persistantr	rt)rrEr r\�zope.interfacerr�twisted.persistedr�twisted.pythonrrr	rrurRrKr[rprt�__all__rrr�<module>rzsy���
�
�
�1�$�'��9��&
�\��;�;��;�~�
�*�6�+�+�*�(�B�$
��r

Zerion Mini Shell 1.0