
    i                        d dl Z d dlmZmZ d dlmZ d dlmZ ddlmZm	Z	m
Z
 ej        Zd Z G d d	e          Z G d
 de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de	          Z G d de	          Z G d de	          Z G d de
          Z G d de          Z G d  d!e          Z G d" d#e          Z G d$ d%e          Z G d& d'e	          Z G d( d)e          Z G d* d+e          Z G d, d-e          Z  G d. d/e          Z! G d0 d1e
          Z" G d2 d3e
          Z# G d4 d5e
          Z$ G d6 d7e
          Z% G d8 d9e
          Z& G d: d;e
          Z' G d< d=e
          Z( G d> d?e
          Z) G d@ dAe
          Z* G dB dCe          Z+ G dD dEe          Z,dS )F    N)datetimetimezone)ClassVar)ns   )BaseElementNamedBaseElementValuedBaseElementc                    t          | t                    r&	 |                     t                    } n	#  ddl}|                     |                                          } t          j                            t                    }t          j                            t                    }|| j	        
                    |           z   | k    rt          j        d|            |} nS| || j	        
                    |           z
  k    rt          j        d|            |} n|                     t                    } Y nxY w|                     d          S )z>coerce datetimes to UTC (assume localtime if nothing is given)r   N)tzinfoz6Cannot coerce datetime %s to UTC. Changed to min-date.z6Cannot coerce datetime %s to UTC. Changed to max-date.z%Y%m%dT%H%M%SZ)
isinstancer   
astimezoneutc_tztzlocalreplaceget_localzoneminmaxr   	utcoffsetloggingerrorstrftime)tsr   mindatemaxdates       O/root/projects/butler/venv/lib/python3.11/site-packages/caldav/elements/cdav.py_to_utc_date_stringr      s/    "h +	+
 v&&BB	+ NNN7#8#8#:#:;;Bl**&*99Gl**&*99G,,R000255VXZ[[[g	 3 3B 7 7777VXZ[[[]]6**;;'(((s
   4 DD:c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarQueryCzcalendar-querytagN__name__
__module____qualname__r   r!   r   str__annotations__     r   r   r   -   3         C!122C#22222r)   r   c                   >    e Zd ZU  edd          Zee         ed<   dS )FreeBusyQueryr    zfree-busy-queryr!   Nr"   r(   r)   r   r,   r,   1   s3         C!233C#33333r)   r,   c                   >    e Zd ZU  edd          Zee         ed<   dS )
Mkcalendarr    
mkcalendarr!   Nr"   r(   r)   r   r.   r.   5   s2         C..C#.....r)   r.   c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarMultiGetr    zcalendar-multigetr!   Nr"   r(   r)   r   r1   r1   9   3         C!455C#55555r)   r1   c                   >    e Zd ZU  edd          Zee         ed<   dS )ScheduleInboxURLr    zschedule-inbox-URLr!   Nr"   r(   r)   r   r4   r4   =   3         C!566C#66666r)   r4   c                   >    e Zd ZU  edd          Zee         ed<   dS )ScheduleOutboxURLr    zschedule-outbox-URLr!   Nr"   r(   r)   r   r7   r7   A   s3         C!677C#77777r)   r7   c                   >    e Zd ZU  edd          Zee         ed<   dS )Filterr    filterr!   Nr"   r(   r)   r   r9   r9   F   s2         C**C#*****r)   r9   c                   >    e Zd ZU  edd          Zee         ed<   dS )
CompFilterr    zcomp-filterr!   Nr"   r(   r)   r   r<   r<   J   2         C//C#/////r)   r<   c                   >    e Zd ZU  edd          Zee         ed<   dS )
PropFilterr    zprop-filterr!   Nr"   r(   r)   r   r?   r?   N   r=   r)   r?   c                   >    e Zd ZU  edd          Zee         ed<   dS )ParamFilterr    zparam-filterr!   Nr"   r(   r)   r   rA   rA   R   2         C00C#00000r)   rA   c                   ^     e Zd ZU  edd          Zee         ed<   ddededd	f fd
Z	 xZ
S )	TextMatchr    z
text-matchr!   i;octetF	collationnegatereturnNc                     t          t          |                               |           | j        t	          d          || j        d<   |rd| j        d<   d S d S )N)value)Unexpected value None for self.attributesrF   yesznegate-condition)superrD   __init__
attributes
ValueError)selfrJ   rF   rG   	__class__s       r   rN   zTextMatch.__init__Z   sl    i''e'444?"HIII'0$ 	827DO.///	8 	8r)   )rE   F)r#   r$   r%   r   r!   r   r&   r'   boolrN   __classcell__rR   s   @r   rD   rD   W   sz         C..C#...8 8 8$ 8SW 8 8 8 8 8 8 8 8 8 8r)   rD   c                   j     e Zd ZU  edd          Zee         ed<   d	dedz  dedz  ddf fdZ	 xZ
S )
	TimeRanger    z
