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

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: 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') | no next file » | 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..99c85585ba3e80e002042e5b4598fef9353a96b0 100644
--- a/ppapi/generators/idl_c_header.py
+++ b/ppapi/generators/idl_c_header.py
@@ -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) < 80:
+ out.Write('%s %s\n\n' % (from_text, modified_text))
+ else:
+ out.Write('%s,\n * %s\n\n' % (from_text, modified_text))
dmichael (off chromium) 2012/01/04 16:42:25 So this won't handle if the first part (the file n
+
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') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698