BYPASS SHELL BY ./RAZORGANZ
Server: nginx/1.20.1
System: Linux iZdzfnv9mwfppeZ 5.10.134-19.2.al8.x86_64 #1 SMP Wed Oct 29 22:47:09 CST 2025 x86_64
User: apache (48)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.6/site-packages/pptx/enum/__pycache__/base.cpython-36.pyc
3

Zƍh�)�@s�dZddlmZmZddlZddlZdd�ZGdd�de�ZGdd	�d	e	�Z
Gd
d�de�Ze
defeej
��ZGd
d�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZdS)z5
Base classes and other objects used by enumerations
�)�absolute_import�print_functionNcs�fdd�}|S)z�
    Decorating a class with @alias('FOO', 'BAR', ..) allows the class to
    be referenced by each of the names provided as arguments.
    cs*tjd�}|j}x�D]}|||<qW|S)N�)�sys�	_getframe�	f_globals)�clsZcallerZglobals_dict�alias)�aliases��8/usr/local/lib/python3.6/site-packages/pptx/enum/base.py�	decorators


zalias.<locals>.decoratorr)r
r
r)r
rr	
sr	c@s\eZdZdZdd�Zedd��Zedd��Zdd	�Zed
d��Z	edd
��Z
edd��ZdS)�_DocsPageFormatterz�
    Formats a RestructuredText documention page (string) for the enumeration
    class parts passed to the constructor. An immutable one-shot service
    object.
    cCs||_||_dS)N)�_clsname�_clsdict)�self�clsname�clsdictrrr�__init__%sz_DocsPageFormatter.__init__cCs d}|j|j|j|jf}||S)z�
        The RestructuredText documentation page for the enumeration. This is
        the only API member for the class.
        z.. _%s:

%s

%s

----

%s)�_ms_name�_page_title�_intro_text�_member_defs)r�tmpl�
componentsrrr�page_str)sz_DocsPageFormatter.page_strcCsBy|jd}Wntk
r&d}YnX|dkr4dStj|�j�S)zr
        The docstring of the enumeration, formatted for use at the top of the
        documentation page
        �__doc__�N)r�KeyError�textwrap�dedent�strip)rZ
cls_docstringrrrr8s
z_DocsPageFormatter._intro_textcCs0tj|j�j�}tj|dddd�}d|j|fS)z�
        Return an individual member definition formatted as an RST glossary
        entry, wrapped to fit within 78 columns.
        �N� �)�width�initial_indent�subsequent_indentz%s
%s
z    z    )rr �	docstringr!�fill�name)r�memberZmember_docstringrrr�_member_defHsz_DocsPageFormatter._member_defcs&�jd}�fdd�|D�}dj|�S)zx
        A single string containing the aggregated member definitions section
        of the documentation page
        �__members__cs g|]}|jdk	r�j|��qS)N)r*r,)�.0r+)rrr�
<listcomp>^sz3_DocsPageFormatter._member_defs.<locals>.<listcomp>�
)r�join)r�membersZmember_defsr)rrrVs
z_DocsPageFormatter._member_defscCs
|jdS)z=
        The Microsoft API name for this enumeration
        �__ms_name__)r)rrrrrbsz_DocsPageFormatter._ms_namecCs dt|j�d}d|j|fS)z�
        The title for the documentation page, formatted as code (surrounded
        in double-backtics) and underlined with '=' characters
        �=r$z	``%s``
%s)�lenr)rZtitle_underscorerrrrisz_DocsPageFormatter._page_titleN)�__name__�
__module__�__qualname__rr�propertyrrr,rrrrrrrrsrc@s<eZdZdZdd�Zedd��Zedd��Zedd	��Zd
S)�MetaEnumerationz�
    The metaclass for Enumeration and its subclasses. Adds a name for each
    named member and compiles state needed by the enumeration class to
    respond to other attribute gets
    cCs0|j|�|j|�|j||�tj||||�S)N)�_add_enum_members�_collect_valid_settings�_generate_docs_page�type�__new__)�metar�basesrrrrr?zs

zMetaEnumeration.__new__cCs$|d}x|D]}|j|�qWdS)z�
        Dispatch ``.add_to_enum()`` call to each member so it can do its
        thing to properly add itself to the enumeration class. This
        delegation allows member sub-classes to add specialized behaviors.
        r-N)�add_to_enum)r@r�enum_membersr+rrrr;�s
z!MetaEnumeration._add_enum_memberscCs2|d}g}x|D]}|j|j�qW||d<dS)z�
        Return a sequence containing the enumeration values that are valid
        assignment values. Return-only values are excluded.
        r-�_valid_settingsN)�extend�valid_settings)r@rrCrFr+rrrr<�s

z'MetaEnumeration._collect_valid_settingscCst||�j|d<dS)zH
        Return the RST documentation page for the enumeration.
        Z__docs_rst__N)rr)r@rrrrrr=�sz#MetaEnumeration._generate_docs_pageN)	r6r7r8rr?�classmethodr;r<r=rrrrr:ss
r:c@s$eZdZdZfZdZedd��ZdS)�EnumerationBasez�
    Base class for all enumerations, used directly for enumerations requiring
    only basic behavior. It's __dict__ is used below in the Python 2+3
    compatible metaclass definition.
    rcCs ||jkrtd||jf��dS)zK
        Raise |ValueError| if *value* is not an assignable value.
        z!%s not a member of %s enumerationN)rD�
