File: //usr/lib/python3/dist-packages/twisted/words/im/__pycache__/basesupport.cpython-38.pyc
U
W[� � @ s� d Z ddlmZmZ ddlmZ ddlmZ ddlm Z ddl
mZ G dd� d�ZG d d
� d
�Z
G dd� d�ZG d
d� de j�ZdS )zyInstance Messenger base classes for protocol support.
You will find these useful if you're adding a new protocol to IM.
� )�OFFLINE�OfflineError)�Protocol��prefixedMethods)�styles)�errorc @ sD e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dS )�
AbstractGroupc C s || _ || _d S �N)�name�account)�selfr r � r �>/usr/lib/python3/dist-packages/twisted/words/im/basesupport.py�__init__ s zAbstractGroup.__init__c C s
t | d�S )z�finds group commands
these commands are methods on me that start with imgroup_; they are
called with no arguments
Zimgroup_r �r
r r r �getGroupCommands s zAbstractGroup.getGroupCommandsc C s
t | d�S )a( finds group commands
these commands are methods on me that start with imgroup_; they are
called with a user present within this room as an argument
you may want to override this in your group in order to filter for
appropriate commands on the given user
Z imtarget_r )r
�targetr r r �getTargetCommands# s zAbstractGroup.getTargetCommandsc C s | j jst�| j j�| j� d S r
)r �clientr Z joinGroupr r r r r �join. s zAbstractGroup.joinc C s | j jst�| j j�| j� d S r
)r r r Z
leaveGroupr r r r r �leave3 s zAbstractGroup.leavec C s d| j | jf S )Nz<%s %r>)� __class__r r r r r �__repr__8 s zAbstractGroup.__repr__c C s d| j | jjf S �Nz%s@%s�r r �accountNamer r r r �__str__; s zAbstractGroup.__str__N)
�__name__�
__module__�__qualname__r r r r r r r r r r r r s r c @ s4 e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� ZdS )�AbstractPersonc C s || _ || _t| _d S r
)r r r �status)r
r ZbaseAccountr r r r ? s zAbstractPerson.__init__c C s
t | d�S )z�finds person commands
these commands are methods on me that start with imperson_; they are
called with no arguments
Z imperson_r r r r r �getPersonCommandsD s z AbstractPerson.getPersonCommandsc C s dS )z#
Returns a string.
z--r r r r r �getIdleTimeL s zAbstractPerson.getIdleTimec C s d| j | j| jf S )Nz
<%s %r/%s>)r r r"