pycasso_setup_template 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #! /usr/bin/env python3
  2. # ------------------------------------------------
  3. # help
  4. # ------------------------------------------------
  5. """
  6. * PYCASSO - PYthon Compile And Setup Scripts Organizer *
  7. NAME
  8. pycasso_setup_template - compile and setup 'template' application
  9. DESCRIPTION
  10. Driver script to compile and setup a model application.
  11. This script is the original PYCASSO setup script template.
  12. It should be copied to a new name, e.g. 'setup_<yourmodel>'
  13. and editted to match the model's needs.
  14. For information on arguments and options, try:
  15. pycasso_setup_template [-h|--help]
  16. RETURN VALUE
  17. Non zero in case of any error.
  18. """
  19. # ------------------------------------------------
  20. # settings
  21. # ------------------------------------------------
  22. # path to the PYCASSO modules
  23. # (specify as a tupple, path seperation character is inserted below)
  24. pycasso_path = ('.','base','py')
  25. # name of file with PYCASSO user scripts for this setup:
  26. pycasso_user_scripts = 'pycasso_user_scripts_template'
  27. # ------------------------------------------------
  28. # begin
  29. # ------------------------------------------------
  30. if __name__ == '__main__':
  31. # import standard modules:
  32. import os
  33. import sys
  34. import logging
  35. # prepend location of PYCASSO modules to search path:
  36. sys.path.insert( 0, os.path.join(*pycasso_path) )
  37. # import PYCASSO tools:
  38. import pycasso
  39. # extract arguments from sys.argv array:
  40. # 0 = name of calling script, 1: = actual arguments
  41. args = sys.argv[1:]
  42. # call main routine, parse arguments and name of module with user scripts:
  43. try :
  44. pycasso.Main( args, pycasso_user_scripts )
  45. except :
  46. logging.error( sys.exc_info()[1] )
  47. logging.error( 'exception from pycasso.Main' )
  48. sys.exit(1)
  49. #endtry
  50. # ok:
  51. sys.exit(0)
  52. #endif
  53. # ------------------------------------------------
  54. # end
  55. # ------------------------------------------------