B
    f’»dâ  ã               @   s4   d dl Z d dlZd dlZe e¡ZG dd„ dƒZdS )é    Nc               @   s   e Zd Zddœdd„ZdS )Ú
Initializezpyrogram.Client)Úselfc             Ã   sN   | j stdƒ‚| jrtdƒ‚|  ¡  | j ¡ I dH  t |  ¡ ¡| _	d| _dS )ak  Initialize the client by starting up workers.

        This method will start updates and download workers.
        It will also load plugins and start the internal dispatcher.

        Raises:
            ConnectionError: In case you try to initialize a disconnected client or in case you try to initialize an
                already initialized client.
        z&Can't initialize a disconnected clientzClient is already initializedNT)
Zis_connectedÚConnectionErrorZis_initializedZload_pluginsZ
dispatcherÚstartÚasyncioZcreate_taskZupdates_watchdogZupdates_watchdog_task)r   © r   úD/tmp/pip-unpacked-wheel-rcokkf2l/pyrogram/methods/auth/initialize.pyÚ
initialize   s    zInitialize.initializeN)Ú__name__Ú
__module__Ú__qualname__r	   r   r   r   r   r      s   r   )r   ÚloggingZpyrogramÚ	getLoggerr
   Úlogr   r   r   r   r   Ú<module>   s   
