
    i"                        d Z ddlmZ ddlZddlmZmZmZ ddlmZ ddl	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZ ddl m!Z! erdd	l"m#Z# dd
l$m%Z%m&Z& ddl'm(Z(  G d de          Z)dgZ*dS )z:rfc:`5545` VJOURNAL component.    )annotationsN)datedatetime	timedelta)TYPE_CHECKING)CONCEPTS_TYPE_SETTERLINKS_TYPE_SETTERRELATED_TO_TYPE_SETTERattendees_propertycategories_propertyclass_propertycolor_propertycontacts_propertycreate_single_propertydescriptions_propertyexdates_propertyimages_propertyorganizer_propertyrdates_propertyrrules_propertysequence_propertystatus_propertysummary_propertyuid_propertyurl_property)	Component)IncompleteComponent)Sequence)CLASSSTATUS)vCalAddressc                      e Zd ZdZdZdZdZdZ edde	e
fe
d          Zed@d            Zej        dAd            ZeZedBd            ZeZeZeZeZeZeZeZeZ e!Z"e#Z$e%Z&e'Z(e)Z*e+Z,e-Z.ddl/m0Z0 edCd            Z1e1j        dDd            Z1e1j2        d             Z1e3Z4e5	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dEdF fd?            Z6 xZ7S )GJournalaN  A descriptive text at a certain time or associated with a component.

        Description:
            A "VJOURNAL" calendar component is a grouping of
            component properties that represent one or more descriptive text
            notes associated with a particular calendar date.  The "DTSTART"
            property is used to specify the calendar date with which the
            journal entry is associated.  Generally, it will have a DATE value
            data type, but it can also be used to specify a DATE-TIME value
            data type.  Examples of a journal entry include a daily record of
            a legislative body or a journal entry of individual telephone
            contacts for the day or an ordered list of accomplishments for the
            day.

    Examples:
        Create a new Journal:

            >>> from icalendar import Journal
            >>> journal = Journal.new()
            >>> print(journal.to_ical())
            BEGIN:VJOURNAL
            DTSTAMP:20250517T080612Z
            UID:d755cef5-2311-46ed-a0e1-6733c9e15c63
            END:VJOURNAL

    VJOURNAL)UIDDTSTAMP)r   COLORCREATEDDTSTARTr&   zLAST-MODIFIED	ORGANIZERzRECURRENCE-IDSEQUENCEr    SUMMARYr%   URL)ATTACHATTENDEE
