From 664c0a3ad0387f19028c850962b034a4fec4616b Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Thu, 27 Jul 2017 22:13:54 +0100 Subject: No licenses but added script to add the license to every file --- include/YAGE/Math/matrix.hpp | 8 -------- scripts/add_version_headers | 40 ++++++++++++++++++++++++++++++++++++++++ test/matrixtest.cpp | 30 ------------------------------ test/testbench.cpp | 30 ------------------------------ test/testbench.hpp | 7 ------- 5 files changed, 40 insertions(+), 75 deletions(-) create mode 100755 scripts/add_version_headers diff --git a/include/YAGE/Math/matrix.hpp b/include/YAGE/Math/matrix.hpp index c7c40f00..9f1b4fcd 100644 --- a/include/YAGE/Math/matrix.hpp +++ b/include/YAGE/Math/matrix.hpp @@ -1,11 +1,3 @@ -/* - * created 22-06-17 by Yann Herklotz - * - * Matrix class that contains definitions for matrices, vectors and operations - * on vectors and matrices. - * - */ - #ifndef YAGE_MATH_MATRIX_HPP #define YAGE_MATH_MATRIX_HPP diff --git a/scripts/add_version_headers b/scripts/add_version_headers new file mode 100755 index 00000000..4c182763 --- /dev/null +++ b/scripts/add_version_headers @@ -0,0 +1,40 @@ +#!/usr/bin/env python +# ----------------------------------------------------------------------------- +# add_version_headers.py -- Add version header +# +# Copyright (c) 2017 Yann Herklotz Grave (ymherklotz@gmail.com) -- MIT License +# ----------------------------------------------------------------------------- + +import os +import re +import sys + + +header = """/* ---------------------------------------------------------------\ +------------- + * {0} + * + * Copyright (c) 2017 Yann Herklotz Grave -- MIT License + * See file LICENSE for more details + * ---------------------------------------------------------------------------- + */ +""" + + +def main(argv): + print("files getting a license: ") + for subdir, dirs, files in os.walk(os.getcwd()): + if not re.match(".*build.*", subdir): + for file_ in files: + if re.match(".*[.]cpp$|.*[.]hpp$", file_) and not re.match("^picopng[.]cpp$", file_): + print(os.path.join(subdir, file_)) + with open(os.path.join(subdir, file_), 'r') as src_file: + src = src_file.read() + with open(os.path.join(subdir, file_), 'w') as src_file_lic: + src_file_lic.write(header.format(file_)) + src_file_lic.write(src) + print("Done") + + +if __name__ == "__main__": + main(sys.argv) diff --git a/test/matrixtest.cpp b/test/matrixtest.cpp index 50a0b29c..b24e6a89 100644 --- a/test/matrixtest.cpp +++ b/test/matrixtest.cpp @@ -1,33 +1,3 @@ -/* ------------------------------------------------------------------------------ - * MIT License - * - * Copyright (c) 2017 Yann Herklotz Grave - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * ------------------------------------------------------------------------------ - * Description: - * - * Tests the math class using different tests to see if matrix operations work - * correctly. - * ------------------------------------------------------------------------------ - */ - #include "Math/math.hpp" #include "testbench.hpp" diff --git a/test/testbench.cpp b/test/testbench.cpp index c83d20b7..42bf357f 100644 --- a/test/testbench.cpp +++ b/test/testbench.cpp @@ -1,33 +1,3 @@ -/* ------------------------------------------------------------------------------ - * MIT License - * - * Copyright (c) 2017 Yann Herklotz Grave - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * ------------------------------------------------------------------------------ - * Description: - * - * Tests the math class using different tests to see if matrix operations work - * correctly. - * ------------------------------------------------------------------------------ - */ - #include "testbench.hpp" #include diff --git a/test/testbench.hpp b/test/testbench.hpp index ba3a3212..574561af 100644 --- a/test/testbench.hpp +++ b/test/testbench.hpp @@ -1,10 +1,3 @@ -/* - * created 22-06-17 by Yann Herklotz - * - * Test bench to test different functions in the yage library - * - */ - #ifndef TEST_BENCH_HPP #define TEST_BENCH_HPP -- cgit