time-ranger!   NstartendrH   c                     t          t          |                                            | j        t	          d          |t          |          | j        d<   |t          |          | j        d<   d S d S NrK   rX   rY   )rM   rW   rN   rO   rP   r   rQ   rX   rY   rR   s      r   rN   zTimeRange.__init__h   sx     	i'')))?"HIII':5'A'ADOG$?%8%=%=DOE""" ?r)   )NNr#   r$   r%   r   r!   r   r&   r'   r   rN   rT   rU   s   @r   rW   rW   e   s         C..C#...> >ho >8d? >VZ > > > > > > > > > >r)   rW   c                   >    e Zd ZU  edd          Zee         ed<   dS )
NotDefinedr    zis-not-definedr!   Nr"   r(   r)   r   r_   r_   v   r*   r)   r_   c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarDatar    zcalendar-datar!   Nr"   r(   r)   r   ra   ra   {   2         C11C#11111r)   ra   c                   j     e Zd ZU  edd          Zee         ed<   d	dedz  dedz  ddf fdZ	 xZ
S )
Expandr    expandr!   NrX   rY   rH   c                     t          t          |                                            | j        t	          d          |t          |          | j        d<   |t          |          | j        d<   d S d S r[   )rM   rd   rN   rO   rP   r   r\   s      r   rN   zExpand.__init__   sv    fd$$&&&?"HIII':5'A'ADOG$?%8%=%=DOE""" ?r)   )Nr]   rU   s   @r   rd   rd      s         C**C#***	> 	>ho 	>HtO 	>t 	> 	> 	> 	> 	> 	> 	> 	> 	> 	>r)   rd   c                   >    e Zd ZU  edd          Zee         ed<   dS )Compr    compr!   Nr"   r(   r)   r   rh   rh      s0         CC#(((((r)   rh   c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarUserAddressSetr    zcalendar-user-address-setr!   Nr"   r(   r)   r   rk   rk      s3         C!<==C#=====r)   rk   c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarUserTyper    zcalendar-user-typer!   Nr"   r(   r)   r   rm   rm      r5   r)   rm   c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarHomeSetr    zcalendar-home-setr!   Nr"   r(   r)   r   ro   ro      r2   r)   ro   c                   >    e Zd ZU  edd          Zee         ed<   dS )Calendarr    calendarr!   Nr"   r(   r)   r   rq   rq      s2         C,,C#,,,,,r)   rq   c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarDescriptionr    zcalendar-descriptionr!   Nr"   r(   r)   r   rt   rt      s3         C!788C#88888r)   rt   c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarTimeZoner    zcalendar-timezoner!   Nr"   r(   r)   r   rv   rv      r2   r)   rv   c                   >    e Zd ZU  edd          Zee         ed<   dS )SupportedCalendarComponentSetr    z supported-calendar-component-setr!   Nr"   r(   r)   r   rx   rx      s3         C!CDDC#DDDDDr)   rx   c                   >    e Zd ZU  edd          Zee         ed<   dS )SupportedCalendarDatar    zsupported-calendar-datar!   Nr"   r(   r)   r   rz   rz      s3         C!:;;C#;;;;;r)   rz   c                   >    e Zd ZU  edd          Zee         ed<   dS )MaxResourceSizer    zmax-resource-sizer!   Nr"   r(   r)   r   r|   r|      r2   r)   r|   c                   >    e Zd ZU  edd          Zee         ed<   dS )MinDateTimer    zmin-date-timer!   Nr"   r(   r)   r   r~   r~      rb   r)   r~   c                   >    e Zd ZU  edd          Zee         ed<   dS )MaxDateTimer    zmax-date-timer!   Nr"   r(   r)   r   r   r      rb   r)   r   c                   >    e Zd ZU  edd          Zee         ed<   dS )MaxInstancesr    zmax-instancesr!   Nr"   r(   r)   r   r   r      rb   r)   r   c                   >    e Zd ZU  edd          Zee         ed<   dS )MaxAttendeesPerInstancer    zmax-attendees-per-instancer!   Nr"   r(   r)   r   r   r      s3         C!=>>C#>>>>>r)   r   c                   >    e Zd ZU  edd          Zee         ed<   dS )Allpropr    allpropr!   Nr"   r(   r)   r   r   r      s2         C++C#+++++r)   r   c                   >    e Zd ZU  edd          Zee         ed<   dS )ScheduleTagr    zschedule-tagr!   Nr"   r(   r)   r   r   r      rB   r)   r   )-r   r   r   typingr   caldav.lib.namespacer   baser   r	   r
   utcr   r   r   r,   r.   r1   r4   r7   r9   r<   r?   rA   rD   rW   r_   ra   rd   rh   rk   rm   ro   rq   rt   rv   rx   rz   r|   r~   r   r   r   r   r   r(   r)   r   <module>r      s    ' ' ' ' ' ' ' '       # # # # # # B B B B B B B B B B	) ) )@3 3 3 3 3K 3 3 34 4 4 4 4K 4 4 4/ / / / / / / /6 6 6 6 6{ 6 6 67 7 7 7 7{ 7 7 78 8 8 8 8 8 8 8
+ + + + +[ + + +0 0 0 0 0! 0 0 00 0 0 0 0! 0 0 01 1 1 1 1" 1 1 1
8 8 8 8 8! 8 8 8> > > > > > > >"3 3 3 3 3 3 3 3
2 2 2 2 2; 2 2 2> > > > >[ > > >) ) ) ) ) ) ) )> > > > >[ > > >7 7 7 7 7{ 7 7 76 6 6 6 6k 6 6 6
- - - - -{ - - -9 9 9 9 9+ 9 9 96 6 6 6 6( 6 6 6E E E E E$5 E E E< < < < <- < < <6 6 6 6 6' 6 6 62 2 2 2 2# 2 2 22 2 2 2 2# 2 2 22 2 2 2 2$ 2 2 2? ? ? ? ?/ ? ? ?, , , , ,k , , ,1 1 1 1 1+ 1 1 1 1 1r)   