added comments and deprecation warnings to classes which stayed where they are

This commit is contained in:
Jakub Trllo 2022-08-26 12:27:55 +02:00
parent 2e412b55c1
commit 9ead117915
2 changed files with 26 additions and 4 deletions

View file

@ -62,6 +62,11 @@ def get_errored_plugins_from_data(context):
return get_errored_plugins_from_context(context)
# 'RepairAction' and 'RepairContextAction' were moved to
# 'openpype.pipeline.publish' please change you imports.
# There is no "reasonable" way hot mark these classes as deprecated to show
# warning of wrong import.
# Deprecated since 3.14.* will be removed in 3.16.*
class RepairAction(pyblish.api.Action):
"""Repairs the action
@ -88,6 +93,7 @@ class RepairAction(pyblish.api.Action):
plugin.repair(instance)
# Deprecated since 3.14.* will be removed in 3.16.*
class RepairContextAction(pyblish.api.Action):
"""Repairs the action

View file

@ -56,14 +56,30 @@ def deprecated(new_destination):
if func is None:
return _decorator
return _decorator(func)
# Classes just inheriting from pyblish classes
# - seems to be unused in code (not 100% sure)
# - they should be removed but because it is not clear if they're used
# we'll keep then and log deprecation warning
# Deprecated since 3.14.* will be removed in 3.16.*
class ContextPlugin(pyblish.api.ContextPlugin):
def process(cls, *args, **kwargs):
super(ContextPlugin, cls).process(cls, *args, **kwargs)
def __init__(self, *args, **kwargs):
_deprecation_warning(
"openpype.plugin.ContextPlugin",
" Please replace your usage with 'pyblish.api.ContextPlugin'."
)
super(ContextPlugin, self).__init__(*args, **kwargs)
# Deprecated since 3.14.* will be removed in 3.16.*
class InstancePlugin(pyblish.api.InstancePlugin):
def process(cls, *args, **kwargs):
super(InstancePlugin, cls).process(cls, *args, **kwargs)
def __init__(self, *args, **kwargs):
_deprecation_warning(
"openpype.plugin.ContextPlugin",
" Please replace your usage with 'pyblish.api.InstancePlugin'."
)
super(InstancePlugin, self).__init__(*args, **kwargs)
# NOTE: This class is used on so many places I gave up moving it