gstlal
1.13.0
Toggle main menu visibility
Loading...
Searching...
No Matches
bin
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
20
import
argparse
21
22
from
gstlal.dags
import
profiles
23
24
25
parser = argparse.ArgumentParser(prog=
"gstlal_grid_profile"
)
26
27
# set up subparser
28
subparser = parser.add_subparsers(title=
"commands"
, metavar=
"<command>"
, dest=
"cmd"
)
29
subparser.required =
True
30
31
# register commands
32
install_desc =
"install site submission profiles"
33
install_parser = subparser.add_parser(
"install"
, help=install_desc, description=install_desc)
34
install_parser.set_defaults(func=profiles.install_profiles)
35
install_parser.add_argument(
36
"profile"
, metavar=
"PROFILE"
, nargs=
"*"
,
37
help=
"Profiles to install. If none selected, install default profiles."
38
)
39
40
list_desc =
"list available site submission profiles"
41
list_parser = subparser.add_parser(
"list"
, help=list_desc, description=list_desc)
42
list_parser.set_defaults(func=profiles.list_profiles)
43
44
set_desc =
"set site submission profile"
45
set_parser = subparser.add_parser(
"set"
, help=set_desc, description=set_desc)
46
set_parser.set_defaults(func=profiles.set_profile)
47
set_parser.add_argument(
"profile"
, metavar=
"PROFILE"
, help=
"profile to select."
)
48
49
get_desc =
"display current site submission profile"
50
get_parser = subparser.add_parser(
"get"
, help=get_desc, description=get_desc)
51
get_parser.set_defaults(func=profiles.get_profile)
52
53
# parse and execute command
54
args = parser.parse_args()
55
args.func(args)
Generated by
1.17.0