import crhTimer progName = 'crhGPX-Test' inputF = 'crhGPX-Test.gpx' # process arguments parser = argparse.ArgumentParser(description="process map route gpx (GPS Exchange Format xml) data") parser.add_argument('-i', '--input', action="store", dest="infile", help='input filename with extension (eg: crhGPX-Test.gpx)') args = parser.parse_args() if args.infile: inputF = args.infile # process data print '' gpxData = crhGPX.gpx(inputF) ok = gpxData.validData() if ok: # print gpxData.genXML(bsv = False).getvalue() print gpxData.genXML(bsv = True, track = True).getvalue() print gpxData.genBSV().getvalue() print gpxData.genStats().getvalue() else: statusErrMsg('error', 'main', 'unable to process gpx file: {}'.format(inputF)) ## tidy up errTMsg('{} ending normally ({:06.2f}sec)'.format(getProgName(), crhTimer.timer.stop()))