ValueErrorr6)r�valuerrr�validate�s
zEnumerationBase.validateN)r6r7r8rr-r3rGrKrrrrrH�srH�Enumerationc@s0eZdZdZfZdZedd��Zedd��ZdS)�XmlEnumerationzg
    Provides ``to_xml()`` and ``from_xml()`` methods in addition to base
    enumeration features
    rcCs
|j|S)za
        Return the enumeration member corresponding to the XML value
        *xml_val*.
        )�_xml_to_member)rZxml_valrrr�from_xml�szXmlEnumeration.from_xmlcCs|j|�|j|S)zK
        Return the XML value of the enumeration value *enum_val*.
        )rK�_member_to_xml)rZenum_valrrr�to_xml�s
zXmlEnumeration.to_xmlN)	r6r7r8rr-r3rGrOrQrrrrrM�s
rMc@sXeZdZdZdd�Zdd�Zedd��Zedd	��Zd
d�Z	edd
��Z
edd��ZdS)�
EnumMemberz`
    Used in the enumeration class definition to define a member value and its
    mappings
    cCs,||_t|t�rt|||�}||_||_dS)N)�_name�
isinstance�int�	EnumValue�_value�
_docstring)rr*rJr(rrrr�s

zEnumMember.__init__cCs|j|�dS)z:
        Add a name to *clsdict* for this member.
        N)�
register_name)rrrrrrB�szEnumMember.add_to_enumcCs|jS)z0
        The description of this member
        )rX)rrrrr(�szEnumMember.docstringcCs|jS)z�
        The distinguishing name of this member within the enumeration class,
        e.g. 'MIDDLE' for MSO_VERTICAL_ANCHOR.MIDDLE, if this is a named
        member. Otherwise the primitive value such as |None|, |True| or
        |False|.
        )rS)rrrrr*�szEnumMember.namecCs|jdkrdS|j||j<dS)a
        Add a member name to the class dict *clsdict* containing the value of
        this member object. Where the name of this object is None, do
        nothing; this allows out-of-band values to be defined without adding
        a name to the class dict.
        N)r*rJ)rrrrrrY�s
zEnumMember.register_namecCs|jfS)z�
        A sequence containing the values valid for assignment for this
        member. May be zero, one, or more in number.
        )rW)rrrrrFszEnumMember.valid_settingscCs|jS)z�
        The enumeration value for this member, often an instance of
        EnumValue, but may be a primitive value such as |None|.
        )rW)rrrrrJszEnumMember.valueN)r6r7r8rrrBr9r(r*rYrFrJrrrrrR�s
rRcs@eZdZdZ�fdd�Z�fdd�Zedd��Zdd	�Z�ZS)
rVz�
    A named enumeration value, providing __str__ and __doc__ string values
    for its symbolic name and description, respectively. Subclasses int, so
    behaves as a regular int unless the strings are asked for.
    cstt|�j||�S)N)�superrVr?)r�member_name�	int_valuer()�	__class__rrr?szEnumValue.__new__cstt|�j�||_||_dS)N)rZrVr�_member_namerX)rr[r\r()r]rrrszEnumValue.__init__cCs
|jj�S)z<
        The description of this enumeration member
        )rXr!)rrrrr szEnumValue.__doc__cCsdj|j|�S)zV
        The symbolic name and string value of this member, e.g. 'MIDDLE (3)'
        z
{0:s} ({1:d}))�formatr^)rrrr�__str__'szEnumValue.__str__)	r6r7r8rr?rr9r`�
__classcell__rr)r]rrVs
rVc@seZdZdZedd��ZdS)�ReturnValueOnlyEnumMemberz�
    Used to define a member of an enumeration that is only valid as a query
    result and is not valid as a setting, e.g. MSO_VERTICAL_ANCHOR.MIXED (-2)
    cCsfS)z@
        No settings are valid for a return-only value.
        r)rrrrrF4sz(ReturnValueOnlyEnumMember.valid_settingsN)r6r7r8rr9rFrrrrrb.srbcsXeZdZdZ�fdd�Z�fdd�Zdd�Zedd	��Ze	d
d��Z
e	dd
��Z�ZS)�XmlMappedEnumMemberzM
    Used to define a member whose value maps to an XML attribute value.
    cstt|�j|||�||_dS)N)rZrcr�
_xml_value)rr*rJ�	xml_valuer()r]rrrAszXmlMappedEnumMember.__init__cstt|�j|�|j|�dS)zH
        Compile XML mappings in addition to base add behavior.
        N)rZrcrB�register_xml_mapping)rr)r]rrrBEszXmlMappedEnumMember.add_to_enumcCs0|j|�}|j||j<|j|�}|j||j<dS)zR
        Add XML mappings to the enumeration class state for this member.
        N)�_get_or_add_member_to_xmlrerJ�_get_or_add_xml_to_member)rrZ
member_to_xmlZ
xml_to_memberrrrrfLs

z(XmlMappedEnumMember.register_xml_mappingcCs|jS)zT
        The XML attribute value that corresponds to this enumeration value
        )rd)rrrrreUszXmlMappedEnumMember.xml_valuecCsd|krt�|d<|dS)zR
        Add the enum -> xml value mapping to the enumeration class state
        rP)�dict)rrrrrg\s
z-XmlMappedEnumMember._get_or_add_member_to_xmlcCsd|krt�|d<|dS)zR
        Add the xml -> enum value mapping to the enumeration class state
        rN)ri)rrrrrhes
z-XmlMappedEnumMember._get_or_add_xml_to_member)
r6r7r8rrrBrfr9re�staticmethodrgrhrarr)r]rrc<s		rc)r�
__future__rrrrr	�objectrr>r:rHri�__dict__rLrMrRrUrVrbrcrrrr�<module>sU,@