From b608b1243242ac52254427969255a19c0a8cd81d Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Thu, 1 Oct 2020 12:06:52 +0200 Subject: [PATCH] renamed --silent switch --quiet --- README.md | 2 +- commands.py | 2 +- sani.py | 2 +- test.sh | 2 +- utils/epics.py | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 53104f9..18add41 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The `data` folder contains some channel lists and output files for testing. Reads a list of PV names from plain text file (comments starting with `#` are allowed, even recommended) and tests each channel for connection, alarm status and severity. -For each channel, the result will be printed as soon as it arrived. Thus, the output is ordered by response time. There is a command-line switch to suppress the output (`-s`/`--silent`) and to set the connection time out in seconds (`-t`/`--timeout`). +For each channel, the result will be printed as soon as it arrived. Thus, the output is ordered by response time. There is a command-line switch to suppress the output (`-q`/`--quiet`) and to set the connection time out in seconds (`-t`/`--timeout`). The test result can be written to a comma-separated values (csv) file by giving a filename to the `-o`/`--output` switch (`.csv` is automatically appended to the filename if missing). diff --git a/commands.py b/commands.py index 4e8f592..906eeb4 100644 --- a/commands.py +++ b/commands.py @@ -23,7 +23,7 @@ def run_check(clargs): chans = load_config(filename) pvs = (epics.PV(ch) for ch in chans) # putting PV constructors into ThreadPoolExecutor has weird effects - get_data = DataGetter(clargs.timeout, clargs.silent) + get_data = DataGetter(clargs.timeout, clargs.quiet) data = parallel(get_data, pvs, chans) df = pd.DataFrame(data).T diff --git a/sani.py b/sani.py index 59f9c1c..9b150d4 100755 --- a/sani.py +++ b/sani.py @@ -16,7 +16,7 @@ def handle_clargs(): parser_check = subparsers.add_parser("check", help="check a list of channels", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser_check.add_argument("filename", help="name of input channel-list file") parser_check.add_argument("-o", "--output", help="output CSV file", default=None) - parser_check.add_argument("-s", "--silent", help="do not show each channel's answer", action="store_true") + parser_check.add_argument("-q", "--quiet", help="do not show each channel's answer", action="store_true") parser_check.add_argument("-t", "--timeout", help="connection timeout in seconds", type=float, default=1) parser_compare = subparsers.add_parser("compare", help="compare two check results") diff --git a/test.sh b/test.sh index 6418082..22f665d 100755 --- a/test.sh +++ b/test.sh @@ -1,6 +1,6 @@ #!/bin/bash -./sani.py check data/test_chans_good.txt -s +./sani.py check data/test_chans_good.txt -q echo ./sani.py check data/test_chans_bad.txt echo diff --git a/utils/epics.py b/utils/epics.py index f051d9d..f89c220 100644 --- a/utils/epics.py +++ b/utils/epics.py @@ -8,9 +8,9 @@ from .consts import MSG_NOT_CONNECTED, MSG_SUCCESS class DataGetter: - def __init__(self, timeout, silent): + def __init__(self, timeout, quiet): self.timeout = timeout - self.silent = silent + self.quiet = quiet def __call__(self, pv): connected = pv.wait_for_connection(self.timeout) @@ -38,7 +38,7 @@ class DataGetter: "severity": severity } - if not self.silent: + if not self.quiet: msg = colored(col, msg) print(pv.pvname, msg) return data