def main(): print('Cmd: %s' % ' '.join(sys.argv)) op = CmnCmdOpts.argParserIn( desc='Searches for structures that look like RP66v1 EFLRs', prog='%(prog) ', version=__version__, ) op.add_argument( "-s", "--show-tell", action="store_true", dest="show_tell", default=False, help="Show file locations and lengths. Default: %(default)s.") # op.add_argument("-n", "--number", dest="min_run_length", # type=int, default=DEFAULT_MIN_RUN_LENGTH, # help="Size of the minimum run length. Default: %(default)s.") op.add_argument('infile', type=argparse.FileType('rb'), help='The file to search') args = op.parse_args() clkStart = time.clock() timStart = time.time() # Initialise logging etc. #logging.basicConfig(level=args.loglevel, # format='%(asctime)s %(levelname)-8s %(message)s', #datefmt='%y-%m-%d % %H:%M:%S', # stream=sys.stdout) # Your code here myObj = ScanV1EFLR(args.infile) print(' CPU time = %8.3f (S)' % (time.clock() - clkStart)) print('Exec. time = %8.3f (S)' % (time.time() - timStart)) print('Bye, bye!') return 0
def test_20(self): """TestCmnCmdOpts.test_12(): basic use of CmnCmdOpts.argParserIn().""" myP = CmnCmdOpts.argParserIn("Description", "Program", "Version") myNs = myP.parse_args(['IN',]) self.assertEqual('IN', myNs.pathIn) self.assertFalse(myNs.recursive) self.assertTrue(myNs.glob is None)