From 0b29876146677f65ee401c9dba5a0ffa0aa82f0d Mon Sep 17 00:00:00 2001 From: Drew Devereux <drew.devereux@csiro.au> Date: Thu, 10 Jun 2021 04:41:49 +0000 Subject: [PATCH] [MCCS-659] RST docstring fixes --- src/ska_tango_base/base/base_device.py | 53 ++++++++++++------- .../subarray/reference_component_manager.py | 2 +- tests/test_base_device.py | 2 +- 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/src/ska_tango_base/base/base_device.py b/src/ska_tango_base/base/base_device.py index 0ba6d69d..28321e60 100644 --- a/src/ska_tango_base/base/base_device.py +++ b/src/ska_tango_base/base/base_device.py @@ -208,26 +208,43 @@ class LoggingUtils: """ Parse syslog URL and extract address and socktype parameters for SysLogHandler. - :param url: - Universal resource locator string for syslog target. Three types are supported: - file path, remote UDP server, remote TCP server. - - Output to a file: 'file://<path to file>' - Example: 'file:///dev/log' will write to '/dev/log' - - Output to remote server over UDP: 'udp://<hostname>:<port>' - Example: 'udp://syslog.com:514' will send to host 'syslog.com' on UDP port 514 - - Output to remote server over TCP: 'tcp://<hostname>:<port>' - Example: 'tcp://rsyslog.com:601' will send to host 'rsyslog.com' on TCP port 601 - For backwards compatibility, if the protocol prefix is missing, the type is - interpreted as file. This is deprecated. - - Example: '/dev/log' is equivalent to 'file:///dev/log' - - :return: (address, socktype) + :param url: Universal resource locator string for syslog target. + Three types are supported: file path, remote UDP server, + remote TCP server. + + - Output to a file: 'file://<path to file>'. For example, + 'file:///dev/log' will write to '/dev/log'. + + - Output to remote server over UDP: + 'udp://<hostname>:<port>'. For example, + 'udp://syslog.com:514' will send to host 'syslog.com' on + UDP port 514 + + - Output to remote server over TCP: + 'tcp://<hostname>:<port>'. For example, + 'tcp://rsyslog.com:601' will send to host 'rsyslog.com' on + TCP port 601 + + For backwards compatibility, if the protocol prefix is + missing, the type is interpreted as file. This is + deprecated. For example, '/dev/log' is equivalent to + 'file:///dev/log'. + + :return: An (address, socktype) tuple. + For file types: - - address is the file path as as string + + - the address is the file path as as string + - socktype is None + For UDP and TCP: - - address is tuple of (hostname, port), with hostname a string, and port an integer. - - socktype is socket.SOCK_DGRAM for UDP, or socket.SOCK_STREAM for TCP. + + - the address is tuple of (hostname, port), with hostname a + string, and port an integer. + + - socktype is socket.SOCK_DGRAM for UDP, or + socket.SOCK_STREAM for TCP. :raises LoggingTargetError: for invalid url string """ @@ -1443,7 +1460,7 @@ class SKABaseDevice(Device): Enable remote debugging of this device. To modify behaviour for this command, modify the do() method of - the command class: :class:`.DebugDeviceCommand`. + the command class: :py:class:`.DebugDeviceCommand`. """ command = self.get_command_object("DebugDevice") return command() diff --git a/src/ska_tango_base/subarray/reference_component_manager.py b/src/ska_tango_base/subarray/reference_component_manager.py index 4d93d591..497170c0 100644 --- a/src/ska_tango_base/subarray/reference_component_manager.py +++ b/src/ska_tango_base/subarray/reference_component_manager.py @@ -142,7 +142,7 @@ class ReferenceSubarrayComponentManager( :return: whether this resource pool contains the specified resources - :rtype bool + :rtype: bool """ return resources in self._resources diff --git a/tests/test_base_device.py b/tests/test_base_device.py index c7a9ae03..8aa55f9e 100644 --- a/tests/test_base_device.py +++ b/tests/test_base_device.py @@ -718,7 +718,7 @@ class TestSKABaseDevice_commands: Return a factory that constructs a command object for a given class. :returns: a factory that constructs a command object for a given - class + class """ def _command_factory(command): -- GitLab