Guest User

Untitled

a guest
Apr 15th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1.  
  2. def get_brlcad_param(brlcad_config, param_name):
  3. """
  4. Executes brlcad-config with the given param name and returns the result as a string.
  5. It will also do necessary parsing/checking of the result.
  6. """
  7. result = subprocess.check_output([brlcad_config, "--" + param_name])
  8. result = result.split("\n")[0]
  9.  
  10. if param_name == "libs":
  11. # the libs are a special format, extract a list of library names:
  12. result = result.rsplit(None, 1).pop().split(";")
  13. #elif param_name in ["libdir", "includedir", "prefix"]:
  14. # # these are dirs: check if they exist, raise exception if not
  15. # if not os.access(result, os.R_OK):
  16. # print("RAISING ERROR")
  17. # raise SetupException("Directory for <{0}> not found: {1}".format(param_name, result))
  18. elif param_name == "version":
  19. result = StrictVersion(result)
  20.  
  21. print("JJ", result)
  22. return result
Advertisement
Add Comment
Please, Sign In to add comment