From af2f8965c30ce81d7c1be466176393294b884f0a Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Wed, 14 Aug 2019 21:23:48 -0400 Subject: [PATCH] Implement commenting for CREDITS file The reader of CREDITS (GuiAbout.cpp) now ignores lines that start with the number sign (#). This commit also introduces a commented out header in CREDITS reminding any potential editor that all changes will be overwritten by generate_contributions.py. --- lib/CREDITS | 2 ++ lib/generate_contributions.py | 3 +++ src/frontends/qt/GuiAbout.cpp | 2 ++ 3 files changed, 7 insertions(+) diff --git a/lib/CREDITS b/lib/CREDITS index c523ed043b..67d3d987cd 100644 --- a/lib/CREDITS +++ b/lib/CREDITS @@ -1,3 +1,5 @@ +# Do not edit this file. It is created by the script generate_contributions.py +# and any direct change to this file will be overwritten. @bRonen Abravanel @iE-mail: ronena () gmail ! com Support for feyn diagrams diff --git a/lib/generate_contributions.py b/lib/generate_contributions.py index 8e19217679..1a292f2e61 100755 --- a/lib/generate_contributions.py +++ b/lib/generate_contributions.py @@ -301,6 +301,9 @@ def main(argv, contributors): else: txt_credits_data = str(as_txt_credits(contributors)).encode("utf-8") txt_credits = open(argv[1], "wb") + txt_credits.write(b"# Do not edit this file. It is created by the " \ + b"script generate_contributions.py\n# and any direct change to " \ + b"this file will be overwritten.\n") txt_credits.write(txt_credits_data) if sys.version_info[0] < 3: diff --git a/src/frontends/qt/GuiAbout.cpp b/src/frontends/qt/GuiAbout.cpp index 747723ff06..a641e9ad87 100644 --- a/src/frontends/qt/GuiAbout.cpp +++ b/src/frontends/qt/GuiAbout.cpp @@ -61,6 +61,8 @@ static QString credits() QString line; do { line = ts.readLine(); + if (line.startsWith("#")) + continue; if (line.startsWith("@b")) out << "" << line.mid(2) << ""; else if (line.startsWith("@i")) { -- 2.39.5