modified some comments and docstrings

This commit is contained in:
Jakub Trllo 2024-02-06 18:30:39 +01:00
parent ab8d384715
commit 7fd55e3bee
28 changed files with 58 additions and 66 deletions

View file

@ -34,7 +34,7 @@ from .interfaces import (
IGNORED_FILENAMES = (
"__pycache__",
)
# Files ignored on addons import from "./openpype/modules"
# Files ignored on addons import from "./ayon_core/modules"
IGNORED_DEFAULT_FILENAMES = (
"__init__.py",
"base.py",

View file

@ -1,10 +1,10 @@
"""Simplified wrapper for 'click' python module.
Module 'click' is used as main cli handler in AYON/OpenPype. Addons can
Module 'click' is used as main cli handler in AYON. Addons can
register their own subcommands with options. This wrapper allows to define
commands and options as with 'click', but without any dependency.
Why not to use 'click' directly? Version of 'click' used in AYON/OpenPype
Why not to use 'click' directly? Version of 'click' used in AYON
is not compatible with 'click' version used in some DCCs (e.g. Houdini 20+).
And updating 'click' would break other DCCs.
@ -15,10 +15,10 @@ method to convert 'click_wrap' object to 'click' object.
Before
```python
import click
from ayon_core.modules import OpenPypeModule
from ayon_core.modules import AYONAddon
class ExampleAddon(OpenPypeModule):
class ExampleAddon(AYONAddon):
name = "example"
def cli(self, click_group):
@ -40,10 +40,10 @@ def mycommand(arg1, arg2):
Now
```
from ayon_core import click_wrap
from ayon_core.modules import OpenPypeModule
from ayon_core.modules import AYONAddon
class ExampleAddon(OpenPypeModule):
class ExampleAddon(AYONAddon):
name = "example"
def cli(self, click_group):
@ -72,10 +72,10 @@ Added small enhancements:
Example:
```python
from ayon_core import click_wrap
from ayon_core.modules import OpenPypeModule
from ayon_core.modules import AYONAddon
class ExampleAddon(OpenPypeModule):
class ExampleAddon(AYONAddon):
name = "example"
def cli(self, click_group):
@ -106,7 +106,7 @@ Example:
```
```shell
openpype_console addon example mycommand --arg1 value1 --arg2
ayon addon example mycommand --arg1 value1 --arg2
```
"""

View file

@ -1,3 +0,0 @@
This directory is for storing external addons that needs to be included in the pipeline when distributed.
The directory is ignored by Git, but included in the zip and installation files.

View file

@ -22,9 +22,9 @@ class LaunchWithTerminal(PreLaunchHook):
return
# Check if first argument match executable path
# - Few applications are not executed directly but through OpenPype
# process (Photoshop, AfterEffects, Harmony, ...). These should not
# use `open`.
# - Few applications are not executed directly but through AYON
# launcher process (Photoshop, AfterEffects, Harmony, ...).
# These should not use `open`.
if self.launch_context.launch_args[0] != executable:
return

View file

@ -15,7 +15,7 @@ class NonPythonHostHook(PreLaunchHook):
Non python host implementation do not launch host directly but use
python script which launch the host. For these cases it is necessary to
prepend python (or openpype) executable and script path before application's.
prepend python (or ayon) executable and script path before application's.
"""
app_groups = {"harmony", "photoshop", "aftereffects"}

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# flake8: noqa E402
"""OpenPype lib functions."""
"""AYON lib functions."""
# add vendor to sys path based on Python version
import sys
import os

View file

@ -1262,7 +1262,7 @@ class ApplicationLaunchContext:
# Linux uses mid process
# - it is possible that the mid process executable is not
# available for this version of OpenPype in that case use standard
# available for this version of AYON in that case use standard
# launch
launch_args = get_linux_launcher_args()
if launch_args is None:
@ -2037,8 +2037,8 @@ def get_non_python_host_kwargs(kwargs, allow_console=True):
"""Explicit setting of kwargs for Popen for AE/PS/Harmony.
Expected behavior
- openpype_console opens window with logs
- openpype_gui has stdout/stderr available for capturing
- ayon_console opens window with logs
- ayon has stdout/stderr available for capturing
Args:
kwargs (dict) or None

View file

@ -180,9 +180,9 @@ def clean_envs_for_ayon_process(env=None):
def run_ayon_launcher_process(*args, **kwargs):
"""Execute OpenPype process with passed arguments and wait.
"""Execute AYON process with passed arguments and wait.
Wrapper for 'run_process' which prepends OpenPype executable arguments
Wrapper for 'run_process' which prepends AYON executable arguments
before passed arguments and define environments if are not passed.
Values from 'os.environ' are used for environments if are not passed.
@ -205,7 +205,7 @@ def run_ayon_launcher_process(*args, **kwargs):
env = kwargs.pop("env", None)
# Keep env untouched if are passed and not empty
if not env:
# Skip envs that can affect OpenPype process
# Skip envs that can affect AYON launcher process
# - fill more if you find more
env = clean_envs_for_ayon_process(os.environ)
@ -213,19 +213,19 @@ def run_ayon_launcher_process(*args, **kwargs):
def run_openpype_process(*args, **kwargs):
"""Execute OpenPype process with passed arguments and wait.
"""Execute AYON process with passed arguments and wait.
Wrapper for 'run_process' which prepends OpenPype executable arguments
Wrapper for 'run_process' which prepends AYON executable arguments
before passed arguments and define environments if are not passed.
Values from 'os.environ' are used for environments if are not passed.
They are cleaned using 'clean_envs_for_openpype_process' function.
They are cleaned using 'clean_envs_for_ayon_process' function.
Example:
>>> run_openpype_process("version")
Args:
*args (tuple): OpenPype cli arguments.
*args (tuple): AYON cli arguments.
**kwargs (dict): Keyword arguments for subprocess.Popen.
"""
@ -240,7 +240,7 @@ def run_detached_process(args, **kwargs):
Args:
*args (tuple): OpenPype cli arguments.
*args (tuple): AYON cli arguments.
**kwargs (dict): Keyword arguments for subprocess.Popen.
Returns:
@ -355,7 +355,7 @@ def get_linux_launcher_args(*args):
This function should be able as arguments are different when used
from code and build.
It is possible that this function is used in OpenPype build which does
It is possible that this function is used in AYON build which does
not have yet the new executable. In that case 'None' is returned.
Todos:

View file

@ -59,8 +59,8 @@ class AYONSecureRegistry:
keyring.set_keyring(Windows.WinVaultKeyring())
# Force "OpenPype" prefix
self._name = "/".join(("OpenPype", name))
# Force "AYON" prefix
self._name = "/".join(("AYON", name))
def set_item(self, name, value):
# type: (str, str) -> None
@ -242,7 +242,7 @@ class IniSettingRegistry(ASettingRegistry):
if not os.path.exists(self._registry_file):
with open(self._registry_file, mode="w") as cfg:
print("# Settings registry", cfg)
print("# Generated by OpenPype {}".format(version), cfg)
print("# Generated by AYON {}".format(version), cfg)
now = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
print("# {}".format(now), cfg)

View file

@ -249,8 +249,8 @@ class Logger:
def get_process_name(cls):
"""Process name that is like "label" of a process.
OpenPype's logging can be used from OpenPyppe itself of from hosts.
Even in OpenPype process it's good to know if logs are from tray or
AYON logging can be used from OpenPyppe itself of from hosts.
Even in AYON process it's good to know if logs are from tray or
from other cli commands. This should help to identify that information.
"""
if cls._process_name is not None:

View file

@ -419,7 +419,7 @@ def apply_plugin_settings_automatically(plugin, settings, logger=None):
def filter_pyblish_plugins(plugins):
"""Pyblish plugin filter which applies OpenPype settings.
"""Pyblish plugin filter which applies AYON settings.
Apply OpenPype settings on discovered plugins. On plugin with implemented
class method 'def apply_settings(cls, project_settings, system_settings)'

View file

@ -23,12 +23,12 @@ def create_custom_tempdir(project_name, anatomy=None):
Returns:
str | None: formatted path or None
"""
openpype_tempdir = os.getenv("OPENPYPE_TMPDIR")
if not openpype_tempdir:
env_tmpdir = os.getenv("OPENPYPE_TMPDIR")
if not env_tmpdir:
return
custom_tempdir = None
if "{" in openpype_tempdir:
if "{" in env_tmpdir:
if anatomy is None:
anatomy = Anatomy(project_name)
# create base formate data
@ -41,11 +41,11 @@ def create_custom_tempdir(project_name, anatomy=None):
}
# path is anatomy template
custom_tempdir = StringTemplate.format_template(
openpype_tempdir, data).normalized()
env_tmpdir, data).normalized()
else:
# path is absolute
custom_tempdir = openpype_tempdir
custom_tempdir = env_tmpdir
# create the dir path if it doesn't exists
if not os.path.exists(custom_tempdir):

