mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Remove unused code and add sugestions
This commit is contained in:
parent
8a06a4afc1
commit
0163eae3fa
3 changed files with 2 additions and 35 deletions
|
|
@ -1,9 +0,0 @@
|
|||
from openpype.lib import PostLaunchHook
|
||||
|
||||
|
||||
class PostShotgridHook(PostLaunchHook):
|
||||
order = None
|
||||
|
||||
def execute(self, *args, **kwargs):
|
||||
print(args, kwargs)
|
||||
pass
|
||||
|
|
@ -1,24 +1,11 @@
|
|||
import os
|
||||
|
||||
from pymongo import MongoClient
|
||||
from openpype.api import get_system_settings, get_project_settings
|
||||
from openpype.modules.shotgrid.lib.const import MODULE_NAME
|
||||
from openpype.modules.shotgrid.lib.tools import memoize
|
||||
|
||||
|
||||
def get_project_list():
|
||||
mongo_url = os.getenv("OPENPYPE_MONGO")
|
||||
client = MongoClient(mongo_url)
|
||||
db = client['avalon']
|
||||
return db.list_collection_names()
|
||||
|
||||
|
||||
@memoize
|
||||
def get_shotgrid_project_settings(project):
|
||||
return get_project_settings(project).get(MODULE_NAME, {})
|
||||
|
||||
|
||||
@memoize
|
||||
def get_shotgrid_settings():
|
||||
return get_system_settings().get("modules", {}).get(MODULE_NAME, {})
|
||||
|
||||
|
|
@ -29,13 +16,3 @@ def get_shotgrid_servers():
|
|||
|
||||
def get_leecher_backend_url():
|
||||
return get_shotgrid_settings().get("leecher_backend_url")
|
||||
|
||||
|
||||
def filter_projects_by_login():
|
||||
return bool(get_shotgrid_settings().get("filter_projects_by_login", False))
|
||||
|
||||
|
||||
def get_shotgrid_event_mongo_info():
|
||||
database_name = os.environ["OPENPYPE_DATABASE_NAME"]
|
||||
collection_name = "shotgrid_events"
|
||||
return database_name, collection_name
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
|
||||
import pyblish.api
|
||||
from pymongo import MongoClient
|
||||
from openpype.lib.mongo import OpenPypeMongoConnection
|
||||
|
||||
from openpype.modules.shotgrid.lib.settings import (
|
||||
get_shotgrid_project_settings,
|
||||
|
|
@ -63,8 +63,7 @@ class CollectShotgridEntities(pyblish.api.ContextPlugin):
|
|||
|
||||
|
||||
def _get_shotgrid_collection(project):
|
||||
mongo_url = os.getenv("OPENPYPE_MONGO")
|
||||
client = MongoClient(mongo_url)
|
||||
client = OpenPypeMongoConnection.get_mongo_client()
|
||||
return client.get_database("shotgrid_openpype").get_collection(project)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue