a
    ž%@c2  ã                   @   sd   d dl m Z  d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dl	Z	G dd	„ d	e
ƒZdS )
é    )Údatetime)Ú
to_unicode)Ú	vDatetime)ÚvText)Úascii_letters)ÚdigitsNc                   @   s0   e Zd ZdZeee ƒZd
dd„Zddd„Z	d	S )ÚUIDGeneratorz/If you are too lazy to create real uid's.

    é   c                    s   d  ‡ fdd„t|ƒD ƒ¡S )z=Generates a string with random characters of length.
        Ú c                    s   g | ]}t  ˆ j¡‘qS © )ÚrandomÚchoiceÚchars)Ú.0Ú_©Úselfr   úR/var/www/dev/btcams2022/python_venv/lib/python3.9/site-packages/icalendar/tools.pyÚ
<listcomp>   ó    z+UIDGenerator.rnd_string.<locals>.<listcomp>)ÚjoinÚrange)r   Úlengthr   r   r   Ú
rnd_string   s    zUIDGenerator.rnd_stringúexample.comr
   c                 C   s:   t |ƒ}|p|  ¡ }t tt ¡ ƒ ¡ ƒ}td|||f ƒS )zœGenerates a unique id consisting of:
            datetime-uniquevalue@host.
        Like:
            20050105T225746Z-HKtJMqUgdO0jDUwm@example.com
        z%s-%s@%s)r   r   r   r   ÚtodayZto_icalr   )r   Z	host_nameÚuniquer   r   r   r   Úuid   s    þzUIDGenerator.uidN)r	   )r   r
   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úlistr   r   r   r   r   r   r   r   r   r      s   
r   )r   Zicalendar.parser_toolsr   Zicalendar.propr   r   Ústringr   r   r   Úobjectr   r   r   r   r   Ú<module>   s   