View file

@ -5,7 +5,7 @@ it need only access to settings. Disadvantage is that it is hard to focus
build per context and being explicit about loaded content.
For more explicit workfile build is recommended 'AbstractTemplateBuilder'
from '~/openpype/pipeline/workfile/workfile_template_builder'. Which gives
from '~/ayon_core/pipeline/workfile/workfile_template_builder'. Which gives
more abilities to define how build happens but require more code to achive it.
"""

View file

@ -840,7 +840,7 @@ class AbstractTemplateBuilder(object):
solved_path = os.path.normpath(solved_path)
if not os.path.exists(solved_path):
raise TemplateNotFound(
"Template found in openPype settings for task '{}' with host "
"Template found in AYON settings for task '{}' with host "
"'{}' does not exists. (Not found : {})".format(
task_name, host_name, solved_path))

View file

@ -60,7 +60,7 @@ class DeliveryOptionsDialog(QtWidgets.QDialog):
def __init__(self, contexts, log=None, parent=None):
super(DeliveryOptionsDialog, self).__init__(parent=parent)
self.setWindowTitle("OpenPype - Deliver versions")
self.setWindowTitle("AYON - Deliver versions")
icon = QtGui.QIcon(resources.get_ayon_icon_filepath())
self.setWindowIcon(icon)

View file

@ -342,7 +342,6 @@ class CollectAnatomyInstanceData(pyblish.api.ContextPlugin):
return
project_name = instance.context.data["projectName"]
# OpenPype approach vs AYON approach
if "/" not in asset_name:
tasks_info = self._find_tasks_info_in_hierarchy(
hierarchy_context, asset_name

View file

@ -32,4 +32,4 @@ class CollectFarmTarget(pyblish.api.InstancePlugin):
self.log.debug("Collected render target: {0}".format(farm_name))
instance.data["toBeRenderedOn"] = farm_name
else:
AssertionError("No OpenPype renderer module found")
AssertionError("No AYON renderer addon found")

View file

@ -428,7 +428,7 @@ class ExtractBurnin(publish.Extractor):
if not os.path.exists(font_filepath):
font_filepath = None
# Use OpenPype default font
# Use default AYON font
if not font_filepath:
font_filepath = resources.get_liberation_font_path()

View file

@ -39,7 +39,7 @@ class ExtractReview(pyblish.api.InstancePlugin):
otherwise the representation is ignored.
All new representations are created and encoded by ffmpeg following
presets found in OpenPype Settings interface at
presets found in AYON Settings interface at
`project_settings/global/publish/ExtractReview/profiles:outputs`.
"""

