src/eric7/Cooperation/CooperationClient.py

branch
eric7
changeset 10423
299802979277
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
--- a/src/eric7/Cooperation/CooperationClient.py	Tue Dec 19 11:04:03 2023 +0100
+++ b/src/eric7/Cooperation/CooperationClient.py	Tue Dec 19 19:57:08 2023 +0100
@@ -45,7 +45,8 @@
         """
         Constructor
 
-        @param parent reference to the parent object (QObject)
+        @param parent reference to the parent object
+        @type QObject
         """
         super().__init__(parent)
 
@@ -91,7 +92,8 @@
         """
         Public method to get a reference to the chat widget.
 
-        @return reference to the chat widget (ChatWidget)
+        @return reference to the chat widget
+        @rtype ChatWidget
         """
         return self.__chatWidget
 
@@ -99,7 +101,8 @@
         """
         Public method to send a message.
 
-        @param message message to be sent (string)
+        @param message message to be sent
+        @type str
         """
         if message == "":
             return
@@ -112,7 +115,8 @@
         """
         Public method to get the nick name.
 
-        @return nick name (string)
+        @return nick name
+        @rtype str
         """
         return "{0}@{1}@{2}".format(
             self.__username, QHostInfo.localHostName(), self.__servers[0].serverPort()
@@ -122,9 +126,12 @@
         """
         Public method to check for an existing connection.
 
-        @param senderIp address of the sender (QHostAddress)
-        @param senderPort port of the sender (integer)
-        @return flag indicating an existing connection (boolean)
+        @param senderIp address of the sender
+        @type QHostAddress
+        @param senderPort port of the sender
+        @type int
+        @return flag indicating an existing connection
+        @rtype bool
         """
         if senderPort == -1:
             return senderIp in self.__peers
@@ -140,7 +147,8 @@
         """
         Public method to check, if there are any connections established.
 
-        @return flag indicating the presence of connections (boolean)
+        @return flag indicating the presence of connections
+        @rtype bool
         """
         return any(bool(connectionList) for connectionList in self.__peers.values())
 
@@ -149,7 +157,7 @@
         Public method to remove a connection.
 
         @param connection reference to the connection to be removed
-            (Connection)
+        @type Connection
         """
         if (
             connection.peerAddress() in self.__peers
@@ -175,7 +183,8 @@
         """
         Private slot to handle a new connection.
 
-        @param connection reference to the new connection (Connection)
+        @param connection reference to the new connection
+        @type Connection
         """
         connection.setParent(self)
         connection.setClient(self)
@@ -190,7 +199,8 @@
         """
         Private slot to handle the rejection of a connection.
 
-        @param msg error message (string)
+        @param msg error message
+        @type str
         """
         self.connectionError.emit(msg)
 
@@ -253,8 +263,10 @@
         """
         Public method to connect to a host.
 
-        @param host host to connect to (string)
-        @param port port to connect to (integer)
+        @param host host to connect to
+        @type str
+        @param port port to connect to
+        @type int
         """
         self.__initialConnection = Connection(self)
         self.__newConnection(self.__initialConnection)
@@ -284,8 +296,8 @@
         """
         Private slot to handle the receipt of a list of participants.
 
-        @param participants list of participants (list of strings of
-            "host:port")
+        @param participants list of participants (list of "host:port" strings)
+        @type list of str
         """
         for participant in participants:
             host, port = participant.split("@")
@@ -304,10 +316,13 @@
         """
         Public method to send an editor command.
 
-        @param projectHash hash of the project (string)
+        @param projectHash hash of the project
+        @type str
         @param filename project relative universal file name of
-            the sending editor (string)
-        @param message editor command to be sent (string)
+            the sending editor
+        @type str
+        @param message editor command to be sent
+        @type str
         """
         for connectionList in self.__peers.values():
             for connection in connectionList:
@@ -317,9 +332,10 @@
         """
         Private method to get a list of connection given a nick name.
 
-        @param nick nick name in the format of self.nickName() (string)
-        @return list of references to the connection objects (list of
-            Connection)
+        @param nick nick name in the format of self.nickName()
+        @type str
+        @return list of references to the connection objects
+        @rtype list of Connection
         """
         if "@" not in nick:
             # nick given in wrong format
@@ -337,7 +353,8 @@
         """
         Public method to kick a user by its nick name.
 
-        @param nick nick name in the format of self.nickName() (string)
+        @param nick nick name in the format of self.nickName()
+        @type str
         """
         for connection in self.__findConnections(nick):
             connection.abort()
@@ -346,7 +363,8 @@
         """
         Public method to ban a user by its nick name.
 
-        @param nick nick name in the format of self.nickName() (string)
+        @param nick nick name in the format of self.nickName()
+        @type str
         """
         Preferences.syncPreferences()
         user = nick.rsplit("@")[0]
@@ -359,7 +377,8 @@
         """
         Public method to ban and kick a user by its nick name.
 
-        @param nick nick name in the format of self.nickName() (string)
+        @param nick nick name in the format of self.nickName()
+        @type str
         """
         self.banUser(nick)
         self.kickUser(nick)
@@ -368,9 +387,11 @@
         """
         Public method to start listening for new connections.
 
-        @param port port to listen on (integer)
-        @return tuple giving a flag indicating success (boolean) and
-            the port the server listens on
+        @param port port to listen on
+        @type int
+        @return tuple giving a flag indicating success and the port the
+            server listens on
+        @rtype tuple of (bool, int)
         """
         if self.__servers:
             # do first server and determine free port
@@ -395,7 +416,8 @@
         """
         Public method to check, if the client is listening for connections.
 
-        @return flag indicating the listening state (boolean)
+        @return flag indicating the listening state
+        @rtype bool
         """
         return self.__listening
 
@@ -413,6 +435,6 @@
         server error.
 
         @return human readable error message about the last server error
-            (string)
+        @rtype str
         """
         return self.__serversErrorString

eric ide

mercurial