Debian Codegraph @

gavo/user/show.py

raw
1 """
2 CLI function to show various things.
3
4 Maybe gavo config and gavo info should be folded in here if this grows.
5 """
6
7 #c Copyright 2008-2025, the GAVO project <[email protected]>
8 #c
9 #c This program is free software, covered by the GNU GPL. See the
10 #c COPYING file in the source distribution.
11
12
13 from gavo import api
14 from gavo.utils import Arg, exposedFunction, makeCLIParser
15
16
17 @exposedFunction([
18 Arg("rdId", help="an RD id (or a path to RD xml)"),],
19 help="show what data items are available")
20 def dds(args):
21 rd = api.getReferencedElement(args.rdId, forceType=api.RD)
22 for dd in rd.dds:
23 outLine = dd.id
24 if dd.auto:
25 outLine += "*"
26 print(outLine)
27
28
29 def main():
30 args = makeCLIParser(globals()).parse_args()
31 args.subAction(args)