Browse Source

only check .py files (for now), because others usually don't have a license.

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
fffc2bbe0a
  1. 5
      hg/licensecheck.py

5
hg/licensecheck.py

@ -18,10 +18,15 @@ import os
from mercurial import hg from mercurial import hg
types_to_check = [ ".py" ];
def checkfile( filename ): def checkfile( filename ):
if os.path.splitext( filename )[1] not in types_to_check:
return True;
try: try:
fileproc = os.popen( 'licensecheck %s' % filename ); fileproc = os.popen( 'licensecheck %s' % filename );
result = fileproc.read().strip(); result = fileproc.read().strip();
print( "Licensecheck: " + result );
return not result.endswith( "*No copyright* UNKNOWN" ); return not result.endswith( "*No copyright* UNKNOWN" );
finally: finally:
fileproc.close(); fileproc.close();

Loading…
Cancel
Save