View file

@ -30,7 +30,7 @@ class IntegrateSubsetGroup(pyblish.api.InstancePlugin):
def process(self, instance):
"""Look into subset group profiles set by settings.
Attribute 'subset_grouping_profiles' is defined by OpenPype settings.
Attribute 'subset_grouping_profiles' is defined by settings.
"""
# Skip if 'subset_grouping_profiles' is empty

View file

@ -1,4 +1,4 @@
""" Integrate Thumbnails for Openpype use in Loaders.
""" Integrate Thumbnails for use in Loaders.
This thumbnail is different from 'thumbnail' representation which could
be uploaded to Ftrack, or used as any other representation in Loaders to
@ -37,7 +37,7 @@ InstanceFilterResult = collections.namedtuple(
class IntegrateThumbnailsAYON(pyblish.api.ContextPlugin):
"""Integrate Thumbnails for Openpype use in Loaders."""
"""Integrate Thumbnails for use in Loaders."""
label = "Integrate Thumbnails to AYON"
order = pyblish.api.IntegratorOrder + 0.01

View file

@ -5,7 +5,7 @@ from ayon_core.pipeline.publish import PublishValidationError
class ValidateVersion(pyblish.api.InstancePlugin):
"""Validate instance version.
OpenPype does not allow overwriting previously published versions.
AYON does not allow overwriting previously published versions.
"""
order = pyblish.api.ValidatorOrder

View file

@ -8,5 +8,5 @@ This webserver is started in spawned Python process that opens DCC during
its launch, waits for connection from DCC and handles communication going
forward. Server is closed before Python process is killed.
(Different from `openpype/modules/webserver` as that one is running in Tray,
(Different from `ayon_core/modules/webserver` as that one is running in Tray,
this one is running in spawn Python process.)

View file

@ -47,7 +47,7 @@ class ApplicationAction(LauncherAction):
Handling of applications in launcher is not ideal and should be completely
redone from scratch. This is just a temporary solution to keep backwards
compatibility with OpenPype launcher.
compatibility with AYON launcher.
Todos:
Move handling of errors to frontend.

View file

@ -249,7 +249,7 @@ class LoaderActionsModel:
def _filter_loaders_by_tool_name(self, project_name, loaders):
"""Filter loaders by tool name.
Tool names are based on OpenPype tools loader tool and library
Tool names are based on AYON tools loader tool and library
loader tool. The new tool merged both into one tool and the difference
is based only on current project name.
@ -263,7 +263,7 @@ class LoaderActionsModel:
# Keep filtering by tool name
# - if current context project name is same as project name we do
# expect the tool is used as OpenPype loader tool, otherwise
# expect the tool is used as AYON loader tool, otherwise
# as library loader tool.
if project_name == self._get_current_context_project():
tool_name = "loader"

View file

@ -1332,7 +1332,7 @@ class CreatorAttrsWidget(QtWidgets.QWidget):
Attributes are defined on creator so are dynamic. Their look and type is
based on attribute definitions that are defined in
`~/openpype/pipeline/lib/attribute_definitions.py` and their widget
`~/ayon_core/lib/attribute_definitions.py` and their widget
representation in `~/openpype/tools/attribute_defs/*`.
Widgets are disabled if context of instance is not valid.
@ -1466,12 +1466,12 @@ class PublishPluginAttrsWidget(QtWidgets.QWidget):
Attributes are defined on publish plugins. Publihs plugin may define
attribute definitions but must inherit `AYONPyblishPluginMixin`
(~/openpype/pipeline/publish). At the moment requires to implement
(~/ayon_core/pipeline/publish). At the moment requires to implement
`get_attribute_defs` and `convert_attribute_values` class methods.
Look and type of attributes is based on attribute definitions that are
defined in `~/openpype/pipeline/lib/attribute_definitions.py` and their
widget representation in `~/openpype/tools/attribute_defs/*`.
defined in `~/ayon_core/lib/attribute_definitions.py` and their
widget representation in `~/ayon_core/tools/attribute_defs/*`.
Widgets are disabled if context of instance is not valid.

View file

@ -787,11 +787,7 @@ def get_repre_icons():
try:
from openpype_modules import sync_server
except Exception:
# Backwards compatibility
try:
from ayon_core.modules import sync_server
except Exception:
return icons
return icons
resource_path = os.path.join(
os.path.dirname(sync_server.sync_server_module.__file__),

View file

@ -635,7 +635,7 @@ class BaseWorkfileController(
folder = self.get_folder_entity(project_name, folder_id)
if task is None:
task = self.get_task_entity(project_name, task_id)
# NOTE keys should be OpenPype compatible
# NOTE keys should are OpenPype compatible
return {
"project_name": project_name,
"folder_id": folder_id,