def METHOD_NAME(base_dir, out=sys.stdout, only_if_needed=False):
  if only_if_needed and check_pango(base_dir):
    return
  if not sys.platform.startswith('linux'):
    print("This script is only applicable to Linux - exiting.", file=out)
    return
  print("Regenerating module files in %s" % base_dir, file=out)
  if not os.path.exists(base_dir):
    if only_if_needed:
      print("Base directory '%s' does not exist." % base_dir, file=out)
      print("  Assuming base-less installation, skipping module file regeneration", file=out)
      return
    raise OSError("Base directory '%s' does not exist." % base_dir)
  fix_pango(base_dir, out)
  fix_gtk(base_dir, out)
  fix_fonts(base_dir, out)
  fix_themes(base_dir, out)