chrome/test/chromedriver/log_replay/client_replay.py
def _GetCommandLineOptions():
  """Get, parse, and error check command line options for this file."""
  usage = "usage: %prog <chromedriver binary> <input log path> [options]"
  parser = optparse.OptionParser(usage=usage)
  parser.add_option(
      "", "--output-log-path",
      help="Output verbose server logs to this file")
  parser.add_option(
      "", "--chrome", help="Path to a build of the chrome binary. If not\n"
      "specified, uses ChromeDriver's own algorithm to find Chrome.")
  parser.add_option(
      "", "--base-url", help="Base url to replace logged urls (in "
      "navigate, getUrl, and similar commands/responses).")
  parser.add_option(
      "", "--devtools-replay", help="Replay DevTools actions in addition\n"
      "to client-side actions")
  parser.add_option(
      "", "--replayable", help="Generate logs that do not have truncated\n"
      "strings so that they can be replayed again.")
  parser.add_option(
      '', '--additional-args', action='append',
      help='Additional arguments to add on ChromeDriver command line')

  options, args = parser.parse_args()
  if len(args) < 2:
    _CommandLineError(parser,
                      'ChromeDriver binary and/or input log path missing.')
  if len(args) > 2:
    _CommandLineError(parser, 'Too many command line arguments.')
  if not os.path.exists(args[0]):
    _CommandLineError(parser, 'Path given for chromedriver is invalid.')
  if options.chrome and not os.path.exists(options.chrome):
    _CommandLineError(parser, 'Path given by --chrome is invalid.')
  if options.replayable and not options.output_log_path:
    _CommandLineError(
        parser, 'Replayable log option needs --output-log-path specified.')

  return options, args
Get, parse, and error check command line options for this file.
Get, parse, and error check command line options for this file.
Get parse and error check command line options for this file .
def _GetCommandLineOptions():
  usage = "usage: %prog <chromedriver binary> <input log path> [options]"
  parser = optparse.OptionParser(usage=usage)
  parser.add_option(
      "", "--output-log-path",
      help="Output verbose server logs to this file")
  parser.add_option(
      "", "--chrome", help="Path to a build of the chrome binary. If not\n"
      "specified, uses ChromeDriver's own algorithm to find Chrome.")
  parser.add_option(
      "", "--base-url", help="Base url to replace logged urls (in "
      "navigate, getUrl, and similar commands/responses).")
  parser.add_option(
      "", "--devtools-replay", help="Replay DevTools actions in addition\n"
      "to client-side actions")
  parser.add_option(
      "", "--replayable", help="Generate logs that do not have truncated\n"
      "strings so that they can be replayed again.")
  parser.add_option(
      '', '--additional-args', action='append',
      help='Additional arguments to add on ChromeDriver command line')
  options, args = parser.parse_args()
  if len(args) < 2:
    _CommandLineError(parser,
                      'ChromeDriver binary and/or input log path missing.')
  if len(args) > 2:
    _CommandLineError(parser, 'Too many command line arguments.')
  if not os.path.exists(args[0]):
    _CommandLineError(parser, 'Path given for chromedriver is invalid.')
  if options.chrome and not os.path.exists(options.chrome):
    _CommandLineError(parser, 'Path given by --chrome is invalid.')
  if options.replayable and not options.output_log_path:
    _CommandLineError(
        parser, 'Replayable log option needs --output-log-path specified.')
  return options, args
def _GetCommandLineOptions ( ) : usage = "usage: %prog <chromedriver binary> <input log path> [options]" parser = optparse . OptionParser ( usage = usage ) parser . add_option ( "" , "--output-log-path" , help = "Output verbose server logs to this file" ) parser . add_option ( "" , "--chrome" , help = "Path to a build of the chrome binary. If not\n" "specified, uses ChromeDriver's own algorithm to find Chrome." ) parser . add_option ( "" , "--base-url" , help = "Base url to replace logged urls (in " "navigate, getUrl, and similar commands/responses)." ) parser . add_option ( "" , "--devtools-replay" , help = "Replay DevTools actions in addition\n" "to client-side actions" ) parser . add_option ( "" , "--replayable" , help = "Generate logs that do not have truncated\n" "strings so that they can be replayed again." ) parser . add_option ( '' , '--additional-args' , action = 'append' , help = 'Additional arguments to add on ChromeDriver command line' ) options , args = parser . parse_args ( ) if len ( args ) < 2 : _CommandLineError ( parser , 'ChromeDriver binary and/or input log path missing.' ) if len ( args ) > 2 : _CommandLineError ( parser , 'Too many command line arguments.' ) if not os . path . exists ( args [ 0 ] ) : _CommandLineError ( parser , 'Path given for chromedriver is invalid.' ) if options . chrome and not os . path . exists ( options . chrome ) : _CommandLineError ( parser , 'Path given by --chrome is invalid.' ) if options . replayable and not options . output_log_path : _CommandLineError ( parser , 'Replayable log option needs --output-log-path specified.' ) return options , args
Get, parse, and error check command line options for this file.
Get parse and error check command line options for this file .
"""Get, parse, and error check command line options for this file."""