Skip to content

Commit

Permalink
STYLE: Simplify ctkWrapPythonQt script removing use of obsolete CTK_N…
Browse files Browse the repository at this point in the history
…ULLPTR

This commit reverts e51d3b7 (COMP: Update ctkWrapPythonQt script to
consider CTK_NULLPTR)
  • Loading branch information
jcfr committed Jul 20, 2023
1 parent e1d60f5 commit 49539dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CMake/ctkWrapPythonQt.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def ctk_wrap_pythonqt(target, namespace, output_dir, input_files, extra_verbose)
# my_class(QObject* newParent ...)
# my_class(QWidget* newParent ...)
# Constructor with either QWidget or QObject as first parameter
regex = r"[^~]%s[\s\n]*\([\s\n]*((QObject|QWidget)[\s\n]*\*[\s\n]*\w+[\s\n]*(\=[\s\n]*(0|NULL|nullptr|CTK\_NULLPTR)|,.*\=.*\)|\)|\)))" % className
regex = r"[^~]%s[\s\n]*\([\s\n]*((QObject|QWidget)[\s\n]*\*[\s\n]*\w+[\s\n]*(\=[\s\n]*(0|NULL|nullptr)|,.*\=.*\)|\)|\)))" % className
res = re.search(regex, content, re.MULTILINE)
if res is None:
if extra_verbose:
Expand All @@ -112,7 +112,7 @@ def ctk_wrap_pythonqt(target, namespace, output_dir, input_files, extra_verbose)

# Skip wrapping if object has a virtual pure method
# "x3b" is the unicode for semicolon
regex = r"virtual[\w\n\s\*\(\)]+\=[\s\n]*(0|NULL|nullptr|CTK\_NULLPTR)[\s\n]*\x3b"
regex = r"virtual[\w\n\s\*\(\)]+\=[\s\n]*(0|NULL|nullptr)[\s\n]*\x3b"
res = re.search(regex, content, re.MULTILINE)
if res is not None:
if extra_verbose:
Expand All @@ -131,7 +131,7 @@ def ctk_wrap_pythonqt(target, namespace, output_dir, input_files, extra_verbose)

if parentClassName is None:
# Does constructor signature is of the form: myclass(QObject * parent ...)
regex = r"%s[\s\n]*\([\s\n]*QObject[\s\n]*\*[\s\n]*\w+[\s\n]*(\=[\s\n]*(0|NULL|nullptr|CTK\_NULLPTR)|,.*\=.*\)|\))" % className
regex = r"%s[\s\n]*\([\s\n]*QObject[\s\n]*\*[\s\n]*\w+[\s\n]*(\=[\s\n]*(0|NULL|nullptr)|,.*\=.*\)|\))" % className
res = re.search(regex, content, re.MULTILINE)
if res is not None:
parentClassName = "QObject"
Expand All @@ -140,7 +140,7 @@ def ctk_wrap_pythonqt(target, namespace, output_dir, input_files, extra_verbose)

if parentClassName is None:
# Does constructor signature is of the form: myclass(QWidget * parent ...)
regex = r"%s[\s\n]*\([\s\n]*QWidget[\s\n]*\*[\s\n]*\w+[\s\n]*(\=[\s\n]*(0|NULL|nullptr|CTK\_NULLPTR)|,.*\=.*\)|\))" % className
regex = r"%s[\s\n]*\([\s\n]*QWidget[\s\n]*\*[\s\n]*\w+[\s\n]*(\=[\s\n]*(0|NULL|nullptr)|,.*\=.*\)|\))" % className
res = re.search(regex, content, re.MULTILINE)
if res is not None:
parentClassName = "QWidget"
Expand Down

0 comments on commit 49539dc

Please sign in to comment.