21"""Output the public directory for the given SFT name(s), following the
22convention detailed in the SFT spec (T040164)."""
30from lalpulsar
import git_version
32__author__ =
"Karl Wette <karl.wette@ligo.org>"
33__version__ = git_version.id
34__date__ = git_version.date
39 parser = argparse.ArgumentParser(description=__doc__)
46 help=
"format output using this Python {}-style formatter, where: {dir}=public SFT directory, {name}=SFT name, {orig}=original SFT path",
52 help=
"SFT paths; if not given, read from standard input",
54 args = parser.parse_args()
59if __name__ ==
"__main__":
63 SFT_path_source = args.SFT_paths
64 if not SFT_path_source:
65 SFT_path_source = sys.stdin
67 for SFT_path_str
in SFT_path_source:
70 fmt_vals = {
"orig": SFT_path_str.rstrip()}
73 _, fmt_vals[
"name"] = os.path.split(fmt_vals[
"orig"])
79 print(args.fmt.format(**fmt_vals))
def public_sft_directory(filename)