コード例 #1
0
ファイル: core.py プロジェクト: ibid/ibid
    def __init__(self, check_schema_versions=True, sqlite_synchronous=True):
        self.log = logging.getLogger('core.databases')
        self.sqlite_synchronous = sqlite_synchronous
        for database in ibid.config.databases.keys():
            self.load(database)

        if check_schema_versions:
            try:
                schema_version_check(self['ibid'])
            except SchemaVersionException, e:
                self.log.error(u'Tables out of date: %s. Run "ibid-db --upgrade"', e.message)
                raise
コード例 #2
0
ファイル: core.py プロジェクト: oguya/ibid
    def __init__(self, check_schema_versions=True, sqlite_synchronous=True):
        self.log = logging.getLogger('core.databases')
        self.sqlite_synchronous = sqlite_synchronous
        for database in ibid.config.databases.keys():
            self.load(database)

        if check_schema_versions:
            try:
                schema_version_check(self['ibid'])
            except SchemaVersionException, e:
                self.log.error(u'Tables out of date: %s. Run "ibid-db --upgrade"', e.message)
                raise
コード例 #3
0
                     ((load_all or klass.autoload) and not noload_all))):
                    self.log.debug("Loading Processor: %s.%s", name,
                                   klass.__name__)
                    try:
                        ibid.processors.append(klass(name))
                    except Exception, e:
                        self.log.exception(
                            u"Couldn't instantiate %s "
                            u"processor of %s plugin", classname, name)
                        continue
                else:
                    self.log.debug("Skipping Processor: %s.%s", name,
                                   klass.__name__)

        try:
            schema_version_check(ibid.databases['ibid'])
        except SchemaVersionException, e:
            self.log.error(u'Tables out of date: %s. Run "ibid-db --upgrade"',
                           e.message)

        ibid.processors.sort(key=lambda x: x.priority)

        self.log.debug(u"Loaded %s plugin", name)
        return True

    def unload_processor(self, name):
        processors = []

        for processor in ibid.processors:
            if processor.name == name:
                processors.append(processor)
コード例 #4
0
ファイル: core.py プロジェクト: ibid/ibid
                        or ((load_all or klass.autoload) and not noload_all))):
                    self.log.debug("Loading Processor: %s.%s", name,
                                   klass.__name__)
                    try:
                        ibid.processors.append(klass(name))
                    except Exception, e:
                        self.log.exception(u"Couldn't instantiate %s "
                                           u"processor of %s plugin",
                                           classname, name)
                        continue
                else:
                    self.log.debug("Skipping Processor: %s.%s", name,
                                   klass.__name__)

        try:
            schema_version_check(ibid.databases['ibid'])
        except SchemaVersionException, e:
            self.log.error(u'Tables out of date: %s. Run "ibid-db --upgrade"',
                           e.message)

        ibid.processors.sort(key=lambda x: x.priority)

        self.log.debug(u"Loaded %s plugin", name)
        return True

    def unload_processor(self, name):
        processors = []

        for processor in ibid.processors:
            if processor.name == name:
                processors.append(processor)