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

General: Import lib functions from lib #4017

Merged
merged 3 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import os
import tempfile
import pyblish.api
import openpype.api
from openpype.lib import (
get_ffmpeg_tool_path,
get_ffprobe_streams,
path_to_subprocess_arg,
run_subprocess,
)


Expand Down Expand Up @@ -96,7 +96,7 @@ def process(self, instance):

# run subprocess
self.log.debug("Executing: {}".format(subprocess_jpeg))
openpype.api.run_subprocess(
run_subprocess(
subprocess_jpeg, shell=True, logger=self.log
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _get_template_data(self, task):
"""
Get data to fill template from task

.. seealso:: :mod:`openpype.api.Anatomy`
.. seealso:: :mod:`openpype.pipeline.Anatomy`

:param task: Task entity
:type task: dict
Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/ftrack/ftrack_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def on_system_settings_save(
app_definitions_from_app_manager,
tool_definitions_from_app_manager
)
from openpype.api import ApplicationManager
from openpype.lib import ApplicationManager
query_keys = [
"id",
"key",
Expand Down
2 changes: 1 addition & 1 deletion openpype/plugins/load/open_djv.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from openpype.api import ApplicationManager
from openpype.lib import ApplicationManager
from openpype.pipeline import load


Expand Down
5 changes: 3 additions & 2 deletions openpype/plugins/publish/collect_scene_version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import pyblish.api
import openpype.api as pype

from openpype.lib import get_version_from_path


class CollectSceneVersion(pyblish.api.ContextPlugin):
Expand Down Expand Up @@ -46,7 +47,7 @@ def process(self, context):
if '<shell>' in filename:
return

version = pype.get_version_from_path(filename)
version = get_version_from_path(filename)
assert version, "Cannot determine version"

rootVersion = int(version)
Expand Down
11 changes: 4 additions & 7 deletions openpype/plugins/publish/extract_otio_audio_tracks.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import os
import pyblish
import openpype.api
from openpype.lib import (
get_ffmpeg_tool_path,
path_to_subprocess_arg
run_subprocess
)
import tempfile
import opentimelineio as otio
Expand Down Expand Up @@ -102,9 +101,7 @@ def add_audio_to_instances(self, audio_file, instances):

# run subprocess
self.log.debug("Executing: {}".format(" ".join(cmd)))
openpype.api.run_subprocess(
cmd, logger=self.log
)
run_subprocess(cmd, logger=self.log)
else:
audio_fpath = recycling_file.pop()

Expand Down Expand Up @@ -225,7 +222,7 @@ def create_empty(self, inputs):
# run subprocess
self.log.debug("Executing: {}".format(" ".join(cmd)))

openpype.api.run_subprocess(
run_subprocess(
cmd, logger=self.log
)

Expand Down Expand Up @@ -308,7 +305,7 @@ def mix_audio(self, audio_inputs, audio_temp_fpath):

# run subprocess
self.log.debug("Executing: {}".format(args))
openpype.api.run_subprocess(args, logger=self.log)
run_subprocess(args, logger=self.log)

os.remove(filters_tmp_filepath)

Expand Down
7 changes: 3 additions & 4 deletions openpype/plugins/publish/extract_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
import clique

import pyblish.api
import openpype.api

from openpype.lib import (
get_ffmpeg_tool_path,
get_ffprobe_streams,

path_to_subprocess_arg,
run_subprocess,

should_convert_for_ffmpeg,
convert_input_paths_for_ffmpeg,
Expand Down Expand Up @@ -350,9 +351,7 @@ def _render_output_definitions(
# run subprocess
self.log.debug("Executing: {}".format(subprcs_cmd))

openpype.api.run_subprocess(
subprcs_cmd, shell=True, logger=self.log
)
run_subprocess(subprcs_cmd, shell=True, logger=self.log)

# delete files added to fill gaps
if files_to_clean:
Expand Down
8 changes: 4 additions & 4 deletions openpype/plugins/publish/extract_scanline_exr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import shutil

import pyblish.api
import openpype.api
import openpype.lib

from openpype.lib import run_subprocess, get_oiio_tools_path


class ExtractScanlineExr(pyblish.api.InstancePlugin):
Expand Down Expand Up @@ -45,7 +45,7 @@ def process(self, instance):

stagingdir = os.path.normpath(repre.get("stagingDir"))

oiio_tool_path = openpype.lib.get_oiio_tools_path()
oiio_tool_path = get_oiio_tools_path()
if not os.path.exists(oiio_tool_path):
self.log.error(
"OIIO tool not found in {}".format(oiio_tool_path))
Expand All @@ -65,7 +65,7 @@ def process(self, instance):

subprocess_exr = " ".join(oiio_cmd)
self.log.info(f"running: {subprocess_exr}")
openpype.api.run_subprocess(subprocess_exr, logger=self.log)
run_subprocess(subprocess_exr, logger=self.log)

# raise error if there is no ouptput
if not os.path.exists(os.path.join(stagingdir, original_name)):
Expand Down
2 changes: 1 addition & 1 deletion openpype/tools/settings/local_settings/mongo_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from Qt import QtWidgets
from pymongo.errors import ServerSelectionTimeoutError

from openpype.api import change_openpype_mongo_url
from openpype.lib import change_openpype_mongo_url
from openpype.tools.utils import PlaceholderLineEdit


Expand Down