Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: ppapi/generators/idl_c_header.py

Issue 8983022: Tweak the PPAPI IDL generator to wrap the generated-from comment if necessary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebbbase Created 8 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/c/trusted/ppb_file_chooser_trusted.h ('k') | ppapi/generators/idl_outfile.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/generators/idl_c_header.py
diff --git a/ppapi/generators/idl_c_header.py b/ppapi/generators/idl_c_header.py
index 7813b0b7895f7ec44d224390c59478fe541d4f56..536d73e0a9dd013d69ec4fec4448472ec7eb3c59 100644
--- a/ppapi/generators/idl_c_header.py
+++ b/ppapi/generators/idl_c_header.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
#
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -130,9 +130,17 @@ class HGen(GeneratorByFile):
assert(fileinfo.IsA('Comment'))
out.Write('%s\n' % cgen.Copyright(cright_node))
- out.Write('/* From %s modified %s. */\n\n'% (
- filenode.GetProperty('NAME').replace(os.sep,'/'),
- filenode.GetProperty('DATETIME')))
+
+ # Wrap the From ... modified ... comment if it would be >80 characters.
+ from_text = 'From %s' % (
+ filenode.GetProperty('NAME').replace(os.sep,'/'))
+ modified_text = 'modified %s.' % (
+ filenode.GetProperty('DATETIME'))
+ if len(from_text) + len(modified_text) < 74:
+ out.Write('/* %s %s */\n\n' % (from_text, modified_text))
+ else:
+ out.Write('/* %s,\n * %s\n */\n\n' % (from_text, modified_text))
+
out.Write('#ifndef %s\n#define %s\n\n' % (def_guard, def_guard))
# Generate set of includes
« no previous file with comments | « ppapi/c/trusted/ppb_file_chooser_trusted.h ('k') | ppapi/generators/idl_outfile.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698