source: CMIP6dreq/trunk/dreqPy/dreqCmdl.py @ 863

Subversion URL: http://proj.badc.rl.ac.uk/svn/exarch/CMIP6dreq/trunk/dreqPy/dreqCmdl.py@863
Revision 863, 1.2 KB checked in by mjuckes, 3 years ago (diff)

Updated setup for tag 01.beta.42

Line 
1"""
2Entry point for command line usage -- see ccinit for usage information.
3"""
4
5scr = __name__ == '__main__'
6import sys
7if scr:
8  import scope
9else:
10  from . import scope
11
12
13def main_entry():
14  """
15   Wrapper for use with setuptools.
16  """
17  if len(sys.argv) == 1:
18      # Show command-line info and report that you must provide arguments
19      print( scope.dreqUI.__doc__ )
20      print( "\nERROR: Please provide command-line arguments." )
21      return
22
23  if sys.argv[1] == '-v':
24      if scr:
25        from packageConfig import __version__, __versionComment__
26      else:
27        from .packageConfig import __version__, __versionComment__
28      print( 'dreqPy version %s [%s]' % (__version__,__versionComment__) )
29      print( 'Running in python %s' % str( sys.version_info ) )
30  elif sys.argv[1] == '--unitTest':
31      print( "Starting test suite 1" )
32      if scr:
33        import simpleCheck
34      else:
35        from . import simpleCheck
36      print( "Starting test suite 2" )
37      if scr:
38        import examples.ex203 as ex203
39      else:
40        from .examples import ex203
41      ex203.main( scope )
42      print( "Tests completed" )
43  else:
44     x = scope.dreqUI(sys.argv[1:])
45     x.run()
46
47if __name__ == '__main__':
48  main_entry()
Note: See TracBrowser for help on using the repository browser.