gstlal 1.13.0
Loading...
Searching...
No Matches
gstlal_grid_profile
1#!/usr/bin/env python3
2#
3# Copyright (C) 2020 Patrick Godwin
4#
5# This program is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License as published by the
7# Free Software Foundation; either version 2 of the License, or (at your
8# option) any later version.
9#
10# This program is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
13# Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
19
20import argparse
21
22from gstlal.dags import profiles
23
24
25parser = argparse.ArgumentParser(prog="gstlal_grid_profile")
26
27# set up subparser
28subparser = parser.add_subparsers(title="commands", metavar="<command>", dest="cmd")
29subparser.required = True
30
31# register commands
32install_desc = "install site submission profiles"
33install_parser = subparser.add_parser("install", help=install_desc, description=install_desc)
34install_parser.set_defaults(func=profiles.install_profiles)
35install_parser.add_argument(
36 "profile", metavar="PROFILE", nargs="*",
37 help="Profiles to install. If none selected, install default profiles."
38)
39
40list_desc = "list available site submission profiles"
41list_parser = subparser.add_parser("list", help=list_desc, description=list_desc)
42list_parser.set_defaults(func=profiles.list_profiles)
43
44set_desc = "set site submission profile"
45set_parser = subparser.add_parser("set", help=set_desc, description=set_desc)
46set_parser.set_defaults(func=profiles.set_profile)
47set_parser.add_argument("profile", metavar="PROFILE", help="profile to select.")
48
49get_desc = "display current site submission profile"
50get_parser = subparser.add_parser("get", help=get_desc, description=get_desc)
51get_parser.set_defaults(func=profiles.get_profile)
52
53# parse and execute command
54args = parser.parse_args()
55args.func(args)