Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

General: Event callbacks pass event to callbacks as expected #4210

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

iLLiCiTiT
Copy link
Member

Brief description

It seems that event callbacks were broken for all Python 2 hosts because of wrong check of function signature when a method was used.

Description

To find out if arguments should be passed is tried to bound argumets to callback instead of checking the function specs on own. Also added option to pass event as kwarg to callback function (positional arguments have priority).

Additional information

This PR was made because of issues in Publisher tool when combined with Nuke 12.* in PR.

Testing notes:

  1. Try event callbacks in Python 2 host where are used for method bounding

@iLLiCiTiT iLLiCiTiT self-assigned this Dec 12, 2022
@iLLiCiTiT iLLiCiTiT added the type: bug Something isn't working label Dec 12, 2022
Copy link
Member

@jakubjezek001 jakubjezek001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in Nuke New publisher but something is still not clicking as it should. It is showing now workfile isntance and legacy convertor plugin but not the button in instance attributes.

image

Once I click on any instance it is doing also nothing and this is in terminal.

Traceback (most recent call last):
  File "C:\CODE\__PYPE\OpenPype\openpype\tools\utils\widgets.py", line 77, in mouseReleaseEvent
    self._mouse_release_callback()
  File "C:\CODE\__PYPE\OpenPype\openpype\tools\publisher\widgets\card_view_widgets.py", line 315, in _mouse_release_callback
    self.selected.emit(self._id, self._group_identifier, selection_type)
TypeError: selected(QString,QString) only accepts 2 argument(s), 3 given!

@iLLiCiTiT
Copy link
Member Author

Once I click on any instance it is doing also nothing and this is in terminal.

Issue unrelated to this PR.

@iLLiCiTiT iLLiCiTiT merged commit ac7a00f into develop Dec 16, 2022
@iLLiCiTiT iLLiCiTiT deleted the bugfix/event_argspec_in_python_2 branch December 16, 2022 10:54
@github-actions github-actions bot added this to the next-patch milestone Dec 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants