#!/usr/bin/env python
# Simple script to check for copyright statement
# Use something like this:
#
#    find . \( -name '*.h' -o -name '*.py' -o -name '*.c' \) -exec ~/mpich2/maint/cpywrtcheck \{\} \;

from sys import *
from re  import *
phrases = [ 'copyright' ]     # could add to this list
f = open(argv[1])
lines = f.readlines()
matched = [ l for l in lines for p in phrases if search(p,l,IGNORECASE) ]
# print matched
if len(matched) < 1:
    print 'no copyright in file', argv[1]
