diff -r 3733e2b23cf7 -r a071d4065202 src/eric7/Network/IRC/IrcNetworkManager.py --- a/src/eric7/Network/IRC/IrcNetworkManager.py Wed Dec 20 11:06:38 2023 +0100 +++ b/src/eric7/Network/IRC/IrcNetworkManager.py Wed Dec 20 14:58:58 2023 +0100 @@ -35,7 +35,8 @@ """ Constructor - @param name name of the identity (string) + @param name name of the identity + @type str """ super().__init__() @@ -56,7 +57,8 @@ """ Public method to save the identity data. - @param settings reference to the settings object (QSettings) + @param settings reference to the settings object + @type QSettings """ # no need to save the name because that is the group key settings.setValue("Ident", self.__ident) @@ -73,7 +75,8 @@ """ Public method to load the identity data. - @param settings reference to the settings object (QSettings) + @param settings reference to the settings object + @type QSettings """ self.__ident = settings.value("Ident", OSUtilities.getUserName()) self.__realName = settings.value("RealName", "") @@ -97,7 +100,8 @@ """ Public method to set the identity name. - @param name identity name (string) + @param name identity name + @type str """ self.__name = name @@ -105,7 +109,8 @@ """ Public method to get the identity name. - @return identity name (string) + @return identity name + @rtype str """ return self.__name @@ -113,7 +118,8 @@ """ Public method to set the real identity name. - @param name real identity name (string) + @param name real identity name + @type str """ self.__ident = name @@ -121,7 +127,8 @@ """ Public method to get the real identity name. - @return real identity name (string) + @return real identity name + @rtype str """ return self.__ident @@ -129,7 +136,8 @@ """ Public method to set the real name of the identity. - @param name real name (string) + @param name real name + @type str """ self.__realName = name @@ -137,7 +145,8 @@ """ Public method to get the real name. - @return real name (string) + @return real name + @rtype str """ return self.__realName @@ -145,7 +154,8 @@ """ Public method to set the nick names of the identity. - @param names nick names (list of string) + @param names nick names + @type list of str """ self.__nickNames = names[:] @@ -153,7 +163,8 @@ """ Public method to get the nick names. - @return nick names (list of string) + @return nick names + @rtype list of str """ return self.__nickNames @@ -162,7 +173,8 @@ Public method to set the service name of the identity used for identification. - @param name service name (string) + @param name service name + @type str """ self.__serviceName = name @@ -171,7 +183,8 @@ Public method to get the service name of the identity used for identification. - @return service name (string) + @return service name + @rtype str """ return self.__serviceName @@ -179,7 +192,8 @@ """ Public method to set a new password. - @param password password to set (string) + @param password password to set + @type str """ self.__password = pwConvert(password, encode=True) @@ -187,7 +201,8 @@ """ Public method to get the password. - @return password (string) + @return password + @rtype str """ return pwConvert(self.__password, encode=False) @@ -195,7 +210,8 @@ """ Public method to set the QUIT message. - @param message QUIT message (string) + @param message QUIT message + @type str """ if message: self.__quitMessage = message @@ -206,7 +222,8 @@ """ Public method to get the QUIT message. - @return QUIT message (string) + @return QUIT message + @rtype str """ return self.__quitMessage @@ -214,7 +231,8 @@ """ Public method to set the PART message. - @param message PART message (string) + @param message PART message + @type str """ if message: self.__partMessage = message @@ -225,7 +243,8 @@ """ Public method to get the PART message. - @return PART message (string) + @return PART message + @rtype str """ return self.__partMessage @@ -233,7 +252,8 @@ """ Public method to set to remember the chat position upon AWAY. - @param remember flag indicating to remember the chat position (boolean) + @param remember flag indicating to remember the chat position + @type bool """ self.__rememberPosOnAway = remember @@ -242,7 +262,8 @@ Public method to get a flag indicating to remember the chat position upon AWAY. - @return flag indicating to remember the chat position (boolean) + @return flag indicating to remember the chat position + @rtype bool """ return self.__rememberPosOnAway @@ -250,7 +271,8 @@ """ Public method to set the AWAY message. - @param message AWAY message (string) + @param message AWAY message + @type str """ if message: self.__awayMessage = message @@ -261,7 +283,8 @@ """ Public method to get the AWAY message. - @return AWAY message (string) + @return AWAY message + @rtype str """ return self.__awayMessage @@ -270,7 +293,8 @@ """ Class method to create the default identity. - @return default identity (IrcIdentity) + @return default identity + @rtype IrcIdentity """ userName = OSUtilities.getUserName() realName = OSUtilities.getRealName() @@ -295,7 +319,8 @@ """ Constructor - @param name name of the server (string) + @param name name of the server + @type str """ super().__init__() @@ -308,7 +333,8 @@ """ Public method to save the server data. - @param settings reference to the settings object (QSettings) + @param settings reference to the settings object + @type QSettings """ settings.setValue("Name", self.__server) settings.setValue("Port", self.__port) @@ -319,7 +345,8 @@ """ Public method to load the server data. - @param settings reference to the settings object (QSettings) + @param settings reference to the settings object + @type QSettings """ self.__server = settings.value("Name", "") self.__port = int(settings.value("Port", IrcServer.DefaultPort)) @@ -330,7 +357,8 @@ """ Public method to get the server name. - @return server name (string) + @return server name + @rtype str """ return self.__server @@ -338,7 +366,8 @@ """ Public method to set the server name. - @param name server name (string) + @param name server name + @type str """ self.__server = name @@ -346,7 +375,8 @@ """ Public method to get the server port number. - @return port number (integer) + @return port number + @rtype int """ return self.__port @@ -354,7 +384,8 @@ """ Public method to set the server port number. - @param port server port number (integer) + @param port server port number + @type int """ self.__port = port @@ -362,7 +393,8 @@ """ Public method to check for SSL usage. - @return flag indicating SSL usage (boolean) + @return flag indicating SSL usage + @rtype bool """ return self.__ssl @@ -370,7 +402,8 @@ """ Public method to set the SSL usage. - @param on flag indicating SSL usage (boolean) + @param on flag indicating SSL usage + @type bool """ self.__ssl = on @@ -378,7 +411,8 @@ """ Public method to set a new password. - @param password password to set (string) + @param password password to set + @type str """ self.__password = pwConvert(password, encode=True) @@ -386,7 +420,8 @@ """ Public method to get the password. - @return password (string) + @return password + @rtype str """ return pwConvert(self.__password, encode=False) @@ -400,7 +435,8 @@ """ Constructor - @param name name of the network (string) + @param name name of the network + @type str """ super().__init__() @@ -412,7 +448,8 @@ """ Public method to save the channel data. - @param settings reference to the settings object (QSettings) + @param settings reference to the settings object + @type QSettings """ # no need to save the channel name because that is the group key settings.setValue("Key", self.__key) @@ -422,7 +459,8 @@ """ Public method to load the network data. - @param settings reference to the settings object (QSettings) + @param settings reference to the settings object + @type QSettings """ self.__key = settings.value("Key", "") self.__autoJoin = Preferences.toBool(settings.value("AutoJoin", False)) @@ -431,7 +469,8 @@ """ Public method to get the channel name. - @return channel name (string) + @return channel name + @rtype str """ return self.__name @@ -439,7 +478,8 @@ """ Public method to set a new channel key. - @param key channel key to set (string) + @param key channel key to set + @type str """ self.__key = pwConvert(key, encode=True) @@ -447,7 +487,8 @@ """ Public method to get the channel key. - @return channel key (string) + @return channel key + @rtype str """ return pwConvert(self.__key, encode=False) @@ -456,7 +497,8 @@ Public method to check the auto join status. @return flag indicating if the channel should be - joined automatically (boolean) + joined automatically + @rtype bool """ return self.__autoJoin @@ -465,7 +507,8 @@ Public method to set the auto join status of the channel. @param enable flag indicating if the channel should be - joined automatically (boolean) + joined automatically + @type bool """ self.__autoJoin = enable @@ -479,7 +522,8 @@ """ Constructor - @param name name of the network (string) + @param name name of the network + @type str """ super().__init__() @@ -493,7 +537,8 @@ """ Public method to save the network data. - @param settings reference to the settings object (QSettings) + @param settings reference to the settings object + @type QSettings """ # no need to save the network name because that is the group key settings.setValue("Identity", self.__identity) @@ -514,7 +559,8 @@ """ Public method to load the network data. - @param settings reference to the settings object (QSettings) + @param settings reference to the settings object + @type QSettings """ self.__identity = settings.value("Identity", "") self.__autoConnect = Preferences.toBool(settings.value("AutoConnect", False)) @@ -536,7 +582,8 @@ """ Public method to set the network name. - @param name network name (string) + @param name network name + @type str """ self.__name = name @@ -544,7 +591,8 @@ """ Public method to get the network name. - @return network name (string) + @return network name + @rtype str """ return self.__name @@ -552,7 +600,8 @@ """ Public method to set the name of the identity. - @param name identity name (string) + @param name identity name + @type str """ self.__identity = name @@ -560,7 +609,8 @@ """ Public method to get the name of the identity. - @return identity name (string) + @return identity name + @rtype str """ return self.__identity @@ -568,7 +618,8 @@ """ Public method to get the server name. - @return server name (string) + @return server name + @rtype str """ if self.__server: return self.__server.getName() @@ -579,7 +630,8 @@ """ Public method to get the server object. - @return reference to the server (IrcServer) + @return reference to the server + @rtype IrcServer """ return self.__server @@ -587,7 +639,8 @@ """ Public method to set the server. - @param server server object to set (IrcServer) + @param server server object to set + @type IrcServer """ self.__server = server @@ -595,7 +648,8 @@ """ Public method to set the list of channels. - @param channels list of channels for the network (list of IrcChannel) + @param channels list of channels for the network + @type list of IrcChannel """ self.__channels = {} for channel in channels: @@ -605,7 +659,8 @@ """ Public method to get the channels. - @return list of channels for the network (list of IrcChannel) + @return list of channels for the network + @rtype list of IrcChannel """ return list(copy.deepcopy(self.__channels).values()) @@ -613,7 +668,8 @@ """ Public method to get the list of channels. - @return list of channel names (list of string) + @return list of channel names + @rtype list of str """ return sorted(self.__channels) @@ -621,8 +677,10 @@ """ Public method to get a channel. - @param channelName name of the channel to retrieve (string) - @return reference to the channel (IrcChannel) + @param channelName name of the channel to retrieve + @type str + @return reference to the channel + @rtype IrcChannel """ if channelName in self.__channels: return self.__channels[channelName] @@ -633,7 +691,8 @@ """ Public method to set a channel. - @param channel channel object to set (IrcChannel) + @param channel channel object to set + @type IrcChannel """ channelName = channel.getName() if channelName in self.__channels: @@ -643,7 +702,8 @@ """ Public method to add a channel. - @param channel channel object to add (IrcChannel) + @param channel channel object to add + @type IrcChannel """ channelName = channel.getName() if channelName not in self.__channels: @@ -653,7 +713,8 @@ """ Public method to delete the given channel. - @param channelName name of the channel to be deleted (string) + @param channelName name of the channel to be deleted + @type str """ if channelName in self.__channels: del self.__channels[channelName] @@ -662,7 +723,8 @@ """ Public method to set the auto connect flag. - @param enable flag indicate to connect to the network at start-up. + @param enable flag indicate to connect to the network at start-up + @type bool """ self.__autoConnect = enable @@ -671,7 +733,8 @@ Public method to check, if the network should be connected to at start-up. - @return flag indicating an auto connect (boolean) + @return flag indicating an auto connect + @rtype bool """ return self.__autoConnect @@ -681,8 +744,9 @@ Class method to create the default network. @param ssl flag indicating to create a SSL network configuration - (boolean) - @return default network object (IrcNetwork) + @type bool + @return default network object + @rtype IrcNetwork """ # network networkName = "libera.chat (SSL)" if ssl else "libera.chat" @@ -727,7 +791,8 @@ """ Constructor - @param parent reference to the parent object (QObject) + @param parent reference to the parent object + @type QObject """ super().__init__(parent) @@ -821,7 +886,8 @@ Private method to load default values. @param identityOnly flag indicating to just load the default - identity (boolean) + identity + @type bool """ if not identityOnly: self.__networks = {} @@ -847,10 +913,13 @@ """ Public method to get an identity object. - @param name name of the identity to get (string) + @param name name of the identity to get + @type str @param create flag indicating to create a new object, - if none exists (boolean) - @return reference to the identity (IrcIdentity) + if none exists + @type bool + @return reference to the identity + @rtype IrcIdentity """ if not name: return None @@ -874,7 +943,8 @@ """ Public method to get a copy of all identities. - @return dictionary of all identities (dict of IrcIdentity) + @return dictionary of all identities + @rtype dict of IrcIdentity """ return copy.deepcopy(self.__identities) @@ -882,7 +952,8 @@ """ Public method to set the identities. - @param identities dictionary of all identities (dict of IrcIdentity) + @param identities dictionary of all identities + @type dict of IrcIdentity """ self.__identities = copy.deepcopy(identities) self.identityChanged() @@ -897,7 +968,8 @@ """ Public method to get the names of all identities. - @return names of all identities (list of string) + @return names of all identities + @rtype list of string) """ return list(self.__identities) @@ -905,7 +977,8 @@ """ Public method to add a new identity. - @param identity reference to the identity to add (IrcIdentity) + @param identity reference to the identity to add + @type IrcIdentity """ name = identity.getName() self.__identities[name] = identity @@ -915,7 +988,8 @@ """ Public method to delete the given identity. - @param name name of the identity to delete (string) + @param name name of the identity to delete + @type str """ if name in self.__identities and name != IrcIdentity.DefaultIdentityName: del self.__identities[name] @@ -925,8 +999,10 @@ """ Public method to rename an identity. - @param oldName old name of the identity (string) - @param newName new name of the identity (string) + @param oldName old name of the identity + @type str + @param newName new name of the identity + @type str """ if oldName in self.__identities: self.__identities[newName] = self.__identities[oldName] @@ -953,8 +1029,10 @@ """ Public method to get a network object. - @param name name of the network (string) - @return reference to the network object (IrcNetwork) + @param name name of the network + @type str + @return reference to the network object + @rtype IrcNetwork """ if not self.__loaded: self.__load() @@ -968,8 +1046,10 @@ """ Public method to set a network. - @param network network object to set (IrcNetwork) - @param networkName name the network was known for (string) + @param network network object to set + @type IrcNetwork + @param networkName name the network was known for + @type str """ name = network.getName() if networkName and name != networkName: @@ -984,7 +1064,8 @@ """ Public method to add a network. - @param network network object to add (IrcNetwork) + @param network network object to add + @type IrcNetwork """ name = network.getName() if name not in self.__networks: @@ -995,7 +1076,8 @@ """ Public method to delete the given network. - @param name name of the network to delete (string) + @param name name of the network to delete + @type str """ if name in self.__networks: del self.__networks[name] @@ -1012,7 +1094,8 @@ """ Public method to get a list of all known network names. - @return list of network names (list of string) + @return list of network names + @rtype list of str """ if not self.__loaded: self.__load()