Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit b608b124 authored by augustin_s's avatar augustin_s :snake:
Browse files

renamed --silent switch --quiet

parent 4bfe9c9c
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ The `data` folder contains some channel lists and output files for testing. ...@@ -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. 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). 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).
......
...@@ -23,7 +23,7 @@ def run_check(clargs): ...@@ -23,7 +23,7 @@ def run_check(clargs):
chans = load_config(filename) chans = load_config(filename)
pvs = (epics.PV(ch) for ch in chans) # putting PV constructors into ThreadPoolExecutor has weird effects 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) data = parallel(get_data, pvs, chans)
df = pd.DataFrame(data).T df = pd.DataFrame(data).T
......
...@@ -16,7 +16,7 @@ def handle_clargs(): ...@@ -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 = 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("filename", help="name of input channel-list file")
parser_check.add_argument("-o", "--output", help="output CSV file", default=None) 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_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") parser_compare = subparsers.add_parser("compare", help="compare two check results")
......
#!/bin/bash #!/bin/bash
./sani.py check data/test_chans_good.txt -s ./sani.py check data/test_chans_good.txt -q
echo echo
./sani.py check data/test_chans_bad.txt ./sani.py check data/test_chans_bad.txt
echo echo
......
...@@ -8,9 +8,9 @@ from .consts import MSG_NOT_CONNECTED, MSG_SUCCESS ...@@ -8,9 +8,9 @@ from .consts import MSG_NOT_CONNECTED, MSG_SUCCESS
class DataGetter: class DataGetter:
def __init__(self, timeout, silent): def __init__(self, timeout, quiet):
self.timeout = timeout self.timeout = timeout
self.silent = silent self.quiet = quiet
def __call__(self, pv): def __call__(self, pv):
connected = pv.wait_for_connection(self.timeout) connected = pv.wait_for_connection(self.timeout)
...@@ -38,7 +38,7 @@ class DataGetter: ...@@ -38,7 +38,7 @@ class DataGetter:
"severity": severity "severity": severity
} }
if not self.silent: if not self.quiet:
msg = colored(col, msg) msg = colored(col, msg)
print(pv.pvname, msg) print(pv.pvname, msg)
return data return data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment