mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
use new functions in codebase
This commit is contained in:
parent
9ff4ec856b
commit
0e95019995
5 changed files with 15 additions and 24 deletions
|
|
@ -17,7 +17,11 @@ import ayon_api
|
|||
from semver import VersionInfo
|
||||
|
||||
from ayon_core import AYON_CORE_ROOT
|
||||
from ayon_core.lib import Logger, is_dev_mode_enabled
|
||||
from ayon_core.lib import (
|
||||
Logger,
|
||||
is_dev_mode_enabled,
|
||||
get_launcher_storage_dir,
|
||||
)
|
||||
from ayon_core.settings import get_studio_settings
|
||||
|
||||
from .interfaces import (
|
||||
|
|
@ -327,10 +331,7 @@ def _load_ayon_addons(openpype_modules, modules_key, log):
|
|||
|
||||
addons_dir = os.environ.get("AYON_ADDONS_DIR")
|
||||
if not addons_dir:
|
||||
addons_dir = os.path.join(
|
||||
appdirs.user_data_dir("AYON", "Ynput"),
|
||||
"addons"
|
||||
)
|
||||
addons_dir = get_launcher_storage_dir("addons")
|
||||
|
||||
dev_mode_enabled = is_dev_mode_enabled()
|
||||
dev_addons_info = {}
|
||||
|
|
|
|||
|
|
@ -519,20 +519,14 @@ class JSONSettingRegistry(ASettingRegistry):
|
|||
class AYONSettingsRegistry(JSONSettingRegistry):
|
||||
"""Class handling AYON general settings registry.
|
||||
|
||||
Attributes:
|
||||
vendor (str): Name used for path construction.
|
||||
product (str): Additional name used for path construction.
|
||||
|
||||
Args:
|
||||
name (Optional[str]): Name of the registry.
|
||||
"""
|
||||
|
||||
def __init__(self, name=None):
|
||||
self.vendor = "Ynput"
|
||||
self.product = "AYON"
|
||||
if not name:
|
||||
name = "AYON_settings"
|
||||
path = appdirs.user_data_dir(self.product, self.vendor)
|
||||
path = get_launcher_storage_dir()
|
||||
super(AYONSettingsRegistry, self).__init__(name, path)
|
||||
|
||||
|
||||
|
|
@ -578,7 +572,7 @@ def get_local_site_id():
|
|||
if site_id:
|
||||
return site_id
|
||||
|
||||
site_id_path = get_ayon_appdirs("site_id")
|
||||
site_id_path = get_launcher_local_dir("site_id")
|
||||
if os.path.exists(site_id_path):
|
||||
with open(site_id_path, "r") as stream:
|
||||
site_id = stream.read()
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import collections
|
|||
|
||||
import ayon_api
|
||||
|
||||
from ayon_core.lib.local_settings import get_ayon_appdirs
|
||||
from ayon_core.lib.local_settings import get_launcher_local_dir
|
||||
|
||||
|
||||
FileInfo = collections.namedtuple(
|
||||
|
|
@ -54,7 +54,7 @@ class ThumbnailsCache:
|
|||
"""
|
||||
|
||||
if self._thumbnails_dir is None:
|
||||
self._thumbnails_dir = get_ayon_appdirs("thumbnails")
|
||||
self._thumbnails_dir = get_launcher_local_dir("thumbnails")
|
||||
return self._thumbnails_dir
|
||||
|
||||
thumbnails_dir = property(get_thumbnails_dir)
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ import os
|
|||
import json
|
||||
import uuid
|
||||
|
||||
import appdirs
|
||||
import arrow
|
||||
from qtpy import QtWidgets, QtCore, QtGui
|
||||
|
||||
from ayon_core import style
|
||||
from ayon_core.lib import get_launcher_local_dir
|
||||
from ayon_core.resources import get_ayon_icon_filepath
|
||||
from ayon_core.tools import resources
|
||||
from ayon_core.tools.utils import (
|
||||
|
|
@ -35,12 +35,8 @@ def get_reports_dir():
|
|||
str: Path to directory where reports are stored.
|
||||
"""
|
||||
|
||||
report_dir = os.path.join(
|
||||
appdirs.user_data_dir("AYON", "Ynput"),
|
||||
"publish_report_viewer"
|
||||
)
|
||||
if not os.path.exists(report_dir):
|
||||
os.makedirs(report_dir)
|
||||
report_dir = get_launcher_local_dir("publish_report_viewer")
|
||||
os.makedirs(report_dir, exist_ok=True)
|
||||
return report_dir
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ from ayon_core.lib import (
|
|||
run_detached_process,
|
||||
get_ayon_username,
|
||||
)
|
||||
from ayon_core.lib.local_settings import get_ayon_appdirs
|
||||
from ayon_core.lib.local_settings import get_launcher_local_dir
|
||||
|
||||
|
||||
class TrayState:
|
||||
|
|
@ -146,7 +146,7 @@ def get_tray_storage_dir() -> str:
|
|||
str: Tray storage directory where metadata files are stored.
|
||||
|
||||
"""
|
||||
return get_ayon_appdirs("tray")
|
||||
return get_launcher_local_dir("tray")
|
||||
|
||||
|
||||
def _get_tray_info_filepath(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue