%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/persisted/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/persisted/__pycache__/sob.cpython-312.pyc |
� Ϫ�f� � �� � d Z ddlZddlZddlZddlmZmZ ddlmZ ddl m Z mZ G d� de� Z ee� G d� d � � Z e Z G d � dej � Zd� Zd � Zd� Zg d�Zy)z` Save and load Small OBjects to and from files, using various formats. Maintainer: Moshe Zadka � N)� Interface�implementer)�styles)�log�runtimec � � e Zd ZdZd� 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! r r �NNN)�__name__� __module__�__qualname__�__doc__r r r r r r r s � �C��r r c �6 � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd d�Z y) � Persistent�picklec � � || _ || _ y �N)�original�name)�selfr# r$ s r �__init__zPersistent.__init__. s � � �� ��� r c � � || _ yr r )r% r s r r zPersistent.setStyle2 s � � �� r c �� � |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._getFilename9 s� � �� �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��(�"�"r c �l � t |d� 5 } || j |� d d d � y # 1 sw Y y xY w)N�wb)�openr# )r% r �dumpFunc�fs r � _saveTempzPersistent._saveTempE s1 � � �(�D� !� '�Q��T�]�]�A�&� '� '� '�s �*�3c �L � | j dk( rddlm} d}||fS dd�}d}||fS )N�sourcer )� jellyToSource�tasc �2 � t j | |d� y )N� )r �dump)�obj�files r r1 z&Persistent._getStyle.<locals>.dumpFuncP s � ����C��q�)r �tapr"