mojo/public/tools/bindings/mojom_types_downgrader.py
def DowngradeDirectory(path, output_dir=None):
  """Downgrades mojom files inside directory |path| to the old mojo types.

  Optionally pass |output_dir| to place the result under a separate output
  directory, preserving the relative path to the file included in |path|.
  """
  # We don't have recursive glob.glob() nor pathlib.Path.rglob() in Python 2.7
  mojom_filepaths = []
  for dir_path, _, filenames in os.walk(path):
    for filename in fnmatch.filter(filenames, "*mojom"):
      mojom_filepaths.append(os.path.join(dir_path, filename))

  for path in mojom_filepaths:
    absolute_dirpath = os.path.dirname(os.path.abspath(path))
    if output_dir:
      dest_dirpath = output_dir + absolute_dirpath
    else:
      dest_dirpath = absolute_dirpath
    DowngradeFile(path, dest_dirpath)
Downgrades mojom files inside directory |path| to the old mojo types.

  Optionally pass |output_dir| to place the result under a separate output
  directory, preserving the relative path to the file included in |path|.
  
Downgrades mojom files inside directory |path| to the old mojo types.
Optionally pass |output_dir| to place the result under a separate output
directory, preserving the relative path to the file included in |path|.
Downgrades mojom files inside directory |path| to the old mojo types . Optionally pass |output_dir| to place the result under a separate output directory preserving the relative path to the file included in |path| .
def DowngradeDirectory(path, output_dir=None):
  mojom_filepaths = []
  for dir_path, _, filenames in os.walk(path):
    for filename in fnmatch.filter(filenames, "*mojom"):
      mojom_filepaths.append(os.path.join(dir_path, filename))
  for path in mojom_filepaths:
    absolute_dirpath = os.path.dirname(os.path.abspath(path))
    if output_dir:
      dest_dirpath = output_dir + absolute_dirpath
    else:
      dest_dirpath = absolute_dirpath
    DowngradeFile(path, dest_dirpath)
def DowngradeDirectory ( path , output_dir = None ) : mojom_filepaths = [ ] for dir_path , _ , filenames in os . walk ( path ) : for filename in fnmatch . filter ( filenames , "*mojom" ) : mojom_filepaths . append ( os . path . join ( dir_path , filename ) ) for path in mojom_filepaths : absolute_dirpath = os . path . dirname ( os . path . abspath ( path ) ) if output_dir : dest_dirpath = output_dir + absolute_dirpath else : dest_dirpath = absolute_dirpath DowngradeFile ( path , dest_dirpath )
Downgrades mojom files inside directory |path| to the old mojo types.
Downgrades mojom files inside directory |path| to the old mojo types .
"""Downgrades mojom files inside directory |path| to the old mojo types.

  Optionally pass |output_dir| to place the result under a separate output
  directory, preserving the relative path to the file included in |path|.
  """ # We don't have recursive glob.glob() nor pathlib.Path.rglob() in Python 2.7
path
output_dir