Commit 5b407bfc authored by Sean Leavey's avatar Sean Leavey

Tweak

parent c56399a8
PROG = "fibres" PROG = "fibrecnv"
DESC = "Fibre profile data extracter command line utility" DESC = "Fibre profile data converter utility"
VERS = "0.8.0" VERS = "0.8.0"
URL = "https://git.ligo.org/sean-leavey/fibre-profile-extractor" URL = "https://git.ligo.org/sean-leavey/fibre-profile-extractor"
......
...@@ -8,8 +8,8 @@ import argparse ...@@ -8,8 +8,8 @@ import argparse
import textwrap import textwrap
import collections import collections
from . import SYNOPSIS, PROG from profiler import PROG, SYNOPSIS, MANPAGE
from . import extract from profiler import extract
def enable_verbose_logs(level): def enable_verbose_logs(level):
handler = logging.StreamHandler() handler = logging.StreamHandler()
...@@ -78,11 +78,17 @@ class List(Cmd): ...@@ -78,11 +78,17 @@ class List(Cmd):
# find identifiers and corresponding files in data directory # find identifiers and corresponding files in data directory
fibre_files = extract.find_fibre_files(input_dir) fibre_files = extract.find_fibre_files(input_dir)
# print them # get valid identifiers
print("Found the following identifiers:") valid_ids = [k for k in fibre_files.keys() \
for k in fibre_files.keys(): if extract.validate_fibre_file_group(fibre_files[k])]
if extract.validate_fibre_file_group(fibre_files[k]):
print(k) if len(valid_ids):
# print them
print("Found the following identifiers:")
for ident in valid_ids:
print(ident)
else:
print("Found no valid indentifiers")
class Convert(Cmd): class Convert(Cmd):
"""Convert fibre profile files into single file""" """Convert fibre profile files into single file"""
...@@ -207,8 +213,6 @@ ALIAS = { ...@@ -207,8 +213,6 @@ ALIAS = {
"-h": "help", "-h": "help",
} }
##################################################
def format_commands(man=False): def format_commands(man=False):
prefix = " " * 8 prefix = " " * 8
wrapper = textwrap.TextWrapper( wrapper = textwrap.TextWrapper(
...@@ -253,7 +257,5 @@ def main(): ...@@ -253,7 +257,5 @@ def main():
func = get_func(cmd) func = get_func(cmd)
func(func.parse_args(args)) func(func.parse_args(args))
##################################################
if __name__ == "__main__": if __name__ == "__main__":
main() main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment