Package: tflowclient
tflowclientThetflowclientpackage (Text-based workFlow scheduler Client) provides all
the necessary bits to build text-based console clients to interact with
various workflow schedulers. For now, onlySMSis supported: see thebin/tflowclient_cdp.pyexecutable.The default display is a tree-view of the workload currently being managed by
the workflow scheduler. An alternative display/"app" is available and can
be trigger by adding `-a Cancel`` on the command-line: it allows to select
several root nodes and to cancel (i.e. delete) them.Requirements & DependenciesThetflowclientpackage is only compatible with Python >= 3.7.Thetflowclientpackage itself only depends on the non-standardurwidpackage that is available on PyPi.Developers will also need to install thepytestandblackPyPi
packages in order to respectively test the code and format the code.To use thebin/tflowclient_cdp.pyexecutable, acdpexecutable needs to
be available in the system's path. Otherwise, its path can be specified in the
user-specific configuration file~/.tflowclientrc.ini.InstallationManuallyJust fetch the code and add thesrcdirectory to yourPYTHONPATH.ViapipInstallpip's build package:pip install buildBuild thetflowclientpackage (from the repository root directory):python -m buildAfter this step, a ready to use pip package should be located in thedistsubdirectory. It may be installed using pip:pip install ./dist/package_name.tar.gzRules regarding developmentsAll the Python code (including the code inbinandtestssubdirectories)
must comply with PEP8. Prior to any commit in the central repository, all
the Python codemustbe automatically formatted using the black formatter:black .All the unit tests must succeed at any time. Thepytestlauncher should
be used (from the repository root directory):pytestThe~/.tflowclientrc.iniconfiguration fileThe configuration file is optional. You do not need to create it unless you
want to customise some the default configurationIt could look like that:[logging]
; Activate logging in a ``~/.tflowclient.log`` file for messages with a
; severity greater or equal to ``CRITICAL``.
level = CRITICAL

[urwid]
; The backend for ``urwid``. The other possible value is ``curses``.
backend = raw

[palette]
; The platette that will be used by urwid.
; For example, you might want to print aborted tasks with black
; characters on a ``dark magenta`` background
ABORTED = black,dark magentaThe defaulttflowclientpalette can be dumped using thebin/tflowclient_palette.pyexecutable. More details, on the various
color schemes can be obtained in theurwiddocumentation.By default, only 16 colors are available to build the "palette". Some of may
want to expand their horizons... Theoretically, it is possible to support 256
colors (see the configuration) but beware that it is not supported by all
terminals (that's why it's not activated by default).Use of a 256-colors palette:[urwid]
backend = raw
terminal_colors = 256

[palette]
ABORTED = black, dark magenta, , g74, #f86The first to entries of the palette still represent foreground and background
colors for the 16-colors palette but the 4th and 5th elements represents
foreground and background colors for the 256-colors palette
(seehttps://urwid.readthedocs.io/en/latest/examples/index.html#palette-test-py).Extra configuration for SMS/CDPWhen running thetflowclient_cdp.pyutility, the server name, user name and
SMS suite to follow have to be specified:tflowclient_cdp.py -s sms_server -u sms_user -r sms_suiteFor a day to day use, default values can be specified in the~/.tflowclientrc.inifile:[cdp]
path=path_to_the_cdp_binary
host=sms_server
user=sms_user
suite=sms_suitepathmay be omitted if it is properly configured system-wide.In addition, the user must provide his credentials in a~/.smsrcfile.
The~/.smsrcfile may contain several lines for each of the
server_name/user_name pair the user wants to connect to. The.smsrcfile looks like:sms_server sms_user sms_user_s_passwordThe~/.smsrcfile needs to be accessibleonlyby the user ("600"
permissions in octal notation).