From 50e78afb9f44340842d05b0e4d08bc5ce952063b Mon Sep 17 00:00:00 2001 From: Miguel Gonzalez Date: Thu, 20 Sep 2018 17:47:45 +0200 Subject: [PATCH] Remove obsolete file --- scripts/add_licanse_to_coffee_files.py | 49 -------------------------- 1 file changed, 49 deletions(-) delete mode 100644 scripts/add_licanse_to_coffee_files.py diff --git a/scripts/add_licanse_to_coffee_files.py b/scripts/add_licanse_to_coffee_files.py deleted file mode 100644 index 8dc3fd40..00000000 --- a/scripts/add_licanse_to_coffee_files.py +++ /dev/null @@ -1,49 +0,0 @@ -import os, sys - -LICENSE = """### -# Copyright (C) 2014-2017 Taiga Agile LLC -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# File: {file_name} -### - -{data}""" - -CONTAIN_TEXT = "You should have received a copy of the GNU Affero General Public License" - - -BASE_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) - -DIRS = [ - os.path.join(BASE_DIR, "app/coffee"), - os.path.join(BASE_DIR, "app/modules"), -] - -def proccess_dirs(path): - for root, dirs_list, files_list in os.walk(path): - for file_name in filter(lambda f: f.endswith(".coffee"), files_list): - file_path = os.path.join(root, file_name) - - with open(file_path, "r") as fr: - data = fr.read() - - if CONTAIN_TEXT not in data: - with open(file_path, "w") as fw: - fw.seek(0) - fw.write(LICENSE.format(file_name=file_name, data=data)) - - -for dir_path in DIRS: - proccess_dirs(dir_path)