diff -r 866adc8c315b -r 0acf98cd089a eric6/Utilities/BackgroundClient.py --- a/eric6/Utilities/BackgroundClient.py Sun Jan 17 13:53:08 2021 +0100 +++ b/eric6/Utilities/BackgroundClient.py Mon Feb 01 10:38:16 2021 +0100 @@ -25,7 +25,7 @@ """ def __init__(self, host, port, maxProcs): """ - Constructor of the BackgroundClient class. + Constructor @param host ip address the background service is listening @type str @@ -47,10 +47,14 @@ """ Private method to import the given module and register it as service. - @param fn service name to register (str) - @param path contains the path to the module (str) - @param module name to import (str) - @return text result of the import action (str) + @param fn service name to register + @type str + @param path contains the path to the module + @type str + @param module name to import + @type str + @return text result of the import action + @rtype str """ sys.path.insert(1, path) try: @@ -68,11 +72,15 @@ def __send(self, fx, fn, data): """ - Private method to send a job response back to the BackgroundService. + Private method to send a job response back to the BackgroundService + server. - @param fx remote function name to execute (str) - @param fn filename for identification (str) - @param data return value(s) (any basic datatype) + @param fx remote function name to execute + @type str + @param fn filename for identification + @type str + @param data return value(s) + @type any basic datatype """ if not isinstance(data, ( dict, list, tuple, str, int, float, bool, type(None), @@ -89,10 +97,12 @@ def __receive(self, length): """ - Private methode to receive the given length of bytes. + Private method to receive the given length of bytes. - @param length bytes to receive (int) - @return received bytes or None if connection closed (bytes) + @param length bytes to receive + @type int + @return received bytes or None if connection closed + @rtype bytes """ data = b'' while len(data) < length: @@ -104,10 +114,12 @@ def __peek(self, length): """ - Private methode to peek the given length of bytes. + Private method to peek the given length of bytes. - @param length bytes to receive (int) - @return received bytes (bytes) + @param length bytes to receive + @type int + @return received bytes + @rtype bytes """ data = b'' self.connection.setblocking(False) @@ -124,7 +136,8 @@ """ Private method to check for a job cancellation. - @return flag indicating a cancellation (boolean) + @return flag indicating a cancellation + @rtype bool """ msg = self.__peek(struct.calcsize(b'!II') + 6) if msg[-6:] == b"CANCEL": @@ -205,7 +218,8 @@ if __name__ == '__main__': if len(sys.argv) != 4: - print('Host, port and max. processes parameters are missing. Abort.') + print('Host, port and max. processes parameters are missing.' + ' Aborting.') sys.exit(1) host, port, maxProcs = sys.argv[1:]