mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
moved get_avalon_database and set_io_database to deprecated
This commit is contained in:
parent
acb134c208
commit
15c03de485
3 changed files with 35 additions and 11 deletions
|
|
@ -1,5 +1,10 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""Pype lib module."""
|
"""Pype lib module."""
|
||||||
|
|
||||||
|
from .deprecated import (
|
||||||
|
get_avalon_database,
|
||||||
|
set_io_database
|
||||||
|
)
|
||||||
from .lib_old import (
|
from .lib_old import (
|
||||||
_subprocess,
|
_subprocess,
|
||||||
get_paths_from_environ,
|
get_paths_from_environ,
|
||||||
|
|
@ -19,8 +24,6 @@ from .lib_old import (
|
||||||
get_project,
|
get_project,
|
||||||
get_version_from_path,
|
get_version_from_path,
|
||||||
get_last_version_from_path,
|
get_last_version_from_path,
|
||||||
get_avalon_database,
|
|
||||||
set_io_database,
|
|
||||||
get_subsets,
|
get_subsets,
|
||||||
CustomNone,
|
CustomNone,
|
||||||
get_linked_assets,
|
get_linked_assets,
|
||||||
|
|
@ -38,6 +41,9 @@ from .hooks import PypeHook, execute_hook
|
||||||
from .plugin_tools import filter_pyblish_plugins
|
from .plugin_tools import filter_pyblish_plugins
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
"get_avalon_database",
|
||||||
|
"set_io_database",
|
||||||
|
|
||||||
"PypeHook",
|
"PypeHook",
|
||||||
"execute_hook",
|
"execute_hook",
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
from avalon import io
|
||||||
|
|
||||||
|
|
||||||
|
def get_avalon_database():
|
||||||
|
"""Mongo database used in avalon's io.
|
||||||
|
|
||||||
|
* Function is not used in pype 3.0 where was replaced with usage of
|
||||||
|
AvalonMongoDB.
|
||||||
|
"""
|
||||||
|
if io._database is None:
|
||||||
|
set_io_database()
|
||||||
|
return io._database
|
||||||
|
|
||||||
|
|
||||||
|
def set_io_database():
|
||||||
|
"""Set avalon's io context with environemnts.
|
||||||
|
|
||||||
|
* Function is not used in pype 3.0 where was replaced with usage of
|
||||||
|
AvalonMongoDB.
|
||||||
|
"""
|
||||||
|
required_keys = ["AVALON_PROJECT", "AVALON_ASSET", "AVALON_SILO"]
|
||||||
|
for key in required_keys:
|
||||||
|
os.environ[key] = os.environ.get(key, "")
|
||||||
|
io.install()
|
||||||
|
|
@ -13,6 +13,7 @@ import getpass
|
||||||
import acre
|
import acre
|
||||||
import platform
|
import platform
|
||||||
from pype.lib.hooks import execute_hook
|
from pype.lib.hooks import execute_hook
|
||||||
|
from .deprecated import get_avalon_database
|
||||||
|
|
||||||
from avalon import io, pipeline
|
from avalon import io, pipeline
|
||||||
import avalon.api
|
import avalon.api
|
||||||
|
|
@ -535,17 +536,8 @@ def get_last_version_from_path(path_dir, filter):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def get_avalon_database():
|
|
||||||
if io._database is None:
|
|
||||||
set_io_database()
|
|
||||||
return io._database
|
|
||||||
|
|
||||||
|
|
||||||
def set_io_database():
|
|
||||||
required_keys = ["AVALON_PROJECT", "AVALON_ASSET", "AVALON_SILO"]
|
|
||||||
for key in required_keys:
|
|
||||||
os.environ[key] = os.environ.get(key, "")
|
|
||||||
io.install()
|
|
||||||
|
|
||||||
|
|
||||||
def get_subsets(asset_name,
|
def get_subsets(asset_name,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue