pycasso_setup_tm5 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #! /usr/bin/env python
  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. # (specify as a tupple, path seperation character is inserted below)
  21. pycasso_path = ('.','base','py')
  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 os
  30. import sys
  31. import logging
  32. import traceback
  33. # add location of PYCASSO modules to search path:
  34. sys.path.insert( 0, os.path.join(*pycasso_path) )
  35. # import PYCASSO tools:
  36. import pycasso
  37. # extract arguments from sys.argv array:
  38. # 0 = name of calling script, 1: = actual arguments
  39. args = sys.argv[1:]
  40. # call main routine, parse arguments and name of module with user scripts:
  41. try :
  42. pycasso.Main( args, pycasso_user_scripts )
  43. except :
  44. for line in traceback.format_exc().split('\n') : logging.error(line)
  45. logging.error( 'exception from pycasso.Main' )
  46. sys.exit(1)
  47. sys.exit(0)