# HG changeset patch # User Nicolas Saunier # Date 1371440676 14400 # Node ID dc2e68e936c71cebf12eb9f2d8253635421390b2 # Parent 124f85c6cfae80937246f83efdf8fe757168cf63 work in progress diff -r 124f85c6cfae -r dc2e68e936c7 scripts/display-trajectories.py --- a/scripts/display-trajectories.py Fri Jun 14 13:47:00 2013 -0400 +++ b/scripts/display-trajectories.py Sun Jun 16 23:44:36 2013 -0400 @@ -10,6 +10,9 @@ options, args = getopt.getopt(sys.argv[1:], 'hi:d:t:o:f:',['help']) # alternative long names are a pain to support ,'video-filename=','database-filename=', 'type=' +# replace with argparse +# type parser.add_argument('-t', choices=['feature', 'object']) + options = dict(options) print options, args diff -r 124f85c6cfae -r dc2e68e936c7 scripts/safety-analysis.py --- a/scripts/safety-analysis.py Fri Jun 14 13:47:00 2013 -0400 +++ b/scripts/safety-analysis.py Sun Jun 16 23:44:36 2013 -0400 @@ -1,27 +1,18 @@ #! /usr/bin/env python -import sys,getopt +import sys, argparse import matplotlib.pyplot as plt import numpy as np from ConfigParser import ConfigParser -options, args = getopt.getopt(sys.argv[1:], 'hi:d:t:o:f:',['help']) - -options = dict(options) - -print options, args - -if '--help' in options.keys() or '-h' in options.keys() or len(sys.argv) == 1: - print('Usage: '+sys.argv[0]+' --help|-h config_file.cfg\n' - 'The program processes indicators for all pairs of road users in the scene\n\n' - 'Order matters between positional and named arguments') - sys.exit() - +parser = argparse.ArgumentParser(description='The program processes indicators for all pairs of road users in the scene') +args = parser.parse_args() +print(args) # TODO work on the way to indicate an interaction definition -if len(args)>0: # consider there is a configuration file +if False:#len(args)>0: # consider there is a configuration file params = utils.TrackingParameters() params.loadConfigFile(args[0])