File: //usr/lib/python3.5/email/__pycache__/_policybase.cpython-35.pyc
FaP9 @ s d Z d d l Z d d l m Z d d l m Z d d l m Z d d d g Z Gd d
d
Z d d Z
d
d Z Gd d d e d e j Z
e Gd d d e
Z e Z d S)zwPolicy framework for the email package.
Allows fine grained feature control of how the package parses and emits data.
N)header)charset)_has_surrogatesPolicyCompat32compat32c sX e Z d Z d Z f d d Z d d Z d d Z d d Z d
d Z S)_PolicyBasea Policy Object basic framework.
This class is useless unless subclassed. A subclass should define
class attributes with defaults for any values that are to be
managed by the Policy object. The constructor will then allow
non-default values to be set for these attributes at instance
creation time. The instance will be callable, taking these same
attributes keyword arguments, and returning a new instance
identical to the called instance except for those values changed
by the keyword arguments. Instances may be added, yielding new
instances with any non-default values from the right hand
operand overriding those in the left hand operand. That is,
A + B == A(<non-default values of B>)
The repr of an instance can be used to reconstruct the object
if and only if the repr of the values can be used to reconstruct
those values.
c sj xc | j D]U \ } } t | | rD t t | j | | q
t d j | | j j q
Wd S)zCreate new Policy, possibly overriding some defaults.
See class docstring for a list of overridable attributes.
z*{!r} is an invalid keyword argument for {}N) itemshasattrsuperr __setattr__ TypeErrorformat __class____name__)selfkwnamevalue)r '/usr/lib/python3.5/email/_policybase.py__init__) s z_PolicyBase.__init__c C s; d d | j j D } d j | j j d j | S)Nc S s( g | ] \ } } d j | | q S)z{}={!r})r ).0r r r r r
<listcomp>8 s z(_PolicyBase.__repr__.<locals>.<listcomp>z{}({})z, )__dict__r r r r join)r argsr r r __repr__7 s z_PolicyBase.__repr__c K s | j j | j } x0 | j j D] \ } } t j | | | q% WxZ | j D]L \ } } t | | s t d j | | j j t j | | | qU W| S)zReturn a new instance with specified attributes changed.
The new instance has the same attribute values as the current object,
except for the changes passed in as keyword arguments.
z*{!r} is an invalid keyword argument for {})
r __new__r r objectr r
r
r r )r r Z newpolicyattrr r r r clone<