From 4bdae494cb8541966a838bb5468044a0ac303375 Mon Sep 17 00:00:00 2001 From: Vinayak Agarwal Date: Mon, 17 Oct 2016 03:31:35 +0530 Subject: [PATCH] Add script for GPL --- TShockAPI/BackupManager.cs | 2 +- TShockAPI/Commands.cs | 2 +- TShockAPI/ConfigFile.cs | 2 +- TShockAPI/FileTools.cs | 2 +- TShockAPI/GeoIPCountry.cs | 2 +- TShockAPI/GetDataHandlers.cs | 2 +- TShockAPI/Group.cs | 2 +- TShockAPI/HandlerList.cs | 2 +- TShockAPI/ILog.cs | 2 +- TShockAPI/IPackable.cs | 2 +- TShockAPI/NetItem.cs | 18 +++++ TShockAPI/PacketBufferer.cs | 2 +- TShockAPI/PaginationTools.cs | 2 +- TShockAPI/Permissions.cs | 2 +- TShockAPI/PlayerData.cs | 18 +++++ TShockAPI/Resources.Designer.cs | 18 +++++ TShockAPI/SaveManager.cs | 2 +- TShockAPI/SqlLog.cs | 2 +- TShockAPI/StatTracker.cs | 18 +++++ TShockAPI/TSPlayer.cs | 2 +- TShockAPI/TSServerPlayer.cs | 18 +++++ TShockAPI/TShock.cs | 2 +- TShockAPI/TextLog.cs | 2 +- TShockAPI/UpdateManager.cs | 2 +- TShockAPI/Utils.cs | 2 +- TShockRestTestPlugin/TShockRestTestPlugin.cs | 18 +++++ gpltext.py | 83 ++++++++++++++++++++ scripts/create_release.py | 18 +++++ scripts/deploy_release.py | 18 +++++ scripts/test_release.py | 18 +++++ 30 files changed, 265 insertions(+), 20 deletions(-) create mode 100644 gpltext.py diff --git a/TShockAPI/BackupManager.cs b/TShockAPI/BackupManager.cs index d484c389..58b544f4 100644 --- a/TShockAPI/BackupManager.cs +++ b/TShockAPI/BackupManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 08e5477e..a4ddb549 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index c4f9cf35..f32099ab 100755 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/FileTools.cs b/TShockAPI/FileTools.cs index e0aada85..a85c269f 100644 --- a/TShockAPI/FileTools.cs +++ b/TShockAPI/FileTools.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/GeoIPCountry.cs b/TShockAPI/GeoIPCountry.cs index 764a69a2..a97ef46f 100644 --- a/TShockAPI/GeoIPCountry.cs +++ b/TShockAPI/GeoIPCountry.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 92a8b7f6..e3f74448 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/Group.cs b/TShockAPI/Group.cs index 8c05d64c..63cf5180 100644 --- a/TShockAPI/Group.cs +++ b/TShockAPI/Group.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/HandlerList.cs b/TShockAPI/HandlerList.cs index 07b9d548..6990160d 100644 --- a/TShockAPI/HandlerList.cs +++ b/TShockAPI/HandlerList.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/ILog.cs b/TShockAPI/ILog.cs index 21ad0156..881fad3f 100644 --- a/TShockAPI/ILog.cs +++ b/TShockAPI/ILog.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/IPackable.cs b/TShockAPI/IPackable.cs index 7dbb2d93..017d6292 100644 --- a/TShockAPI/IPackable.cs +++ b/TShockAPI/IPackable.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/NetItem.cs b/TShockAPI/NetItem.cs index af2c8ac8..45cc2a31 100644 --- a/TShockAPI/NetItem.cs +++ b/TShockAPI/NetItem.cs @@ -1,3 +1,21 @@ +/* +TShock, a server mod for Terraria +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + using System; using System.Collections.Generic; using System.Linq; diff --git a/TShockAPI/PacketBufferer.cs b/TShockAPI/PacketBufferer.cs index 66a8de14..3124c695 100644 --- a/TShockAPI/PacketBufferer.cs +++ b/TShockAPI/PacketBufferer.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/PaginationTools.cs b/TShockAPI/PaginationTools.cs index e3161a3c..3bc6de89 100644 --- a/TShockAPI/PaginationTools.cs +++ b/TShockAPI/PaginationTools.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/Permissions.cs b/TShockAPI/Permissions.cs index 0bd00281..35ac2b60 100644 --- a/TShockAPI/Permissions.cs +++ b/TShockAPI/Permissions.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/PlayerData.cs b/TShockAPI/PlayerData.cs index 27baa353..eff5baaa 100644 --- a/TShockAPI/PlayerData.cs +++ b/TShockAPI/PlayerData.cs @@ -1,3 +1,21 @@ +/* +TShock, a server mod for Terraria +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + using Terraria; using TShockAPI; diff --git a/TShockAPI/Resources.Designer.cs b/TShockAPI/Resources.Designer.cs index 49c1d908..026e79d8 100644 --- a/TShockAPI/Resources.Designer.cs +++ b/TShockAPI/Resources.Designer.cs @@ -1,3 +1,21 @@ +/* +TShock, a server mod for Terraria +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/TShockAPI/SaveManager.cs b/TShockAPI/SaveManager.cs index 7ca8ddc6..9ff98287 100644 --- a/TShockAPI/SaveManager.cs +++ b/TShockAPI/SaveManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/SqlLog.cs b/TShockAPI/SqlLog.cs index 083f76e7..047f67c0 100644 --- a/TShockAPI/SqlLog.cs +++ b/TShockAPI/SqlLog.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/StatTracker.cs b/TShockAPI/StatTracker.cs index 62c11283..24913e83 100755 --- a/TShockAPI/StatTracker.cs +++ b/TShockAPI/StatTracker.cs @@ -1,3 +1,21 @@ +/* +TShock, a server mod for Terraria +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + using System; using System.Collections.Generic; using System.Linq; diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index 95feb980..ee2348f6 100755 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/TSServerPlayer.cs b/TShockAPI/TSServerPlayer.cs index 7618e0ca..a69a4ca2 100644 --- a/TShockAPI/TSServerPlayer.cs +++ b/TShockAPI/TSServerPlayer.cs @@ -1,3 +1,21 @@ +/* +TShock, a server mod for Terraria +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + using System; using System.Collections.Generic; using Terraria; diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 1bbb7052..ae5f7889 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/TextLog.cs b/TShockAPI/TextLog.cs index 464305ad..f3072b8f 100644 --- a/TShockAPI/TextLog.cs +++ b/TShockAPI/TextLog.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/UpdateManager.cs b/TShockAPI/UpdateManager.cs index 0884cb77..650bc17b 100755 --- a/TShockAPI/UpdateManager.cs +++ b/TShockAPI/UpdateManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index d596f054..0cd9c0a8 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TShockRestTestPlugin/TShockRestTestPlugin.cs b/TShockRestTestPlugin/TShockRestTestPlugin.cs index 385ba4fc..250ff087 100644 --- a/TShockRestTestPlugin/TShockRestTestPlugin.cs +++ b/TShockRestTestPlugin/TShockRestTestPlugin.cs @@ -1,3 +1,21 @@ +/* +TShock, a server mod for Terraria +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + using System; using System.Collections.Generic; using System.ComponentModel; diff --git a/gpltext.py b/gpltext.py new file mode 100644 index 00000000..63cc024c --- /dev/null +++ b/gpltext.py @@ -0,0 +1,83 @@ +''' TShock, a server mod for Terraria +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +''' + +import re +import os +import glob + +extensions = {'.cs', '.py'} +path = "./" +pattern = "/\*\s?\n?TShock, a server mod for Terraria(\n|.)*\*/" +pypattern = "'''\s?\n?TShock, a server mod for Terraria(\n|.)*'''" +year = "2016" +filename = "./README.md" +text = "/*\n\ +TShock, a server mod for Terraria\n\ +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)\n\ +\n\ +This program is free software: you can redistribute it and/or modify\n\ +it under the terms of the GNU General Public License as published by\n\ +the Free Software Foundation, either version 3 of the License, or\n\ +(at your option) any later version.\n\ +\n\ +This program is distributed in the hope that it will be useful,\n\ +but WITHOUT ANY WARRANTY; without even the implied warranty of\n\ +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\ +GNU General Public License for more details.\n\ +\n\ +You should have received a copy of the GNU General Public License\n\ +along with this program. If not, see .\n\ +*/\n\ +\n\ +" +pytext = re.sub(r"\*/", "'''", text) +pytext = re.sub(r"/\*", "'''", pytext) + +def changeText(filename): + content = '' + + with open(filename, 'r') as f: + content = f.read() + + if filename.endswith('.py'): + if re.search(pypattern, content): + content = re.sub(r"Copyright \(C\) 2011-[\d]{4}", "Copyright (C) 2011-%s" % year, content) + else: + content = pytext + content + else: + if re.search(pattern, content): + content = re.sub(r"Copyright \(C\) 2011-[\d]{4}", "Copyright (C) 2011-%s" % year, content) + else: + content = text + content + + with open(filename, 'w') as f: + f.write(content) + +def getFiles(path): + list = os.listdir(path) + + for f in list: + #print (f) + if os.path.isdir(f): + getFiles(path + f + '/') + else: + for ext in extensions: + if f.endswith(ext): + print (path + f) + changeText(path + f) + +getFiles(path) \ No newline at end of file diff --git a/scripts/create_release.py b/scripts/create_release.py index 3bde7c41..e63ee1b6 100644 --- a/scripts/create_release.py +++ b/scripts/create_release.py @@ -1,3 +1,21 @@ +''' +TShock, a server mod for Terraria +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +''' + # Hey there, this is used to compile TShock on the build server. # Don't change it. Thanks! diff --git a/scripts/deploy_release.py b/scripts/deploy_release.py index 5e2a90e1..4b806761 100644 --- a/scripts/deploy_release.py +++ b/scripts/deploy_release.py @@ -1,3 +1,21 @@ +''' +TShock, a server mod for Terraria +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +''' + import requests import json import sys diff --git a/scripts/test_release.py b/scripts/test_release.py index 53fb234a..60009582 100644 --- a/scripts/test_release.py +++ b/scripts/test_release.py @@ -1,3 +1,21 @@ +''' +TShock, a server mod for Terraria +Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +''' + import subprocess import shutil import os.path