From: gap579137 Date: Mon, 12 Oct 2020 12:53:09 +0000 (-0500) Subject: Delete sumfiles.py X-Git-Tag: aggregated-20250518~831 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a8aa76cc509708566968e129e3630993f1fe9e1;p=thirdparty%2Fblocklistproject%2Flists.git Delete sumfiles.py Moved to py scripts --- diff --git a/sumfiles.py b/sumfiles.py deleted file mode 100644 index d9c34e1..0000000 --- a/sumfiles.py +++ /dev/null @@ -1,28 +0,0 @@ -import glob, os - -# Set cwd to file location -os.chdir(os.path.dirname(os.path.realpath(__file__))) - -# Get every .txt file in folder (except output file) -txt_files = [f for f in glob.glob("*.txt")] -txt_files.remove("everything.txt") - -# For non-duplicates lines + count + write -read_lines = set() - -# Info text to go on top, formattable at "Total number of network filters" -info_text = "\n#------------------------------------[UPDATE]--------------------------------------\n# Title: The Block List Project\n# Expires: 1 day\n# Homepage: https://blocklist.site\n# Help: https://github.com/blocklistproject/lists/wiki/\n# License: https://unlicense.org\n# Total number of network filters: {}\n#------------------------------------[SUPPORT]-------------------------------------\n# You can support by:\n# - reporting false positives\n# - making a donation: https://paypal.me/blocklistproject\n#-------------------------------------[INFO]---------------------------------------\n#\n# Summed list\n#------------------------------------[FILTERS]-------------------------------------\n" - -# Read all .txt-files and save non-duplicate lines -for input_file in txt_files: - for line in open(input_file, "r"): - read_lines.add(line) - -# Count, format and sum text -no_of_lines = len(read_lines) -info_text = info_text.format(no_of_lines - 16) -summed_lines = "".join(read_lines) - -with open("everything.txt", "w") as output_file: - output_file.write(info_text) - output_file.write(summed_lines) \ No newline at end of file