CATEGORIESCOMMENTCONTACTEXDATERELATEDRDATERRULERSTATUSDESCRIPTIONr)   dtzjThe "DTSTART" property for a "VJOURNAL" that specifies the exact date at which the journal entry was made.returnr   c                6    | j         }|t          d          |S )zThe start of the Journal.

        The "DTSTART"
        property is used to specify the calendar date with which the
        journal entry is associated.
        NzNo DTSTART given.)r)   r   )selfstarts     P/root/projects/butler/venv/lib/python3.11/site-packages/icalendar/cal/journal.pyr=   zJournal.startp   s$     =%&9:::    valuedatetime | dateNonec                    || _         dS )zSet the start of the journal.N)r)   )r<   r@   s     r>   r=   zJournal.start}   s     r?   r   c                     t          d          S )z*The journal has no duration: timedelta(0).r   )r   r<   s    r>   durationzJournal.duration   s     ||r?   r   )RECURRENCE_IDstrc                B    | j         }|sdS d                    |          S )zThe concatenated descriptions of the journal.

        A Journal can have several descriptions.
        This is a compatibility method.
        Nz

)descriptionsjoin)r<   rJ   s     r>   descriptionzJournal.description   s+     ( 	4|,,,r?   rL   
str | Nonec                    || _         dS )zSet the descriptionNrJ   )r<   rL   s     r>   rL   zJournal.description   s     (r?   c                
    | ` dS )zDelete all descriptions.NrO   rE   s    r>   rL   zJournal.description   s     r?   N 	attendeeslist[vCalAddress] | None
categoriesSequence[str]classificationCLASS | Nonecolorcommentslist[str] | str | Noneconceptsr   contactscreateddate | Nonestr | Sequence[str] | Nonelast_modifiedlinksr	   	organizervCalAddress | str | Nonerecurrence_iddate | datetime | Nonerefids
related_tor
   sequence
int | Nonestampr=   statusSTATUS | Nonesummaryuidstr | uuid.UUID | Noneurlc          
        t                                          ||n|                                 ||
|||||          }||_        |	|_        ||nt          j                    |_        ||_        ||_	        ||_
        ||_        ||_        ||_        ||_        ||_        ||_        ||_        ||_        ||_        |S )a   Create a new journal entry with all required properties.

        This creates a new Journal in accordance with :rfc:`5545`.

        Parameters:
            attendees: The :attr:`attendees` of the journal.
            categories: The :attr:`categories` of the journal.
            classification: The :attr:`classification` of the journal.
            color: The :attr:`color` of the journal.
            comments: The :attr:`~icalendar.Component.comments` of the journal.
            concepts: The :attr:`~icalendar.Component.concepts` of the journal.
            contacts: The :attr:`contacts` of the journal.
            created: The :attr:`~icalendar.Component.created` of the journal.
            description: The :attr:`description` of the journal.
            end: The :attr:`end` of the journal.
            last_modified: The :attr:`~icalendar.Component.last_modified` of
                the journal.
            links: The :attr:`~icalendar.Component.links` of the journal.
            organizer: The :attr:`organizer` of the journal.
            recurrence_id: The :attr:`RECURRENCE_ID` of the journal.
            refids: :attr:`~icalendar.Component.refids` of the journal.
            related_to: :attr:`~icalendar.Component.related_to` of the journal.
            sequence: The :attr:`sequence` of the journal.
            stamp: The :attr:`~icalendar.Component.stamp` of the journal.
                If None, this is set to the current time.
            start: The :attr:`start` of the journal.
            status: The :attr:`status` of the journal.
            summary: The :attr:`summary` of the journal.
            uid: The :attr:`uid` of the journal.
                If None, this is set to a new :func:`uuid.uuid4`.
            url: The :attr:`url` of the journal.

        Returns:
            :class:`Journal`

        Raises:
            ~error.InvalidCalendar: If the content is not valid
                according to :rfc:`5545`.

        .. warning:: As time progresses, we will be stricter with the validation.
        N)rj   r]   r`   rY   ra   rg   rf   r[   )supernew_utc_nowrm   rJ   uuiduuid4rn   r=   rX   rT   rh   rV   rp   rb   r\   rk   rR   rG   )clsrR   rT   rV   rX   rY   r[   r\   r]   rL   r`   ra   rb   rd   rf   rg   rh   rj   r=   rk   rm   rn   rp   journal	__class__s                           r>   rs   zJournal.new   s    H !77;; ,%%#,,..'! ' 	
 	
 "* _cc$*,,'#!/%#% -r?   )r:   r   )r@   rA   r:   rB   )r:   r   )r:   rH   )rL   rM   )NrQ   NNNNNNNNNNNNNNNNNNNN),rR   rS   rT   rU   rV   rW   rX   rM   rY   rZ   r[   r   r\   rZ   r]   r^   rL   r_   r`   r^   ra   r	   rb   rc   rd   re   rf   rZ   rg   r
   rh   ri   rj   r^   r=   re   rk   rl   rm   rM   rn   ro   rp   rM   )8__name__
__module____qualname____doc__namerequired
singletonsmultipler   r   r   r)   propertyr=   setterendrF   r   rX   r   rh   r   rT   r   rdatesr   exdatesr   rrulesr   rn   r   rm   r   rJ   r   rV   r   rp   r   rb   r   r\   r   rk   r   rR   icalendar.attrrG   rL   deleterr   imagesclassmethodrs   __classcell__)ry   s   @r>   r#   r#   )   s        6 DHJH %$	4t G 
 
 
 X
 \   \ C   X E H$JFGF
CG(L#N
C"I HF"I,,,,,,	- 	- 	- X	- ( ( ( (    F /3$&'+ +/)-+/#26%)#'.204)--1#!(, $"&*1] ] ] ] ] ] [] ] ] ] ]r?   r#   )+r}   
__future__r   ru   r   r   r   typingr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   icalendar.cal.componentr   icalendar.errorr   collections.abcr   icalendar.enumsr   r    icalendar.propr!   r#   __all__rQ   r?   r>   <module>r      s   % % " " " " " "  . . . . . . . . . .                                                       , . - - - - - / / / / / / +((((((--------******h h h h hi h h hV +r?   