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

Commit

Permalink
everywhere where io_nonsingleton was used is used AvalonmongoDB now
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Sep 8, 2020
1 parent 427a610 commit c684232
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 24 deletions.
2 changes: 0 additions & 2 deletions pype/modules/adobe_communicator/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from .io_nonsingleton import DbConnector
from .rest_api import AdobeRestApi, PUBLISH_PATHS

__all__ = [
"PUBLISH_PATHS",
"DbConnector",
"AdobeRestApi"
]
4 changes: 2 additions & 2 deletions pype/modules/adobe_communicator/lib/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
import copy
from pype.modules.rest_api import RestApi, route, abort, CallbackResult
from .io_nonsingleton import DbConnector
from avalon.api import AvalonMongoDB
from pype.api import config, execute, Logger

log = Logger().get_logger("AdobeCommunicator")
Expand All @@ -14,7 +14,7 @@


class AdobeRestApi(RestApi):
dbcon = DbConnector()
dbcon = AvalonMongoDB()

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down
4 changes: 2 additions & 2 deletions pype/modules/avalon_apps/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import bson
import bson.json_util
from pype.modules.rest_api import RestApi, abort, CallbackResult
from pype.modules.ftrack.lib.io_nonsingleton import DbConnector
from avalon.api import AvalonMongoDB


class AvalonRestApi(RestApi):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.dbcon = DbConnector()
self.dbcon = AvalonMongoDB()
self.dbcon.install()

@RestApi.route("/projects/<project_name>", url_prefix="/avalon", methods="GET")
Expand Down
4 changes: 2 additions & 2 deletions pype/modules/ftrack/actions/action_delete_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from bson.objectid import ObjectId
from pype.modules.ftrack.lib import BaseAction, statics_icon
from pype.modules.ftrack.lib.io_nonsingleton import DbConnector
from avalon.api import AvalonMongoDB


class DeleteAssetSubset(BaseAction):
Expand All @@ -21,7 +21,7 @@ class DeleteAssetSubset(BaseAction):
#: roles that are allowed to register this action
role_list = ["Pypeclub", "Administrator", "Project Manager"]
#: Db connection
dbcon = DbConnector()
dbcon = AvalonMongoDB()

splitter = {"type": "label", "value": "---"}
action_data_by_id = {}
Expand Down
4 changes: 2 additions & 2 deletions pype/modules/ftrack/actions/action_delete_old_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pymongo import UpdateOne

from pype.modules.ftrack.lib import BaseAction, statics_icon
from pype.modules.ftrack.lib.io_nonsingleton import DbConnector
from avalon.api import AvalonMongoDB
from pype.api import Anatomy

import avalon.pipeline
Expand All @@ -24,7 +24,7 @@ class DeleteOldVersions(BaseAction):
role_list = ["Pypeclub", "Project Manager", "Administrator"]
icon = statics_icon("ftrack", "action_icons", "PypeAdmin.svg")

dbcon = DbConnector()
dbcon = AvalonMongoDB()

inteface_title = "Choose your preferences"
splitter_item = {"type": "label", "value": "---"}
Expand Down
4 changes: 2 additions & 2 deletions pype/modules/ftrack/actions/action_delivery.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from pype.api import Anatomy, config
from pype.modules.ftrack.lib import BaseAction, statics_icon
from pype.modules.ftrack.lib.avalon_sync import CUST_ATTR_ID_KEY
from pype.modules.ftrack.lib.io_nonsingleton import DbConnector
from avalon.api import AvalonMongoDB


class Delivery(BaseAction):
Expand All @@ -24,7 +24,7 @@ class Delivery(BaseAction):
role_list = ["Pypeclub", "Administrator", "Project manager"]
icon = statics_icon("ftrack", "action_icons", "Delivery.svg")

db_con = DbConnector()
db_con = AvalonMongoDB()

