
    c                     F    d dl Z  G d de          Z G d de          ZdS )    Nc                   :    e Zd ZdZd Zd Zd Zed             ZdS )StyleRuleDescriptorzStyleRule descriptor.c                     || _         dS )znInitialize the StyleRuleDescriptor instance.

        :param name: The attribute name of type string

        Nname)selfr   s     >lib/python3.11/site-packages/qstylizer/descriptor/stylerule.py__init__zStyleRuleDescriptor.__init__	   s     			    c                    ddl }t          ||j        j                  sJ |                    | j                  7|                     | j        |          }|                    | j        |           |                    | j                  S )zGet the value from the StyleRule's ordered dict.

        If value doesn't exist, create a new StyleRule instance and add it
        to the StyleRule's ordered dict.

        :param instance: The StyleRule instance

        r   Nr   parent)qstylizer.style
isinstancestyle	StyleRulefind_child_ruler   rule_clsset_child_rule)r   instanceargskwargs	qstylizer	new_styles         r	   __get__zStyleRuleDescriptor.__get__   s     	(IO$=>>>>>##DI.. 	:Y &  I ##DIy999''	222r   c                 8   t          || j                  r8t          j        |          }||_        |                    | j        |           dS |                     | j        |          }|                    |           |                    | j        |           dS )ap  Set the value in the StyleRule's ordered dict.

        If the value is a StyleRule, simply add it to the ordered dict.
        Otherwise create a new StyleRule instance, set its value
        attribute to the value, and add it to the ordered dict.

        :param instance: The StyleRule instance
        :param value: The value to set in StyleRule instance

        r   N)r   r   copydeepcopy_parentr   r   setValue)r   r   valuer   s       r	   __set__zStyleRuleDescriptor.__set__$   s     eT]++ 
	:M%((E$EM##DIu55555Y &  I u%%%##DIy99999r   c                 "    dd l }|j        j        S )Nr   )r   r   r   )r   r   s     r	   r   zStyleRuleDescriptor.rule_cls;   s    ((r   N)	__name__
__module____qualname____doc__r
   r   r"   propertyr    r   r	   r   r      sb          3 3 3&: : :. ) ) X) ) )r   r   c                   B    e Zd ZdZeZed             Zed             ZdS )StyleRuleParentzfStyleRule descriptor.

    Contains functions for getting all known attributes of the StyleRule.

    c                 |    i } j         D ]wt          t                    s|                    fdj                                        D                        |                                                               x|                     fd j                                        D                        |S )zGet all of the settable attributes of the StyleRule.

        Loop through all base classes to gather all known attributes.
        Returns a dictionary with the attribute name as the key and descriptor
        as the value.

        c                 F    i | ]\  }}t          |j                  ||S r)   r   _descriptor_cls).0keyr!   class_s      r	   
<dictcomp>z2StyleRuleParent.get_attributes.<locals>.<dictcomp>V   sB       )sEeV%;<<U  r   c                 F    i | ]\  }}t          |j                  ||S r)   r.   )r0   r1   r!   clss      r	   r3   z2StyleRuleParent.get_attributes.<locals>.<dictcomp>[   sB     
 
 
%3%!455

 
 
r   )	__bases__
issubclassr+   update__dict__itemsget_attributes)r5   
attributesr2   s   ` @r	   r;   zStyleRuleParent.get_attributesI   s     
m 	7 	7Ffo66     -3_-B-B-D-D      f33556666 
 
 
 
),););)=)=
 
 
 	 	 	 r   c                 |    t          d |                                                                 D                       S )z{Get all of the attribute names of the StyleRule.

        Returns a set of all possible dashcase attribute names.

        c                     g | ]	}|j         
S r)   r   )r0   r!   s     r	   
<listcomp>z4StyleRuleParent.get_attr_options.<locals>.<listcomp>i   s    CCCEUZCCCr   )setr;   values)r5   s    r	   get_attr_optionsz StyleRuleParent.get_attr_optionsa   s?     CCS%7%7%9%9%@%@%B%BCCC
 
 	
r   N)	r$   r%   r&   r'   r   r/   classmethodr;   rB   r)   r   r	   r+   r+   A   sY         
 *O  [. 
 
 [
 
 
r   r+   )r   objectr   r+   r)   r   r	   <module>rE      so    8) 8) 8) 8) 8)& 8) 8) 8)v)
 )
 )
 )
 )
f )
 )
 )
 )
 )
r   