o
    ¯b{  ã                   @   s   G d d„ dƒZ dS )c                   @   sX   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	dd„ Z
dd„ Zdd„ ZdS )ÚAccountManagera*  I am responsible for managing a user's accounts.

    That is, remembering what accounts are available, their settings,
    adding and removal of accounts, etc.

    @ivar accounts: A collection of available accounts.
    @type accounts: mapping of strings to L{Account<interfaces.IAccount>}s.
    c                 C   s
   i | _ d S ©N©Úaccounts©Úself© r   ú>/usr/lib/python3/dist-packages/twisted/words/im/baseaccount.pyÚ__init__   s   
zAccountManager.__init__c                 C   s4   g }| j  ¡ D ]}| |j| ¡ |j|jf¡ q|S )zÕA snapshot of all the accounts and their status.

        @returns: A list of tuples, each of the form
            (string:accountName, boolean:isOnline,
            boolean:autoLogin, string:gatewayType)
        )r   ÚvaluesÚappendÚaccountNameÚisOnlineÚ	autoLoginÚgatewayType)r   ÚdataÚaccountr   r   r   ÚgetSnapShot   s   üÿzAccountManager.getSnapShotc                 C   s   t | jƒdkS )Né    )Úlenr   r   r   r   r   ÚisEmpty)   s   zAccountManager.isEmptyc                 C   s&   g }| j  ¡ D ]	}| | ¡ ¡ q|S r   )r   r
   r   r   )r   Úconnectioninfor   r   r   r   ÚgetConnectionInfo,   s   z AccountManager.getConnectionInfoc                 C   s   || j |j< d S r   )r   r   )r   r   r   r   r   Ú
addAccount2   s   zAccountManager.addAccountc                 C   s   | j |= d S r   r   ©r   r   r   r   r   Ú
delAccount5   s   zAccountManager.delAccountc                 C   s   | j |  |¡S )z=
        @returntype: Deferred L{interfaces.IClient}
        )r   ÚlogOn)r   r   Úchatuir   r   r   Úconnect8   s   zAccountManager.connectc                 C   ó   d S r   r   r   r   r   r   Ú
disconnect>   ó   zAccountManager.disconnectc                 C   r   r   r   r   r   r   r   ÚquitB   r    zAccountManager.quitN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   r   r   r   r   r   r   r!   r   r   r   r   r   	   s    	r   N)r   r   r   r   r   Ú<module>   s   