Script check_header
[hide private]
[frames] | no frames]

Script check_header

Script to verify file header.

Classes [hide private]
  HeaderError
Functions [hide private]
 
_Fail(lineno, msg)
 
_CheckHeader(getline_fn)
 
Main()
Main program.
Variables [hide private]
  _READ_SIZE = 8* 1024
Assume header is always in the first 8kB of a file
  _GPLv2 = ["This program is free software; you can redistribute...
  _SHEBANG = re.compile(r"^#(?:|!(?:/usr/bin/python(?:| -u)|/bin...
  _COPYRIGHT_YEAR = r"20[01][0-9]"
  _COPYRIGHT = re.compile(r"# Copyright \(C\) (%s(?:, %s)*) Goog...
  _COPYRIGHT_DESC = "Copyright (C) <year>[, <year> ...] Google I...
  _AUTOGEN = "# This file is automatically generated, do not edit!"

Imports: sys, re, itertools, constants, utils, compat


Variables Details [hide private]

_GPLv2

Value:
["This program is free software; you can redistribute it and/or modify\
", "it under the terms of the GNU General Public License as published \
by", "the Free Software Foundation; either version 2 of the License, o\
r", "(at your option) any later version.", "", "This program is distri\
buted in the hope that it will be useful, but", "WITHOUT ANY WARRANTY;\
 without even the implied warranty of", "MERCHANTABILITY or FITNESS FO\
R A PARTICULAR PURPOSE.  See the GNU", "General Public License for mor\
e details.", "", "You should have received a copy of the GNU General P\
...

_SHEBANG

Value:
re.compile(r"^#(?:|!(?:/usr/bin/python(?:| -u)|/bin/(?:|ba)sh))$")

_COPYRIGHT

Value:
re.compile(r"# Copyright \(C\) (%s(?:, %s)*) Google Inc\.$" %(_COPYRIG\
HT_YEAR, _COPYRIGHT_YEAR))

_COPYRIGHT_DESC

Value:
"Copyright (C) <year>[, <year> ...] Google Inc."