From 1653b9c34b62d283d0e4b1a876a2096add209dfe Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 19 Sep 2023 23:38:35 +1000 Subject: [PATCH] LGPL, slight restructure. --- lib/python/qmk/cli/license_check.py | 48 +---------- lib/python/qmk/constants.py | 123 ++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+), 47 deletions(-) diff --git a/lib/python/qmk/cli/license_check.py b/lib/python/qmk/cli/license_check.py index 15a504fe3efa..c28dcfe0dffb 100644 --- a/lib/python/qmk/cli/license_check.py +++ b/lib/python/qmk/cli/license_check.py @@ -1,53 +1,7 @@ import re from pathlib import Path from milc import cli - -LICENSE_TEXTS = [ - ( - 'GPL-2.0-or-later', [ - """\ - 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 2 - of the License, or (at your option) any later version. - """, """\ - 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 2 - of the License, or any later version. - """ - ] - ), - ('GPL-2.0-only', ["""\ - 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; version 2. - """]), - ( - 'GPL-3.0-or-later', [ - """\ - 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 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 any later version. - """ - ] - ), - ('GPL-3.0-only', ["""\ - 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, version 3. - """]), - ('Apache-2.0', ["""\ - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - """]), -] +from qmk.constants import LICENSE_TEXTS L_PAREN = re.compile(r'\(\[\{\<') R_PAREN = re.compile(r'\)\]\}\>') diff --git a/lib/python/qmk/constants.py b/lib/python/qmk/constants.py index 97bd84aa2344..1967441fc89a 100644 --- a/lib/python/qmk/constants.py +++ b/lib/python/qmk/constants.py @@ -189,3 +189,126 @@ # ################################################################################ ''' + +LICENSE_TEXTS = [ + ( + 'GPL-2.0-or-later', [ + """\ + 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 2 + of the License, or (at your option) any later version. + """, """\ + 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 2 + of the License, or any later version. + """ + ] + ), + ('GPL-2.0-only', ["""\ + 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; version 2. + """]), + ( + 'GPL-3.0-or-later', [ + """\ + 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 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 any later version. + """ + ] + ), + ('GPL-3.0-only', ["""\ + 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, version 3. + """]), + ( + 'LGPL-2.1-or-later', [ + """\ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2.1 + of the License, or (at your option) any later version. + """, """\ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2.1 + of the License, or any later version. + """, """\ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2.1 + of the License, or (at your option) any later version. + """, """\ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2.1 + of the License, or any later version. + """ + ] + ), + ( + 'LGPL-2.1-only', [ + """\ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; version 2.1. + """, """\ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; version 2.1. + """ + ] + ), + ( + 'LGPL-3.0-or-later', [ + """\ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser 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 free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 3 + of the License, or any later version. + """, """\ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 3 + of the License, or (at your option) any later version. + """, """\ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 3 + of the License, or any later version. + """ + ] + ), + ( + 'LGPL-3.0-only', [ + """\ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; version 3. + """, """\ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; version 3. + """ + ] + ), + ('Apache-2.0', ["""\ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + """]), +]