Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catkin config get? #618

Open
peci1 opened this issue Jul 8, 2020 · 0 comments
Open

catkin config get? #618

peci1 opened this issue Jul 8, 2020 · 0 comments

Comments

@peci1
Copy link

peci1 commented Jul 8, 2020

System Info

  • Operating System: Linux cras-11 5.3.0-61-generic #55~18.04.1-Ubuntu SMP Mon Jun 22 16:40:20 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Python Version: Python 2.7.17
  • Version of catkin_tools: `catkin_tools 0.4.4*
  • ROS Distro: melodic

Feature suggestion

Right now, I can set many properties of the catkin workspace using catkin config. But there's no way to query these values from CLI.

I've written a helper that allows me to access the attributes of the Context object via Python:

#!/usr/bin/env python

from __future__ import print_function
import sys
from catkin_tools.context import Context

if len(sys.argv) != 2:
    raise ValueError("%s requires exactly one argument" % sys.argv[0])

attribute = sys.argv[1]
context = Context.load('.')

try:
    print(getattr(context, attribute))
except AttributeError, e:
    print("Unknown property %s. Available properties are: %s" % (attribute, str(context.__dict__.keys())),
          file=sys.stderr)
    raise

Would a feature like that make sense as a part of the catkin tools CLI?

Use case

Our build script needs to check is a certain CMake flag is set, and it also needs to check whether the build space exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants