Hi,
I wrote a simple series of pyblish plugins for testing purposes and I realized that some of the code runs differently under pyblish_lite that it would under pyblish_qml.
1.) Is it not true that lite vs qml are sole front end of the pyblish and every plugin in theory should behave the same ?
code:
class DebugFixAction(pyblish.api.Action):
'''run a plugin's debugfix on every failed instance'''
label = "Debug-fix"
def process(self, context, plugin):
self.log.info("Running {} auto-fix".format(plugin))
from pprint import pprint
for inst in context:
pprint(inst.data())
pyblish_lite output:
>>>
{u'__families__': ['placeholder'],
u'_has_failed': True,
u'_has_processed': True,
u'_has_succeeded': False,
u'_is_idle': False,
u'_is_processing': False,
u'_type': u'instance',
'family': 'placeholder',
u'label': u'def_placeholder_grp',
'name': u'def_placeholder_grp',
u'optional': True,
u'publish': True}
stacktrace:
# File "/mnt/ps-storage01/appdepot/dev_packages/<user>/python_extras/0.9.1/python-2.7.17/site-packages/pyblish_lite/control.py", line 100, in on_next
# result = pyblish.plugin.process(plugin, context, None, action.id)
# File "/mnt/ps-storage01/appdepot/dev_packages/<user>/python_extras/0.9.1/python-2.7.17/site-packages/pyblish/plugin.py", line 466, in process
# result = __explicit_process(plugin, context, instance, action)
# File "/mnt/ps-storage01/appdepot/dev_packages/<user>/python_extras/0.9.1/python-2.7.17/site-packages/pyblish/plugin.py", line 517, in __explicit_process
# runner(*args)
# File "/mnt/ps-storage01/appdepot/dev_packages/<user>/assettools/0.4.0/python/studio/pyblish/pyblish_checks/placeholder_check.py", line 48, in process
# import pdb; pdb.set_trace()
pyblish_qml output:
>>> {'family': 'placeholder', 'name': u'def_placeholder_grp'}
stacktrace:
# File "/mnt/ps-storage01/appdepot/dev_packages/<user>/python_extras/0.9.1/python-2.7.17/site-packages/pyblish_qml/ipc/service.py", line 97, in process
# action=action)
# File "/mnt/ps-storage01/appdepot/dev_packages/<user>/python_extras/0.9.1/python-2.7.17/site-packages/pyblish/plugin.py", line 466, in process
# result = __explicit_process(plugin, context, instance, action)
# File "/mnt/ps-storage01/appdepot/dev_packages/<user>/python_extras/0.9.1/python-2.7.17/site-packages/pyblish/plugin.py", line 517, in __explicit_process
# runner(*args)
# File "/mnt/ps-storage01/appdepot/dev_packages/<user>/assettools/0.4.0/python/studio/pyblish/pyblish_checks/placeholder_check.py", line 48, in process
# import pdb; pdb.set_trace()
Question:
1.) Is it not true that lite vs qml are sole front end of the pyblish and every plugin in theory should behave the same ?
2.) Why do pyblish_qml/ipc/service.py and pyblish_lite/control.py fill context data differently ? Is there a reason for that ?
3.) I am after the instance.data '_has_failed': True
flag to run automated fixes on failed instances. Do failed instances have to be queried differntly using pyblish_qml ? What’s could be a good temporary solution here ?
pyblish_lite
class DebugFixAction(pyblish.api.Action):
'''run a plugin's debugfix on every failed instance'''
label = "Debug-fix"
def process(self, context, plugin):
self.log.info("Running {} auto-fix".format(plugin))
# from pprint import pprint
# for inst in context:
# pprint(inst.data())