RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
Common Tool Utilities

Common Python utility modules for client tool applications. More...

Files

file  __init__.py
 Provides utilities used to implement CLIs.
 
file  argtypes.py
 Provides classes for CLI argument type conversions.
 
file  config.py
 Provides a helper classes for dealing with the tool configuration.
 
file  exceptions.py
 Provides a helpers for dealing with exceptions.
 
file  __init__.py
 Provides utilities to help implement GUIs.
 
file  logging.py
 Various common helpers for logging in the GUIs.
 
file  sighandler.py
 Signal handlers for integrating with a GUI.
 
file  startup.py
 Various common helpers for startup related steps in the GUIs.
 

Classes

class  cli.argtypes.LogLevel
 Enumeration of allowed log levels accepted by the CLI. More...
 
class  cli.argtypes.RepositoryTypeMeta
 Metaclass used to customise the contains method for RepositoryType and make it work with the "in" operator. More...
 
class  cli.argtypes.RepositoryType
 Enumeration of allowed repository types accepted by the CLI. More...
 
class  cli.argtypes.UriParamType
 CLI argument type for URI objects used with the click module. More...
 
class  cli.argtypes.DpPathParamType
 CLI argument type for DataPointPath objects used with the click module. More...
 
class  cli.argtypes.DpTypeParamType
 CLI argument type for use with arguments that represent a RTC Toolkit type object. More...
 
class  cli.config.CommonConfigurationParameters
 This class defines the minimal set of configuration parameters for an RTC Toolkit command line tool. More...
 
class  cli.config.ConfigSourceLocation
 Enumeration of possible locations from which the configuration parameter is being used. More...
 
class  cli.config.ConfigurationValue
 A data class that holds a configuration parameter value and additional associated metadata. More...
 
class  cli.config.ConfigurationManager
 This class is used to load configuration from the Persistent Configuration Repository, taking into account the Service Discovery and command line options parsed by the click module. More...
 

Functions

 cli.config.convert_to_log_level (level)
 Converts the level argument into a valid LogLevel enumeration or raises an error for invalid log level strings.
 
 cli.config.convert_to_uri (value)
 Converts the argument to a Uri object or raises an error for invalid values.
 
 cli.exceptions.format_error_message (Exception error)
 This module provides various helpers for dealing with exceptions in the client applications.
 
 gui.logging.setup_dummy_taurus_logger ()
 This module provides common helpers for dealing with logging in the GUIs.
 
 gui.sighandler.int_signal_handler (signum, frame)
 Signal handler for SIGINT.
 
 gui.startup.check_if_display_available ()
 Checks if a windows manager is available, i.e.
 

Detailed Description

Common Python utility modules for client tool applications.

Function Documentation

◆ check_if_display_available()

gui.startup.check_if_display_available ( )

Checks if a windows manager is available, i.e.

a display. If not then raise and error.

◆ convert_to_log_level()

cli.config.convert_to_log_level ( level)

Converts the level argument into a valid LogLevel enumeration or raises an error for invalid log level strings.

◆ convert_to_uri()

cli.config.convert_to_uri ( value)

Converts the argument to a Uri object or raises an error for invalid values.

◆ format_error_message()

cli.exceptions.format_error_message ( Exception error)

This module provides various helpers for dealing with exceptions in the client applications.

Prepares a text message for printing or logging that also lists all nested/chained exceptions if we are dealing with a nested/chained exception.

◆ int_signal_handler()

gui.sighandler.int_signal_handler ( signum,
frame )

Signal handler for SIGINT.

Registers how many times the signal handler has been called. If this is the first time, it requests a gracefull exit. If this is the second time or greater, it terminates the python process with exit code SIGINT.

◆ setup_dummy_taurus_logger()

gui.logging.setup_dummy_taurus_logger ( )

This module provides common helpers for dealing with logging in the GUIs.

This method is used as a workaround to prevent Taurus from hijacking the logging system. It should be called as early as possible in the process startup, to trigger the logging setup once in Taurus. It works by creating a dummy Logger object so that Taurus thinks the setup has already been done. The logging system can then be reconfigured later properly.