Drop python2 support. #35
Merged
SlavekB
merged 1 commits from feat/drop-python2
into master
1 year ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'feat/drop-python2'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Update for PyTQt.
Although my experience with Python is small, I hope that conversions using 2to3 and subsequent adjustments of the code are fine.
Some corrections required related to string.contains.
print("[Alarm Script] Received notification: " + str( string ))
if string.contains( "configure" ):
if "configure" in string:
This seems wrong.
string
is aTQString
object, so the call tocontains
actually calls the TQString method with the same name through C++ extension. I don't think we should change this line.It may also be a good idea to rename
string
to something else, since it could be confused with thestring
python2 object.debug( "Received notification: " + str( string ) )
if string.contains( "configure" ):
if "configure" in string:
As before, this line shoud not be changed. Some for subsequent
cotains
calls in the following few lines.debug( "Received notification: " + str( string ) )
if string.contains( "configure" ):
if "configure" in string:
As per previous comments, replacing the calls to
contains
seems wrong.debug( "Received notification: " + str( string ) )
if string.contains( "configure" ):
if "configure" in string:
As before, replacing
contains
seems wrong.elif string.contains( "customMenuClicked" ):
elif "customMenuClicked" in string:
if "selected" in string:
Thank you for the comment on
string
that isTQstring
object – I did not realize that in this casecontains(...)
is the call of the TQString object method and there is no need to change it.However, you may notice that in the original code the same use of
"something" in string
has previously been in other places, such as this. It seems that both ways can work. Perhaps it would be good for the same way to be used in all cases.I did a test to see if things could work or not. It seems that both ways work fine.
So we could probably merge the PR as is now.
PR is already updated to use
eventStr.contains(...)
in all cases 😉Yes, I hadn't noticed the new commit before my previous comment, but just reviewed it now :-)
8e7e2f5893
to9be5499101
1 year agoLooks good.
9be5499101
into master 1 year agoReviewers
9be5499101
.