Lines Matching full:options
32 from firmware_constants import MODE, OPTIONS
56 def __init__(self, options): argument
57 self.options = options
71 is_touchscreen=options[OPTIONS.TOUCHSCREEN],
94 mode = options[OPTIONS.MODE]
95 if options[OPTIONS.RESUME]:
98 self.log_dir = options[OPTIONS.RESUME]
99 elif options[OPTIONS.REPLAY]:
101 self.log_dir = options[OPTIONS.REPLAY]
110 if not (self.options[OPTIONS.REPLAY] or self.options[OPTIONS.RESUME]):
135 options)
179 replay_dir = self.options[OPTIONS.REPLAY]
193 return ('touchscreen' if self.options[OPTIONS.TOUCHSCREEN] else
210 if self.options[OPTIONS.REPLAY] and not self.options[OPTIONS.DEVICE]:
215 (self.options[OPTIONS.REPLAY], '*.%s' % device_ext),
295 flag_skip_html = self.options[OPTIONS.SKIP_HTML]
304 print ' $ DISPLAY=:0 OPTIONS="-u latest" python main.py\n'
308 print (' $ DISPLAY=:0 OPTIONS="-u 20130702_063631-fw_11.23-manual"'
311 if self.options[OPTIONS.MODE] == MODE.NOISE:
343 print 'Usage: $ DISPLAY=:0 [OPTIONS="options"] python %s\n' % sys.argv[0]
344 print 'options:'
345 print ' -d, --%s' % OPTIONS.DEVICE
347 print ' -h, --%s' % OPTIONS.HELP
349 print ' -i, --%s iterations' % OPTIONS.ITERATIONS
351 print ' -f, --%s' % OPTIONS.FNGENERATOR
354 print ' -m, --%s mode' % OPTIONS.MODE
356 print ' mode could be one of the following options'
364 print ' --%s log_dir' % OPTIONS.REPLAY
367 print ' --%s log_dir' % OPTIONS.RESUME
370 print ' -s, --%s' % OPTIONS.SIMPLIFIED
372 print ' --%s' % OPTIONS.SKIP_HTML
374 print ' -t, --%s' % OPTIONS.TOUCHSCREEN
376 print ' -u, --%s log_dir' % OPTIONS.UPLOAD
389 print ' $ DISPLAY=:0 OPTIONS="-m robot_sim -i 3" python main.py\n'
391 print ' $ DISPLAY=:0 OPTIONS="-m manual" python main.py\n'
393 print ' $ DISPLAY=:0 OPTIONS="-m complete" python main.py\n'
395 print ' $ DISPLAY=:0 OPTIONS="-m calibration" python main.py\n'
397 print ' $ DISPLAY=:0 OPTIONS="-m quickstep" python main.py\n'
399 print ' $ DISPLAY=:0 OPTIONS="-m noise" python main.py\n'
401 print ' $ DISPLAY=:0 OPTIONS="--replay latest" python main.py\n'
405 print ' $ DISPLAY=:0 OPTIONS="--replay %s" python main.py\n' % \
409 print (' $ DISPLAY=:0 OPTIONS="--replay %s -d" python main.py\n' %
412 print ' $ DISPLAY=:0 OPTIONS="--resume latest" python main.py\n'
415 print ' $ DISPLAY=:0 OPTIONS="--resume %s" python main.py\n' % \
419 print (' $ DISPLAY=:0 OPTIONS="-u 20130701_020120-fw_11.23-complete" '
423 print ' $ DISPLAY=:0 OPTIONS="-u latest" python main.py\n'
435 """Parse the options.
437 Note that the options are specified with environment variable OPTIONS,
438 because pyauto seems not compatible with command line options.
440 # Set the default values of options.
441 options = {OPTIONS.DEVICE: False,
442 OPTIONS.FNGENERATOR: False,
443 OPTIONS.ITERATIONS: 1,
444 OPTIONS.MODE: MODE.MANUAL,
445 OPTIONS.REPLAY: None,
446 OPTIONS.RESUME: None,
447 OPTIONS.SIMPLIFIED: False,
448 OPTIONS.SKIP_HTML: False,
449 OPTIONS.TOUCHSCREEN: False,
450 OPTIONS.UPLOAD: None,
453 # Get the command line options or get the options from environment OPTIONS
454 options_list = sys.argv[1:] or os.environ.get('OPTIONS', '').split()
456 return options
459 long_opt = [OPTIONS.DEVICE,
460 OPTIONS.FNGENERATOR,
461 OPTIONS.HELP,
462 OPTIONS.ITERATIONS + '=',
463 OPTIONS.MODE + '=',
464 OPTIONS.REPLAY + '=',
465 OPTIONS.RESUME + '=',
466 OPTIONS.SIMPLIFIED,
467 OPTIONS.SKIP_HTML,
468 OPTIONS.TOUCHSCREEN,
469 OPTIONS.UPLOAD + '=',
477 if opt in ('-d', '--%s' % OPTIONS.DEVICE):
478 options[OPTIONS.DEVICE] = True
479 if opt in ('-f', '--%s' % OPTIONS.FNGENERATOR):
480 options[OPTIONS.FNGENERATOR] = True
481 elif opt in ('-h', '--%s' % OPTIONS.HELP):
483 elif opt in ('-i', '--%s' % OPTIONS.ITERATIONS):
485 options[OPTIONS.ITERATIONS] = int(arg)
488 elif opt in ('-m', '--%s' % OPTIONS.MODE):
491 options[OPTIONS.MODE] = arg
494 elif opt in ('--%s' % OPTIONS.REPLAY, '--%s' % OPTIONS.RESUME):
499 options[opt.lstrip('-')] = log_dir
503 elif opt in ('-s', '--%s' % OPTIONS.SIMPLIFIED):
504 options[OPTIONS.SIMPLIFIED] = True
505 elif opt in ('--%s' % OPTIONS.SKIP_HTML,):
506 options[OPTIONS.SKIP_HTML] = True
507 elif opt in ('-t', '--%s' % OPTIONS.TOUCHSCREEN):
508 options[OPTIONS.TOUCHSCREEN] = True
509 elif opt in ('-u', '--%s' % OPTIONS.UPLOAD):
516 print 'Note: the %s mode is used.' % options[OPTIONS.MODE]
517 return options
521 options = _parse_options() variable
522 fw = firmware_TouchMTB(options)