diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-14 19:29:40 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-14 19:29:40 +0000 |
commit | f06c262be1375eb6fc880dc044186653f873f665 (patch) | |
tree | 52396a83fcbe76423e348fd785868ebd4f60e57e /tools/grit | |
parent | 5fb5f92fc0bf838df3c2c95a89b479e31bb2777b (diff) | |
download | chromium_src-f06c262be1375eb6fc880dc044186653f873f665.zip chromium_src-f06c262be1375eb6fc880dc044186653f873f665.tar.gz chromium_src-f06c262be1375eb6fc880dc044186653f873f665.tar.bz2 |
grit: cut down on chattiness.
- We don't need to print the copyright every time we run.
- Don't print empty lines when there are no warnings.
Review URL: http://codereview.chromium.org/67085
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13691 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/grit')
-rw-r--r-- | tools/grit/grit/grit_runner.py | 5 | ||||
-rw-r--r-- | tools/grit/grit/tool/build.py | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/tools/grit/grit/grit_runner.py b/tools/grit/grit/grit_runner.py index d1ff9be..c0edef9 100644 --- a/tools/grit/grit/grit_runner.py +++ b/tools/grit/grit/grit_runner.py @@ -31,7 +31,7 @@ import grit.tool.unit # Copyright notice -_COPYRIGHT = ''' +_COPYRIGHT = '''\ GRIT - the Google Resource and Internationalization Tool Copyright (c) Google Inc. %d ''' % util.GetCurrentYear() @@ -62,6 +62,8 @@ _TOOLS = [ def PrintUsage(): + print _COPYRIGHT + tool_list = '' for (tool, info) in _TOOLS: if not _HIDDEN in info.keys(): @@ -153,7 +155,6 @@ def _GetToolInfo(tool): def Main(args): '''Parses arguments and does the appropriate thing.''' util.ChangeStdoutEncoding() - print _COPYRIGHT if not len(args) or len(args) == 1 and args[0] == 'help': PrintUsage() diff --git a/tools/grit/grit/tool/build.py b/tools/grit/grit/tool/build.py index 5fe2348..7e274ee 100644 --- a/tools/grit/grit/tool/build.py +++ b/tools/grit/grit/tool/build.py @@ -208,14 +208,18 @@ are exported to translation interchange files (e.g. XMB files), etc. self.VerboseOut(' done.\n') # Print warnings if there are any duplicate shortcuts. - print '\n'.join(shortcuts.GenerateDuplicateShortcutsWarnings( - self.res.UberClique(), self.res.GetTcProject())) + warnings = shortcuts.GenerateDuplicateShortcutsWarnings( + self.res.UberClique(), self.res.GetTcProject()) + if warnings: + print '\n'.join(warnings) # Print out any fallback warnings, and missing translation errors, and # exit with an error code if there are missing translations in a non-pseudo # build - print (self.res.UberClique().MissingTranslationsReport(). + warnings = (self.res.UberClique().MissingTranslationsReport(). encode('ascii', 'replace')) + if warnings: + print warnings if self.res.UberClique().HasMissingTranslations(): sys.exit(-1) |