def discover(self, session, entities, event):
for entity in entities:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from bson.objectid import ObjectId
from pype.modules.ftrack.lib import BaseAction, statics_icon
from pype.api import Anatomy
from pype.modules.ftrack.lib.io_nonsingleton import DbConnector
from avalon.api import AvalonMongoDB

from pype.modules.ftrack.lib.avalon_sync import CUST_ATTR_ID_KEY

Expand All @@ -25,7 +25,7 @@ class StoreThumbnailsToAvalon(BaseAction):
icon = statics_icon("ftrack", "action_icons", "PypeAdmin.svg")

thumbnail_key = "AVALON_THUMBNAIL_ROOT"
db_con = DbConnector()
db_con = AvalonMongoDB()

def discover(self, session, entities, event):
for entity in entities:
Expand Down
4 changes: 2 additions & 2 deletions pype/modules/ftrack/events/event_sync_to_avalon.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
import ftrack_api
from pype.modules.ftrack import BaseEvent

from pype.modules.ftrack.lib.io_nonsingleton import DbConnector
from avalon.api import AvalonMongoDB


class SyncToAvalonEvent(BaseEvent):

dbcon = DbConnector()
dbcon = AvalonMongoDB()

interest_entTypes = ["show", "task"]
ignore_ent_types = ["Milestone"]
Expand Down
4 changes: 2 additions & 2 deletions pype/modules/ftrack/events/event_user_assigment.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pype.modules.ftrack import BaseEvent
from pype.modules.ftrack.lib.avalon_sync import CUST_ATTR_ID_KEY
from pype.modules.ftrack.lib.io_nonsingleton import DbConnector
from avalon.api import AvalonMongoDB

from bson.objectid import ObjectId

Expand Down Expand Up @@ -37,7 +37,7 @@ class UserAssigmentEvent(BaseEvent):
3) path to publish files of task user was (de)assigned to
"""

db_con = DbConnector()
db_con = AvalonMongoDB()

def error(self, *err):
for e in err:
Expand Down
4 changes: 2 additions & 2 deletions pype/modules/ftrack/lib/avalon_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import collections
import copy

from pype.modules.ftrack.lib.io_nonsingleton import DbConnector
from avalon.api import AvalonMongoDB

import avalon
import avalon.api
Expand Down Expand Up @@ -240,7 +240,7 @@ def get_hierarchical_attributes(session, entity, attr_names, attr_defaults={}):


class SyncEntitiesFactory:
dbcon = DbConnector()
dbcon = AvalonMongoDB()

project_query = (
"select full_name, name, custom_attributes"
Expand Down
4 changes: 2 additions & 2 deletions pype/tools/launcher/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from Qt import QtWidgets, QtCore, QtGui
from avalon import style

from pype.modules.ftrack.lib.io_nonsingleton import DbConnector
from avalon.api import AvalonMongoDB
from pype.api import resources

from avalon.tools import lib as tools_lib
Expand Down Expand Up @@ -251,7 +251,7 @@ def __init__(self, parent=None):
self.log = logging.getLogger(
".".join([__name__, self.__class__.__name__])
)
self.dbcon = DbConnector()
self.dbcon = AvalonMongoDB()

self.setWindowTitle("Launcher")
self.setFocusPolicy(QtCore.Qt.StrongFocus)
Expand Down
4 changes: 2 additions & 2 deletions pype/tools/standalonepublish/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from bson.objectid import ObjectId
from Qt import QtWidgets, QtCore
from widgets import AssetWidget, FamilyWidget, ComponentsWidget, ShadowWidget
from avalon.tools.libraryloader.io_nonsingleton import DbConnector
from avalon.api import AvalonMongoDB


class Window(QtWidgets.QDialog):
Expand All @@ -10,7 +10,7 @@ class Window(QtWidgets.QDialog):
:param parent: Main widget that cares about all GUIs
:type parent: QtWidgets.QMainWindow
"""
_db = DbConnector()
_db = AvalonMongoDB()
_jobs = {}
valid_family = False
valid_components = False
Expand Down

0 comments on commit c684232

Please sign in to comment.