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
  _BSD2 = ["All rights reserved.", "", "Redistribution and use i...
  _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]

_BSD2

Value:
["All rights reserved.", "", "Redistribution and use in source and bin\
ary forms, with or without", "modification, are permitted provided tha\
t the following conditions are", "met:", "", "1. Redistributions of so\
urce code must retain the above copyright notice,", "this list of cond\
itions and the following disclaimer.", "", "2. Redistributions in bina\
ry form must reproduce the above copyright", "notice, this list of con\
ditions and the following disclaimer in the", "documentation and/or ot\
her materials provided with the distribution.", "", "THIS SOFTWARE IS \
...

_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."