Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_brlcad_param(brlcad_config, param_name):
- """
- Executes brlcad-config with the given param name and returns the result as a string.
- It will also do necessary parsing/checking of the result.
- """
- result = subprocess.check_output([brlcad_config, "--" + param_name])
- result = result.split("\n")[0]
- if param_name == "libs":
- # the libs are a special format, extract a list of library names:
- result = result.rsplit(None, 1).pop().split(";")
- #elif param_name in ["libdir", "includedir", "prefix"]:
- # # these are dirs: check if they exist, raise exception if not
- # if not os.access(result, os.R_OK):
- # print("RAISING ERROR")
- # raise SetupException("Directory for <{0}> not found: {1}".format(param_name, result))
- elif param_name == "version":
- result = StrictVersion(result)
- print("JJ", result)
- return result
Advertisement
Add Comment
Please, Sign In to add comment