Bases: object
Check and emit standard project header for text files.
>>> import cStringIO
>>> hdr = TextFileHeader(cStringIO.StringIO(_test_header))
>>> hdr.directive, hdr.prefix
(None, '')
>>> for line in hdr: print line.rstrip()
###########################################################################
##
## File: lint.py
## Date: 14-Aug-2009
## Author: Hugh Secker-Walker
## Description: Check copyright and license and other boilerplate
##
## Copyright 2009, The Johns Hopkins University
## Copyright 2009 Hugh Secker-Walker
##
## Licensed under the Apache License, Version 2.0 (the "License").
## You may not use this file except in compliance with the License.
##
## You may obtain a copy of the License at
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
## implied. See the License for the specific language governing
## permissions and limitations under the License.
##
###########################################################################
Bases: object
Try to find header boilerplate info from the first few lines of a file.
Check and emit standard project header for text files.
>>> import cStringIO
>>> hdr = TextFileHeader2(cStringIO.StringIO(_test_header2))
>>> for line in hdr: print line.rstrip()
###########################################################################
##
## File: lint.py
## Date: 14-Aug-2009
## Author: Hugh Secker-Walker
## Description: Check copyright and license and other boilerplate
##
## This file is part of Onyx http://onyxtools.sourceforge.net
##
## Copyright 2009 The Johns Hopkins University
## Copyright 2009 Onyx Tools Foundation
##
## Licensed under the Apache License, Version 2.0 (the "License").
## You may not use this file except in compliance with the License.
## You may obtain a copy of the License at
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
## implied. See the License for the specific language governing
## permissions and limitations under the License.
##
###########################################################################