#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Copyright 2012 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
check instead.
"""
+from __future__ import print_function
+
import os
import re
import sys
for x in all_ids:
match = id_regex.search(x)
if match is None:
- print 'ERROR: "%s" did not match our regex' % (x)
+ print('ERROR: "%s" did not match our regex' % x)
got_err = True
if not match.group(0) is x:
- print 'ERROR: "%s" did not fully match our regex' % (x)
+ print('ERROR: "%s" did not fully match our regex' % x)
got_err = True
if got_err:
return 1
ids_left.remove(match)
if DEBUG:
if not match in all_ids:
- print '%s had "%s", which was not in the found IDs' % \
- (full_path, match)
+ print('%s had "%s", which was not in the found IDs' % \
+ (full_path, match))
elif DEBUG > 1:
full_path = os.path.join(root, file)
- print 'Skipping %s.' % (full_path)
+ print('Skipping %s.' % full_path)
# Anything left?
if len(ids_left) > 0:
- print 'The following ids are in GRD files, but *appear* to be unused:'
+ print('The following ids are in GRD files, but *appear* to be unused:')
for file_path, file_ids in file_id_map.iteritems():
missing = ids_left.intersection(file_ids)
if len(missing) > 0:
- print ' %s:' % (file_path)
- print '\n'.join(' %s' % (x) for x in sorted(missing))
+ print(' %s:' % file_path)
+ print('\n'.join(' %s' % (x) for x in sorted(missing)))
return 0
# If no GRD files were given, default them:
if len(grd_files) == 0:
ash_base_dir = os.path.join(src_dir, 'ash')
- ash_components_dir = os.path.join(ash_base_dir, 'components')
+ ash_shortcut_viewer_dir = os.path.join(ash_base_dir, 'shortcut_viewer')
chrome_dir = os.path.join(src_dir, 'chrome')
chrome_app_dir = os.path.join(chrome_dir, 'app')
chrome_app_res_dir = os.path.join(chrome_app_dir, 'resources')
device_base_dir = os.path.join(src_dir, 'device')
+ services_dir = os.path.join(src_dir, 'services')
ui_dir = os.path.join(src_dir, 'ui')
ui_strings_dir = os.path.join(ui_dir, 'strings')
ui_chromeos_dir = os.path.join(ui_dir, 'chromeos')
grd_files = [
- os.path.join(ash_base_dir, 'ash_strings.grd'),
- os.path.join(ash_components_dir, 'ash_components_strings.grd'),
- os.path.join(ash_components_dir, 'resources',
- 'ash_components_resources.grd'),
- os.path.join(chrome_app_dir, 'chromium_strings.grd'),
- os.path.join(chrome_app_dir, 'generated_resources.grd'),
- os.path.join(chrome_app_dir, 'google_chrome_strings.grd'),
- os.path.join(chrome_app_res_dir, 'locale_settings.grd'),
- os.path.join(chrome_app_res_dir, 'locale_settings_chromiumos.grd'),
- os.path.join(chrome_app_res_dir, 'locale_settings_google_chromeos.grd'),
- os.path.join(chrome_app_res_dir, 'locale_settings_linux.grd'),
- os.path.join(chrome_app_res_dir, 'locale_settings_mac.grd'),
- os.path.join(chrome_app_res_dir, 'locale_settings_win.grd'),
- os.path.join(chrome_app_dir, 'theme', 'theme_resources.grd'),
- os.path.join(chrome_dir, 'browser', 'browser_resources.grd'),
- os.path.join(chrome_dir, 'common', 'common_resources.grd'),
- os.path.join(chrome_dir, 'renderer', 'resources',
- 'renderer_resources.grd'),
- os.path.join(device_base_dir, 'bluetooth', 'bluetooth_strings.grd'),
- os.path.join(device_base_dir, 'fido', 'fido_strings.grd'),
- os.path.join(src_dir, 'chromeos', 'chromeos_strings.grd'),
- os.path.join(src_dir, 'extensions', 'strings', 'extensions_strings.grd'),
- os.path.join(src_dir, 'ui', 'resources', 'ui_resources.grd'),
- os.path.join(src_dir, 'ui', 'webui', 'resources', 'webui_resources.grd'),
- os.path.join(ui_strings_dir, 'app_locale_settings.grd'),
- os.path.join(ui_strings_dir, 'ui_strings.grd'),
- os.path.join(ui_chromeos_dir, 'ui_chromeos_strings.grd'),
+ os.path.join(ash_base_dir, 'ash_strings.grd'),
+ os.path.join(ash_shortcut_viewer_dir, 'shortcut_viewer_strings.grd'),
+ os.path.join(chrome_app_dir, 'chromium_strings.grd'),
+ os.path.join(chrome_app_dir, 'generated_resources.grd'),
+ os.path.join(chrome_app_dir, 'google_chrome_strings.grd'),
+ os.path.join(chrome_app_res_dir, 'locale_settings.grd'),
+ os.path.join(chrome_app_res_dir, 'locale_settings_chromiumos.grd'),
+ os.path.join(chrome_app_res_dir, 'locale_settings_google_chromeos.grd'),
+ os.path.join(chrome_app_res_dir, 'locale_settings_linux.grd'),
+ os.path.join(chrome_app_res_dir, 'locale_settings_mac.grd'),
+ os.path.join(chrome_app_res_dir, 'locale_settings_win.grd'),
+ os.path.join(chrome_app_dir, 'theme', 'theme_resources.grd'),
+ os.path.join(chrome_dir, 'browser', 'browser_resources.grd'),
+ os.path.join(chrome_dir, 'common', 'common_resources.grd'),
+ os.path.join(chrome_dir, 'renderer', 'resources',
+ 'renderer_resources.grd'),
+ os.path.join(device_base_dir, 'bluetooth', 'bluetooth_strings.grd'),
+ os.path.join(device_base_dir, 'fido', 'fido_strings.grd'),
+ os.path.join(services_dir, 'services_strings.grd'),
+ os.path.join(src_dir, 'chromeos', 'chromeos_strings.grd'),
+ os.path.join(src_dir, 'extensions', 'strings',
+ 'extensions_strings.grd'),
+ os.path.join(src_dir, 'ui', 'resources', 'ui_resources.grd'),
+ os.path.join(src_dir, 'ui', 'webui', 'resources',
+ 'webui_resources.grd'),
+ os.path.join(ui_strings_dir, 'app_locale_settings.grd'),
+ os.path.join(ui_strings_dir, 'ax_strings.grd'),
+ os.path.join(ui_strings_dir, 'ui_strings.grd'),
+ os.path.join(ui_chromeos_dir, 'ui_chromeos_strings.grd'),
]
# If no source directories were given, default them: