First Commit

This commit is contained in:
2025-11-18 14:18:26 -07:00
parent 33eb6e3707
commit 27277ec342
6106 changed files with 3571167 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
#
# SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#
"""
Script to fix bugs in code generated by shiboken-generator vr2
"""
import sys
import re
def removeExtraNamespaceForDefaultEnumValue(filename):
"""
Remove namespace from default flag value
this is a shiboken2 bug fixed on shiboken6
"""
regex = re.compile(r"\s=\s[^\s]+::{}")
newContent = ""
with open(filename, encoding='utf-8') as f:
for line in f:
newContent += re.sub(regex, ' = {}', line)
with open(filename, "w", encoding='utf-8') as f:
f.write(newContent)
# Usage: <script> <list-of-files>
# It will fix the file inplace
if __name__ == '__main__':
for fileToFix in sys.argv[1:]:
print("Fixup: {}".format(fileToFix))
removeExtraNamespaceForDefaultEnumValue(fileToFix)