Actions in pyblish_lite

Hi. Can not find the reason why Actions doesn’t work in pyblish_lite ( maya2013, windows7 ). I spent hours to try different variants by still stacked. Finally i have tried to load plugins from mock.py and those actions didn`t work too.
When i tried the same things in pyblish_qml it worked fine.
My UserSetup:

import pyblish.api
pyblish.api.register_host("maya")
pyblish.api.register_gui("pyblish_lite")
import pyblish_maya
pyblish_maya.setup()
from pyblish_starter import install, maya
install(maya)

Then i register debug plugins:

import pyblish_lite.mock
for Plugin in pyblish_lite.mock.plugins:
    pyblish.api.register_plugin(Plugin)

When i try to emit any action from GUI it returns error:

# Traceback (most recent call last):
#   File "C:\Program Files\Autodesk\Maya2013\Python\lib\site-packages\pyblish_lite-0.7.4-py2.6.egg\pyblish_lite\window.py", line 748, in <lambda>
#     lambda p=plugin, a=action: self.act(p, a)
#   File "C:\Program Files\Autodesk\Maya2013\Python\lib\site-packages\pyblish_lite-0.7.4-py2.6.egg\pyblish_lite\window.py", line 940, in act
#     index = model_.items.index(plugin)
# ValueError: list.index(x): x not in list

Thanks for reporting this @sega. This might be yet another issue with Python 2.6.

The GUIs currently isn’t being tested against it so it is likely that problems sip in.

Are you able to try in Maya 2014 or above? That should help determine whether the problem is related to Python 2.6 as later versions of Maya ship with 2.7.

If not, then try an older version of Lite and see what happens.

In maya2017 it works fine.

Couldn’t find problem in source code = (
What older version can you recommend to try ?

I have found the problem in window.py:

qaction.triggered.connect(
    lambda p=plugin, a=action: self.act(p, a)
)

Changed to:
qaction.triggered.connect(partial(self.act, plugin, action))

Thanks for this @sega, would it be possible to see a pull-request for this? That way we can get into the hands of everyone right away.

There is no way to make pushes from my work, but i will try do it at home as soon as i can. Just not sure about time yet.

Ok, not a problem.

You might be able to work directly on GitHub, you can fork and edit files directly in the web interface. The PR would then trigger the necessary tests before we merge.

But there’s no rush.

@marcus I’m new in creating pull requests on github but i tried so write me if i did something wrong

You did it right, having a look tomorrow. Thanks @sega!