source: CMIP6dreqbuild/trunk/src/framework/dreqPy/dreqCmdl.py @ 734

Subversion URL: http://proj.badc.rl.ac.uk/svn/exarch/CMIP6dreqbuild/trunk/src/framework/dreqPy/dreqCmdl.py@734
Revision 734, 956 bytes checked in by mjuckes, 4 years ago (diff)

trying to fix imports ....

Line 
1"""
2Entry point for command line usage -- see ccinit for usage information.
3"""
4
5## this enable python3 cleanly (replacing "import scope")
6## but does not work as __main__
7import sys
8from . import scope
9
10def main_entry():
11  """
12   Wrapper for use with setuptools.
13  """
14  if len(sys.argv) == 1:
15      # Show command-line info and report that you must provide arguments
16      print( scope.dreqUI.__doc__ )
17      print( "\nERROR: Please provide command-line arguments." )
18      return
19
20  if sys.argv[1] == '-v':
21      from .packageConfig import __version__, __versionComment__
22      print( 'dreqPy version %s [%s]' % (__version__,__versionComment__) )
23  elif sys.argv[1] == '--unitTest':
24      print( "Starting test suite 1" )
25      import simpleCheck
26      print( "Starting test suite 2" )
27      from .examples import ex203
28      print( "Tests completed" )
29  else:
30     x = scope.dreqUI(sys.argv[1:])
31     x.run()
32
33if __name__ == '__main__':
34  main_entry()
Note: See TracBrowser for help on using the repository browser.