Ejemplo n.º 1
0
Archivo: db.py Proyecto: jt1/indico
    so it's usage is easier and more transparent to the rest of the application
"""
import os
import sys
import threading
import pkg_resources
from contextlib import contextmanager

from ZEO.ClientStorage import ClientStorage
from ZODB.DB import DB
import transaction
import ZODB

from MaKaC.consoleScripts.installBase import getIndicoInstallMode

skip_imports = getIndicoInstallMode()


if not skip_imports:
    from MaKaC.common.logger import Logger


class MaKaCDB(DB):
    """Subclass of ZODB.DB necessary to remove possible existing dependencies
        from IC"""

    def classFactory(self, connection, modulename, globalname):
        if globalname == "PersistentMapping":
            modulename = "persistent.mapping"
        elif globalname == "PersistentList":
            modulename = "persistent.list"
Ejemplo n.º 2
0
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

# We load Configuration from setup.py which in turns loads this (although it
# is not needed). If we still don't have the dependencies installed this will
# crash and that's why we selectively install them or not.
from MaKaC.consoleScripts.installBase import getIndicoInstallMode
skip_imports = getIndicoInstallMode()

if not skip_imports:

    __all__ = ['HelperMaKaCInfo', 'URL', 'Config']

    from indico.core.config import Config
    from MaKaC.common.info import HelperMaKaCInfo
    from MaKaC.common.url import URL