3
# (c) 2013 Werner Mayer LGPL
5
# Utility to search for source, header and Python files with a missing license text
9
ext = [".cpp", ".cxx", ".cc", ".c", ".hpp", ".hxx", ".hh", ".h", ".inl", ".inc", ".py"]
13
"coin_header_includes.h",
15
"IndirectPythonInterface.hxx",
16
("thumbs%sIExtractImage.h") % (os.path.sep),
17
# ('src%sTools')%(os.path.sep),
18
("src%sTools%sembedded") % (os.path.sep, os.path.sep),
19
("App%skdl_cp") % (os.path.sep),
20
("3rdParty%satlas") % (os.path.sep),
21
("Mod%sGDML") % (os.path.sep),
22
("boost%snumeric%sbindings") % (os.path.sep, os.path.sep),
23
("salomesmesh%sinc") % (os.path.sep),
24
("App%sCore%stritritest.h") % (os.path.sep, os.path.sep),
26
# A note to tritritest.h
27
# tritritest.h has no licensing information, but Tomas Moller replied
28
# the following, when asked about it:
30
# The code is free to use for anyone and any projects, but I give no
33
# See: http://anonscm.debian.org/gitweb/?p=debian-science/packages/freecad.git;a=blob;f=debian/copyright
38
"Permission to copy, use, modify",
39
"Permission to use, copy, modify",
40
"Distributed under the Boost Software License",
41
"Redistribution and use in source and binary forms",
42
"Redistribution and use in source and binary forms",
43
"it under the same terms as Python itself",
44
"As a special exception, you may create a larger work that contains",
45
"Permission is hereby granted, free of charge, to any person obtaining",
46
"Permission is granted to anyone to use this software",
47
"This file was automatically generated by SWIG",
52
fn = os.path.realpath(__file__)
53
# get path of parent directory
54
fn = os.path.dirname(fn)
55
fn = os.path.dirname(fn)
58
traverse(fn, ext, flt)
61
def traverse(path, ext, flt):
62
for r, d, f in os.walk(path):
64
fn = os.path.join(r, i)
65
# filter out some file names
73
bn = os.path.basename(fn).lower()
81
data = codecs.open(fn, "r", "utf-8")
83
lines = data.readlines()
92
print("Missing license text in file %s") % (fn)
97
if __name__ == "__main__":