diff options
author | noelallen@google.com <noelallen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-19 01:21:53 +0000 |
---|---|---|
committer | noelallen@google.com <noelallen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-19 01:21:53 +0000 |
commit | ec5af274afdd374bf2d83f097a18df5f88d1b487 (patch) | |
tree | 656910dc88dbc3771997bd0e97149f754226f502 /ppapi/generators/idl_outfile.py | |
parent | 09b36763ce6743310f55c73d18f45ebc513d75b7 (diff) | |
download | chromium_src-ec5af274afdd374bf2d83f097a18df5f88d1b487.zip chromium_src-ec5af274afdd374bf2d83f097a18df5f88d1b487.tar.gz chromium_src-ec5af274afdd374bf2d83f097a18df5f88d1b487.tar.bz2 |
Update the generator
Fix output file to ignore modified datestamp and copyright year.
Minor pychecker fixes (shadowed built-ins)
Add 'Type' so we can define builtin types in pp_stdint.h
Remove 'skip' of pp_stdint.idl so we now process it.
Setup intelligent defaults for generator.
BUG= http://code.google.com/p/chromium/issues/detail?id=84272
TEST= python idl_c_header.py & gcl try
Generate the new headers, add them to a CL, and try
TBR= sehr@google.com
Review URL: http://codereview.chromium.org/7396035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92941 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/generators/idl_outfile.py')
-rw-r--r-- | ppapi/generators/idl_outfile.py | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/ppapi/generators/idl_outfile.py b/ppapi/generators/idl_outfile.py index fd00c18..100a49e 100644 --- a/ppapi/generators/idl_outfile.py +++ b/ppapi/generators/idl_outfile.py @@ -14,6 +14,36 @@ from idl_log import ErrOut, InfoOut, WarnOut from idl_option import GetOption, Option, ParseOptions from stat import * +def IsEquivelent(intext, outtext): + if not intext: return False + inlines = intext.split('\n') + outlines = outtext.split('\n') + + # If number of lines don't match, it's a mismatch + if len(inlines) != len(outlines): return False + + for index in range(len(inlines)): + inline = inlines[index] + outline = outlines[index] + + if inline == outline: continue + + # If the line is not an exact match, check for comment deltas + inwords = inline.split() + outwords = outline.split() + + if inwords[0] != outwords[0] or inwords[0] != '/*': return False + + # Neither the year, nor the modified date need an exact match + if inwords[1] == 'Copyright': + if inwords[4:] == outwords[4:]: continue + elif inwords[1] == 'From': + if inwords[0:4] == outwords[0:4]: + continue + return False + return True + + # # IDLOutFile # @@ -51,7 +81,7 @@ class IDLOutFile(object): else: intext = None - if intext == outtext: + if IsEquivelent(intext, outtext): if GetOption('verbose'): InfoOut.Log('Output %s unchanged.' % self.filename) return False |