Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Games
Kajongg
Commits
78577c49
Commit
78577c49
authored
May 06, 2021
by
Wolfgang Rohdewald
Browse files
introduce Debug.isalive
parent
9b0604df
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/common.py
View file @
78577c49
...
...
@@ -38,13 +38,19 @@ def isAlive(qobj):
Up to supporting Pyside2, this function
was taken from the book
"Rapid GUI Programming with Python and Qt"
by Mark Summerfield but that does not work with Pyside2."""
by Mark Summerfield but that does not work with Pyside2.
Hopefully in the future isAlive can simply return True
unless --debug=isalive."""
if
qobj
is
None
:
return
False
if
isinstance
(
qobj
,
QObject
):
try
:
qobj
.
children
()
except
RuntimeError
:
if
Debug
.
isalive
:
# hopefully isAlive can be discarded later on
print
(
'qobj is NOT alive'
)
raise
return
False
elif
isinstance
(
qobj
,
QGraphicsItem
):
try
:
...
...
@@ -196,6 +202,7 @@ class Debug:
scoring
=
False
wallSize
=
'0'
i18n
=
False
isalive
=
False
def
__init__
(
self
):
raise
Exception
(
'Debug is not meant to be instantiated'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment