
    #hG                         S SK r S SKJr  S SKJrJrJrJr  S SKJ	r	  SSK
Jr  SSKJr  SSKJr  \" S	/ S
Q5      r " S S\5      rg)    N)
namedtuple)AnyDictTupleIterable)	Container   )	get_lines)
Serializer)Parser	Extractor)functiontyperequiredmultipledefaultc                       \ rS rSr%  " S S5      r\\S'   \\S'   \S\	S\
S\
4S	 j5       rS\	S
S4S jrS
\4S jrS
\\   4S jrS
\4S jrSrg)	Component   c                        \ rS rSrSr\r\rSr	g)Component.Meta   ABSTRACT N)
__name__
__module____qualname____firstlineno__namer   parserr   
serializer__static_attributes__r       M/Users/user/Downloads/htwk/venv/lib/python3.13/site-packages/ics/component.pyMetar      s    
r#   r%   _classmethod_args_classmethod_kwargs	containerargskwargsc                 N    U " 5       nX$l         X4l        UR                  U5        U$ )N)r&   r'   	_populate)clsr(   r)   r*   ks        r$   _from_containerComponent._from_container   s&    E" &	Ir#   returnNc                    UR                   U R                  R                   :w  a.  [        SR                  U R                  R                   5      5      eU R                  R                  R                  5       R                  5        GH@  u  nu  p4[        X5      nU(       d  UR                  (       a  UR                  (       aW  UR                  nSR                  [        [        UR                  5      5      nSU< SU< S3n[        R                  " U5        O%[        SR                  UR                   U5      5      eUR                  (       d4  [!        U5      S:  a%  [        SR                  UR                   U5      5      eUR                  (       a  U" X5        GM  [!        U5      S:X  a  U" XS	   5        GM7  U" U S 5        GMC     Xl        g )
Nzcontainer isn't an {}z\nzThe zH property was not found and is required by the RFC. A default value of "z" has been used insteadzA {} must have at least one {}r	   zA {} must have at most one {}r   )r   r%   
ValueErrorformatr    get_parsersitemsr
   r   r   joinmapstrwarningswarnr   lenextra)selfr(   	line_namer    optionslinesdefault_strmessages           r$   r,   Component._populate#   sL   >>TYY^^+4;;DIINNKLL,0II,<,<,H,H,J,P,P,R(I(i3EW--??#OOE"'**Sgoo-F"GKOXZegGMM'*$8		:< < ##E
Q 3VINNI68 8 t#u:?4q*4&3 -S6 
r#   c                     U R                   R                  5       nU R                  R                  R	                  5        H  nU" X5        M     [        U5      $ )z-Returns the component in an iCalendar format.)r=   cloner%   r!   get_serializersr9   )r>   r(   outputs      r$   	serializeComponent.serializeD   sC    JJ$$&	ii**::<F4# =9~r#   c                 <    U R                  5       R                  SS9$ )aH  Returns the component in an iCalendar format.

This returns an Iterable of multiple string chunks which should be concatenated to form the actual ics representation.
Note that individual items of the returned Iterable not necessarily correspond to individual lines,
linebreaks are contained at the right places within the items.T)keepends)rI   
splitlinesr>   s    r$   serialize_iterComponent.serialize_iterK   s     ~~**D*99r#   c                 X    [         R                  " S[        5        U R                  5       $ )zHStarting from version 0.9, returns a short description of the Component.zBehaviour of str(Component) will change in version 0.9 to only return a short description, NOT the ics representation. Use the explicit Component.serialize() to get the ics representation.)r:   r;   FutureWarningrI   rN   s    r$   __str__Component.__str__S   s&    TUb	
 ~~r#   )r=   )r   r   r   r   r%   r   __annotations__r   classmethodr   r   r/   r,   r9   rI   r   rO   rS   r"   r   r#   r$   r   r      s}       
 	 #   9  B3 : :   r#   r   )r:   collectionsr   typingr   r   r   r   ics.grammar.parser   utilsr
   serializers.serializerr   parsers.parserr   r   objectr   r   r#   r$   <module>r^      s;     " - - '  . ";	I  I r#   