mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
changin ftrack_api imports to run from pype.vendor for now
This commit is contained in:
parent
dce33a9370
commit
bb39f87f81
7 changed files with 55 additions and 58 deletions
|
|
@ -2,7 +2,7 @@ import sys
|
|||
import argparse
|
||||
import logging
|
||||
|
||||
import ftrack_api
|
||||
from pype.vendor import ftrack_api
|
||||
from pype.ftrack import BaseAction
|
||||
from pype.clockify import ClockifyAPI
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import sys
|
|||
import argparse
|
||||
import logging
|
||||
import json
|
||||
import ftrack_api
|
||||
from pype.vendor import ftrack_api
|
||||
from pype.ftrack import BaseAction, MissingPermision
|
||||
from pype.clockify import ClockifyAPI
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,14 @@ import sys
|
|||
import logging
|
||||
import argparse
|
||||
import re
|
||||
import json
|
||||
# import json
|
||||
|
||||
from pype.vendor import ftrack_api
|
||||
from pype.ftrack import BaseAction
|
||||
from pype import api as pype, lib as pypelib
|
||||
# from pype import api as pype, lib as pypelib
|
||||
from avalon import lib as avalonlib
|
||||
from avalon.tools.libraryloader.io_nonsingleton import DbConnector
|
||||
from pypeapp import config, Anatomy
|
||||
|
||||
|
||||
class CreateFolders(BaseAction):
|
||||
|
|
@ -130,12 +131,12 @@ class CreateFolders(BaseAction):
|
|||
template_publish = av_project['config']['template']['publish']
|
||||
self.db.uninstall()
|
||||
except Exception:
|
||||
anatomy = pype.Anatomy
|
||||
template_work = anatomy.avalon.work
|
||||
template_publish = anatomy.avalon.publish
|
||||
templates = Anatomy().templates
|
||||
template_work = templates["avalon"]["work"]
|
||||
template_publish = templates["avalon"]["publish"]
|
||||
|
||||
collected_paths = []
|
||||
presets = self.get_presets()
|
||||
presets = config.get_presets()['tools']['sw_folders']
|
||||
for entity in all_entities:
|
||||
if entity.entity_type.lower() == 'project':
|
||||
continue
|
||||
|
|
@ -238,16 +239,16 @@ class CreateFolders(BaseAction):
|
|||
output.extend(self.get_notask_children(child))
|
||||
return output
|
||||
|
||||
def get_presets(self):
|
||||
fpath_items = [pypelib.get_presets_path(), 'tools', 'sw_folders.json']
|
||||
filepath = os.path.normpath(os.path.sep.join(fpath_items))
|
||||
presets = dict()
|
||||
try:
|
||||
with open(filepath) as data_file:
|
||||
presets = json.load(data_file)
|
||||
except Exception as e:
|
||||
self.log.warning('Wasn\'t able to load presets')
|
||||
return dict(presets)
|
||||
# def get_presets(self):
|
||||
# fpath_items = [pypelib.get_presets_path(), 'tools', 'sw_folders.json']
|
||||
# filepath = os.path.normpath(os.path.sep.join(fpath_items))
|
||||
# presets = dict()
|
||||
# try:
|
||||
# with open(filepath) as data_file:
|
||||
# presets = json.load(data_file)
|
||||
# except Exception as e:
|
||||
# self.log.warning('Wasn\'t able to load presets')
|
||||
# return dict(presets)
|
||||
|
||||
def template_format(self, template, data):
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,10 @@ import sys
|
|||
import re
|
||||
import argparse
|
||||
import logging
|
||||
import json
|
||||
|
||||
import ftrack_api
|
||||
from pype import lib as pypelib
|
||||
from pype.vendor import ftrack_api
|
||||
from pype.ftrack import BaseAction
|
||||
from pypeapp import config
|
||||
|
||||
|
||||
class CreateProjectFolders(BaseAction):
|
||||
|
|
@ -43,7 +42,7 @@ class CreateProjectFolders(BaseAction):
|
|||
else:
|
||||
project = entity['project']
|
||||
|
||||
presets = self.load_presets()
|
||||
presets = config.load_presets()['tools']['project_folder_structure']
|
||||
try:
|
||||
# Get paths based on presets
|
||||
basic_paths = self.get_path_items(presets)
|
||||
|
|
@ -143,27 +142,27 @@ class CreateProjectFolders(BaseAction):
|
|||
self.session.commit()
|
||||
return new_ent
|
||||
|
||||
def load_presets(self):
|
||||
preset_items = [
|
||||
pypelib.get_presets_path(),
|
||||
'tools',
|
||||
'project_folder_structure.json'
|
||||
]
|
||||
filepath = os.path.sep.join(preset_items)
|
||||
|
||||
# Load folder structure template from presets
|
||||
presets = dict()
|
||||
try:
|
||||
with open(filepath) as data_file:
|
||||
presets = json.load(data_file)
|
||||
except Exception as e:
|
||||
msg = 'Unable to load Folder structure preset'
|
||||
self.log.warning(msg)
|
||||
return {
|
||||
'success': False,
|
||||
'message': msg
|
||||
}
|
||||
return presets
|
||||
# def load_presets(self):
|
||||
# preset_items = [
|
||||
# pypelib.get_presets_path(),
|
||||
# 'tools',
|
||||
# 'project_folder_structure.json'
|
||||
# ]
|
||||
# filepath = os.path.sep.join(preset_items)
|
||||
#
|
||||
# # Load folder structure template from presets
|
||||
# presets = dict()
|
||||
# try:
|
||||
# with open(filepath) as data_file:
|
||||
# presets = json.load(data_file)
|
||||
# except Exception as e:
|
||||
# msg = 'Unable to load Folder structure preset'
|
||||
# self.log.warning(msg)
|
||||
# return {
|
||||
# 'success': False,
|
||||
# 'message': msg
|
||||
# }
|
||||
# return presets
|
||||
|
||||
def get_path_items(self, in_dict):
|
||||
output = []
|
||||
|
|
|
|||
|
|
@ -1,15 +1,12 @@
|
|||
import os
|
||||
import sys
|
||||
import re
|
||||
import json
|
||||
import logging
|
||||
import subprocess
|
||||
from operator import itemgetter
|
||||
import ftrack_api
|
||||
from pype.vendor import ftrack_api
|
||||
from pype.ftrack import BaseAction
|
||||
from pypeapp import Logger
|
||||
from pype import lib as pypelib
|
||||
|
||||
from pypeapp import Logger, config
|
||||
|
||||
log = Logger().get_logger(__name__)
|
||||
|
||||
|
|
@ -28,7 +25,8 @@ class DJVViewAction(BaseAction):
|
|||
self.djv_path = None
|
||||
self.config_data = None
|
||||
|
||||
self.load_config_data()
|
||||
# self.load_config_data()
|
||||
self.config_data = config.get_presets()['djv_view']['config']
|
||||
self.set_djv_path()
|
||||
|
||||
if self.djv_path is None:
|
||||
|
|
@ -57,7 +55,8 @@ class DJVViewAction(BaseAction):
|
|||
return False
|
||||
|
||||
def load_config_data(self):
|
||||
path_items = [pypelib.get_presets_path(), 'djv_view', 'config.json']
|
||||
# path_items = [pypelib.get_presets_path(), 'djv_view', 'config.json']
|
||||
path_items = config.get_presets()['djv_view']['config']
|
||||
filepath = os.path.sep.join(path_items)
|
||||
|
||||
data = dict()
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
import os
|
||||
import sys
|
||||
import argparse
|
||||
import logging
|
||||
import json
|
||||
import ftrack_api
|
||||
from pype.vendor import ftrack_api
|
||||
|
||||
from pype.ftrack import BaseAction
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@ import os
|
|||
import sys
|
||||
import json
|
||||
import subprocess
|
||||
import ftrack_api
|
||||
from pype.vendor import ftrack_api
|
||||
import logging
|
||||
import operator
|
||||
import re
|
||||
from pype import lib as pypelib
|
||||
from pypeapp import Logger
|
||||
from pypeapp import Logger, config
|
||||
|
||||
log = Logger().get_logger(__name__)
|
||||
|
||||
|
|
@ -40,7 +39,8 @@ class RVAction(BaseAction):
|
|||
)
|
||||
else:
|
||||
# if not, fallback to config file location
|
||||
self.load_config_data()
|
||||
# self.load_config_data()
|
||||
self.config_data = config.get_presets()['djv_view']['config']
|
||||
self.set_rv_path()
|
||||
|
||||
if self.rv_path is None:
|
||||
|
|
@ -62,7 +62,7 @@ class RVAction(BaseAction):
|
|||
return False
|
||||
|
||||
def load_config_data(self):
|
||||
path_items = [pypelib.get_presets_path(), 'rv', 'config.json']
|
||||
path_items = config.get_presets['rv']['config.json']
|
||||
filepath = os.path.sep.join(path_items)
|
||||
|
||||
data = dict()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue