eric5.Cooperation.CooperationClient

Module implementing the client of the cooperation package.

Global Attributes

None

Classes

CooperationClient Class implementing the client of the cooperation package.

Functions

None


CooperationClient

Class implementing the client of the cooperation package.

Signals

cannotConnect()
emitted, if the initial connection fails
connectionError(message)
emitted when a connection error occurs (string)
editorCommand(hash, filename, message)
emitted when an editor command has been received (string, string, string)
newMessage(user, message)
emitted after a new message has arrived (string, string)
newParticipant(nickname)
emitted after a new participant joined (string)
participantLeft(nickname)
emitted after a participant left (string)

Derived from

QObject

Class Attributes

cannotConnect
connectionError
editorCommand
newMessage
newParticipant
participantLeft

Methods

CooperationClient Constructor
__connectionError Private slot to handle a connection error.
__connectionRejected Private slot to handle the rejection of a connection.
__disconnected Private slot to handle the disconnection of a chat client.
__findConnections Public method to get a list of connection given a nick name.
__getParticipants Private slot to handle the request for a list of participants.
__newConnection Private slot to handle a new connection.
__processParticipants Private slot to handle the receipt of a list of participants.
__readyForUse Private slot to handle a connection getting ready for use.
banKickUser Public method to ban and kick a user by its nick name.
banUser Public method to ban a user by its nick name.
connectToHost Public method to connect to a host.
disconnectConnections Public slot to disconnect from the chat network.
hasConnection Public method to check for an existing connection.
hasConnections Public method to check, if there are any connections established.
kickUser Public method to kick a user by its nick name.
nickName Public method to get the nick name.
removeConnection Public method to remove a connection.
sendEditorCommand Public method to send an editor command.
sendMessage Public method to send a message.
server Public method to get a reference to the server.

CooperationClient (Constructor)

CooperationClient(parent = None)

Constructor

parent
reference to the parent object (QObject)

CooperationClient.__connectionError

__connectionError(socketError)

Private slot to handle a connection error.

socketError
reference to the error object (QAbstractSocket.SocketError)

CooperationClient.__connectionRejected

__connectionRejected(msg)

Private slot to handle the rejection of a connection.

msg
error message (string)

CooperationClient.__disconnected

__disconnected()

Private slot to handle the disconnection of a chat client.

CooperationClient.__findConnections

__findConnections(nick)

Public method to get a list of connection given a nick name.

nick
nick name in the format of self.nickName() (string)
Returns:
list of references to the connection objects (list of Connection)

CooperationClient.__getParticipants

__getParticipants()

Private slot to handle the request for a list of participants.

CooperationClient.__newConnection

__newConnection(connection)

Private slot to handle a new connection.

connection
reference to the new connection (Connection)

CooperationClient.__processParticipants

__processParticipants(participants)

Private slot to handle the receipt of a list of participants.

participants
list of participants (list of strings of "host:port")

CooperationClient.__readyForUse

__readyForUse()

Private slot to handle a connection getting ready for use.

CooperationClient.banKickUser

banKickUser(nick)

Public method to ban and kick a user by its nick name.

nick
nick name in the format of self.nickName() (string)

CooperationClient.banUser

banUser(nick)

Public method to ban a user by its nick name.

nick
nick name in the format of self.nickName() (string)

CooperationClient.connectToHost

connectToHost(host, port)

Public method to connect to a host.

host
host to connect to (string)
port
port to connect to (integer)

CooperationClient.disconnectConnections

disconnectConnections()

Public slot to disconnect from the chat network.

CooperationClient.hasConnection

hasConnection(senderIp, senderPort = -1)

Public method to check for an existing connection.

senderIp
address of the sender (QHostAddress)
senderPort
port of the sender (integer)
Returns:
flag indicating an existing connection (boolean)

CooperationClient.hasConnections

hasConnections()

Public method to check, if there are any connections established.

Returns:
flag indicating the presence of connections (boolean)

CooperationClient.kickUser

kickUser(nick)

Public method to kick a user by its nick name.

nick
nick name in the format of self.nickName() (string)

CooperationClient.nickName

nickName()

Public method to get the nick name.

Returns:
nick name (string)

CooperationClient.removeConnection

removeConnection(connection)

Public method to remove a connection.

connection
reference to the connection to be removed (Connection)

CooperationClient.sendEditorCommand

sendEditorCommand(projectHash, filename, message)

Public method to send an editor command.

projectHash
hash of the project (string)
filename
project relative universal file name of the sending editor (string)
message
editor command to be sent (string)

CooperationClient.sendMessage

sendMessage(message)

Public method to send a message.

message
message to be sent (string)

CooperationClient.server

server()

Public method to get a reference to the server.

Returns:
reference to the server object (CooperationServer)
Up