pycasso_setup_tm5 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #! /usr/bin/env python3
  2. # ------------------------------------------------
  3. # help
  4. # ------------------------------------------------
  5. """
  6. * PYCASSO - PYthon Compile And Setup Scripts Organizer *
  7. NAME
  8. pycasso_setup_tm5 - compile and setup 'TM5' application
  9. DESCRIPTION
  10. Driver script to compile and setup a model application.
  11. For information on arguments and options, try:
  12. pycasso_setup_tm5 [-h|--help]
  13. RETURN VALUE
  14. Non zero in case of any error.
  15. """
  16. # ------------------------------------------------
  17. # settings
  18. # ------------------------------------------------
  19. # path to the PYCASSO modules
  20. import os, sys
  21. pycasso_path = os.path.dirname(sys.argv[0])
  22. # name of file with PYCASSO user scripts for this setup:
  23. pycasso_user_scripts = 'pycasso_user_scripts_tm5'
  24. # ------------------------------------------------
  25. # begin
  26. # ------------------------------------------------
  27. if __name__ == '__main__':
  28. # import standard modules:
  29. import logging
  30. import traceback
  31. # add location of PYCASSO modules to search path:
  32. sys.path.insert(0, pycasso_path)
  33. # import PYCASSO tools:
  34. import pycasso
  35. # extract arguments from sys.argv array:
  36. # 0 = name of calling script, 1: = actual arguments
  37. args = sys.argv[1:]
  38. # call main routine, parse arguments and name of module with user scripts:
  39. try :
  40. pycasso.Main( args, pycasso_user_scripts )
  41. except :
  42. for line in traceback.format_exc().split('\n') : logging.error(line)
  43. logging.error( 'exception from pycasso.Main' )
  44. sys.exit(1)
  45. sys.exit(0)