scripts/update_configuration_doc.py
def GenerateDocumentation(output_file, root):
  """Recursively generates documentation, sorts and writes it."""
  message_list = ParseProtoFilesRecursively(root)
  resolver = Resolver(message.name for message in message_list)

  output_dict = {}
  for message in message_list:
    content = [message.name, '=' * len(message.name), '']
    assert message.name not in output_dict
    output_dict[message.name] = content
    if message.preceding_comments:
      content.extend(message.preceding_comments)
      content.append('')
    for option_type, option_name, option_comments in message.options:
      # TODO(whess): For now we exclude InitialTrajectoryPose from the
      # documentation. It is documented itself (since it has no Options suffix)
      # and is not parsed from the Lua files.
      if option_type in ('InitialTrajectoryPose',):
        continue
      content.append(
          resolver.Resolve(option_type, message.package) + ' ' + option_name)
      if not option_comments:
        option_comments.append(NODOC)
      for comment in option_comments:
        content.append('  ' + comment)
      content.append('')
    if message.trailing_comments:
      content.extend(message.trailing_comments)
      content.append('')

  output = ['\n'.join(doc) for key, doc in sorted(list(output_dict.items()))]
  print('\n\n'.join(output), file=output_file)
Recursively generates documentation, sorts and writes it.
Recursively generates documentation, sorts and writes it.
Recursively generates documentation sorts and writes it .
def GenerateDocumentation(output_file, root):
  message_list = ParseProtoFilesRecursively(root)
  resolver = Resolver(message.name for message in message_list)
  output_dict = {}
  for message in message_list:
    content = [message.name, '=' * len(message.name), '']
    assert message.name not in output_dict
    output_dict[message.name] = content
    if message.preceding_comments:
      content.extend(message.preceding_comments)
      content.append('')
    for option_type, option_name, option_comments in message.options:
      if option_type in ('InitialTrajectoryPose',):
        continue
      content.append(
          resolver.Resolve(option_type, message.package) + ' ' + option_name)
      if not option_comments:
        option_comments.append(NODOC)
      for comment in option_comments:
        content.append('  ' + comment)
      content.append('')
    if message.trailing_comments:
      content.extend(message.trailing_comments)
      content.append('')
  output = ['\n'.join(doc) for key, doc in sorted(list(output_dict.items()))]
  print('\n\n'.join(output), file=output_file)
def GenerateDocumentation ( output_file , root ) : message_list = ParseProtoFilesRecursively ( root ) resolver = Resolver ( message . name for message in message_list ) output_dict = { } for message in message_list : content = [ message . name , '=' * len ( message . name ) , '' ] assert message . name not in output_dict output_dict [ message . name ] = content if message . preceding_comments : content . extend ( message . preceding_comments ) content . append ( '' ) for option_type , option_name , option_comments in message . options : if option_type in ( 'InitialTrajectoryPose' , ) : continue content . append ( resolver . Resolve ( option_type , message . package ) + ' ' + option_name ) if not option_comments : option_comments . append ( NODOC ) for comment in option_comments : content . append ( '  ' + comment ) content . append ( '' ) if message . trailing_comments : content . extend ( message . trailing_comments ) content . append ( '' ) output = [ '\n' . join ( doc ) for key , doc in sorted ( list ( output_dict . items ( ) ) ) ] print ( '\n\n' . join ( output ) , file = output_file )
Recursively generates documentation, sorts and writes it.
Recursively generates documentation sorts and writes it .
"""Recursively generates documentation, sorts and writes it.""" # TODO(whess): For now we exclude InitialTrajectoryPose from the # documentation. It is documented itself (since it has no Options suffix) # and is not parsed from the Lua files.
output_file
root