Changeset 321


Ignore:
Timestamp:
29/04/15 08:07:33 (5 years ago)
Author:
mjuckes
Message:

cleaned up c4.py no-args response and amap2nco doc string

Location:
CCCC/trunk/ceda_cc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CCCC/trunk/ceda_cc/amap2nco.py

    r180 r321  
     1"""USAGE: 
     2python amap2nco.py   mappingsFile  inputDirectoryBase outputDirectoryBase 
     3mappingsFile: text file containing mapping information, generated by c4.py 
     4inputDirectoryBase: initial part of the directory tree, to be replaced for corrected files 
     5outputDirectoryBase: initial part of directory tree to be used for corrected files. 
     6 
     7A bash script of nco commands will be written to ncoscript.sh. Excecute with, for example, "bash ncoscript.sh" 
     8 
     9Check ouput and run ceda-cc to verify that the correct changes have been implemented -- this software does not offer any guarantees. 
     10 
     11See file USAGE_amap2nco.txt in code repository for more detail""" 
    112 
    213import os, string, random, time 
     
    617 
    718class map2nco(object): 
    8  
    919 
    1020  def __init__(self,ifile,ipth,opth,newtid=True): 
     
    100110      oo.write( '%s\n'  % cmd ) 
    101111    oo.close() 
    102  
    103112     
    104113if __name__ == '__main__': 
     
    109118        print string.strip(l) 
    110119    else: 
    111       print """USAGE: 
    112 python amap2nco.py   mappingsFile  inputDirectoryBase outputDirectoryBase 
    113 mappingsFile: text file containing mapping information, generated by c4.py 
    114 inputDirectoryBase: initial part of the directory tree, to be replaced for corrected files 
    115 outputDirectoryBase: initial part of directory tree to be used for corrected files. 
    116  
    117 See file USAGE_amap2nco.txt in code repository for more detail""" 
    118  
     120      print __doc__ 
    119121  else: 
    120122     mfile, idir, odir = sys.argv[1:] 
  • CCCC/trunk/ceda_cc/c4.py

    r304 r321  
    1  
     1"""ceda_cc 
     2########## 
     3USAGE: see README.txt in distribution directory. 
     4""" 
    25import sys 
    36from ccinit import c4_init 
     
    69## callout to summary.py: if this option is selected, imports of libraries are not needed. 
    710if not testmain: 
    8   if __name__ == '__main__' and sys.argv[1] == '--sum': 
    9       import summary 
    10       summary.main() 
    11       raise SystemExit(0) 
    12   elif __name__ == '__main__' and sys.argv[1] == '-v': 
    13       from versionConfig import version, versionComment 
    14       print 'ceda-cc version %s [%s]' % (version,versionComment) 
    15       raise SystemExit(0) 
    16   elif __name__ == '__main__' and sys.argv[1] == '--unitTest': 
    17       print "Starting test suite 1" 
    18       import unitTestsS1 
    19       print "Starting test suite 2" 
    20       import unitTestsS2 
    21       print "Tests completed" 
    22       raise SystemExit(0) 
     11  if __name__ == '__main__': 
     12   if len(sys.argv) > 1: 
     13     if sys.argv[1] == '--sum': 
     14        import summary 
     15        summary.main() 
     16        raise SystemExit(0) 
     17     elif sys.argv[1] == '-v': 
     18        from versionConfig import version, versionComment 
     19        print 'ceda-cc version %s [%s]' % (version,versionComment) 
     20        raise SystemExit(0) 
     21     elif sys.argv[1] == '--unitTest': 
     22        print "Starting test suite 1" 
     23        import unitTestsS1 
     24        print "Starting test suite 2" 
     25        import unitTestsS2 
     26        print "Tests completed" 
     27        raise SystemExit(0) 
     28   else: 
     29     print __doc__ 
     30     raise SystemExit(0) 
    2331 
    2432# Standard library imports 
Note: See TracChangeset for help on using the changeset viewer.