
    9 fP                         d Z ddlZddlZddlmZmZ ej        dd            Zd Zd Z	d	 Z
d
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )z0Simple wrappers around Factory class definition.    N   )basedeclarationsfactoryc              #     K   t          j        |           }|j        }t          j        |          }|                    t           j                   |                    |           |                    t           j                   	 d V  |                    |           |                    |           d S # |                    |           |                    |           w xY wN)logging	getLoggerlevelStreamHandlersetLevelDEBUG
addHandlerremoveHandler)loggerstream
logger_obj	old_levelhandlers        E/var/www/equiseq/venv/lib/python3.11/site-packages/factory/helpers.pydebugr      s      "6**J I#F++GW]###'"""&&&*I&&&  ))))) 	I&&&  ))))s   B6 6,C"c                 D    d j         z  } G  fdd          }||d<   |                    dt          j                  }t	          t          j                                      t	          t          j                  ||f|          }d j         z  |_         d z  |_        |S )z1Create a new, simple factory for the given class.z	%sFactoryc                       e Zd Z ZdS )make_factory.<locals>.MetaN)__name__
__module____qualname__model)klasss   r   Metar   !   s            r    FACTORY_CLASSz#Auto-generated factory for class %s)r   popr   Factorytype__new____doc__)r   kwargsfactory_namer    
base_classfactory_classs   `     r   make_factoryr,      s    /L          F6NOT\::J&&..tDL/A/A<R\Q^`fggM(5>9MAEIMr!   c                 @    t          | fi |                                S )z<Create a factory for the given class, and build an instance.)r,   buildr   r(   s     r   r.   r.   -   s$    ((((..000r!   c                 B    t          | fi |                    |          S )zECreate a factory for the given class, and build a batch of instances.)r,   build_batchr   sizer(   s      r   r1   r1   2   s&    ((((44T:::r!   c                 @    t          | fi |                                S )z=Create a factory for the given class, and create an instance.)r,   creater/   s     r   r5   r5   7   s$    ((((//111r!   c                 B    t          | fi |                    |          S )zFCreate a factory for the given class, and create a batch of instances.)r,   create_batchr2   s      r   r7   r7   <   s&    ((((55d;;;r!   c                 @    t          | fi |                                S )z;Create a factory for the given class, and stub an instance.)r,   stubr/   s     r   r9   r9   A   s$    ((((--///r!   c                 B    t          | fi |                    |          S )zDCreate a factory for the given class, and stub a batch of instances.)r,   
stub_batchr2   s      r   r;   r;   F   s&    ((((33D999r!   c                 B    t          | fi |                    |          S )z?Create a factory for the given class, and generate an instance.)r,   generate)r   strategyr(   s      r   r=   r=   K   s&    ((((11(;;;r!   c                 D    t          | fi |                    ||          S )z=Create a factory for the given class, and generate instances.)r,   generate_batch)r   r>   r3   r(   s       r   r@   r@   P   s(    ((((77$GGGr!   c                 B    t          | fi |                    |          S )zFCreate a factory for the given class, and simple_generate an instance.)r,   simple_generate)r   r5   r(   s      r   rB   rB   U   s&    ((((88@@@r!   c                 D    t          | fi |                    ||          S )zDCreate a factory for the given class, and simple_generate instances.)r,   simple_generate_batch)r   r5   r3   r(   s       r   rD   rD   Z   s(    ((((>>vtLLLr!   c                 *    t          j        |           S r   )r   LazyAttributefuncs    r   lazy_attributerI   _   s    %d+++r!   c                 :    t          j         |                       S )z5Turn a generator function into an iterator attribute.)r   IteratorrG   s    r   iteratorrL   c   s     (((r!   c                 *    t          j        |           S r   )r   SequencerG   s    r   sequencerO   h   s     &&&r!   c                 *    t          j        |           S r   )r   LazyAttributeSequencerG   s    r   lazy_attribute_sequencerR   l   s    -d333r!   c                 .    t          j        | d          S )NF)strict)r   ContainerAttributerG   s    r   container_attributerV   p   s    *4>>>>r!   c                 *    t          j        |           S r   )r   PostGeneration)funs    r   post_generationrZ   t   s    &s+++r!   )r   N)r'   
contextlibr	    r   r   contextmanagerr   r,   r.   r1   r5   r7   r9   r;   r=   r@   rB   rD   rI   rL   rO   rR   rV   rZ    r!   r   <module>r_      sp   7 6                      * * * *    1 1 1
; ; ;
2 2 2
< < <
0 0 0
: : :
< < <
H H H
A A A
M M M
, , ,) ) )
' ' '4 4 4? ? ?, , , , ,r!   