Пример #1
0
def create_instance(
        settings,
        corparch: AbstractCorporaArchive,
        db: KeyValueStorage,
        integ_db: IntegrationDatabase) -> MysqlLiveAttributes:
    """
    creates an instance of the plugin

    arguments:
    corparch -- corparch plugin
    """

    la_settings = settings.get('plugins', 'live_attributes')
    if integ_db.is_active:
        logging.getLogger(__name__).info(
            f'mysql_live_attributes uses integration_db[{integ_db.info}]')
        return MysqlLiveAttributes(
            corparch=corparch,
            db=db,
            integ_db=integ_db,
            max_attr_list_size=settings.get_int(
                'global', 'max_attr_list_size'),
            empty_val_placeholder=settings.get(
                'corpora', 'empty_attr_value_placeholder'),
            max_attr_visible_chars=int(la_settings.get('max_attr_visible_chars', 20)))
    else:
        raise PluginCompatibilityException(
            'mysql_live_attributes works only with integration_db enabled')
Пример #2
0
 def rollback(self):
     raise PluginCompatibilityException(self._err_msg())
Пример #3
0
 def commit(self):
     raise PluginCompatibilityException(self._err_msg())
Пример #4
0
 def start_transaction(self, isolation_level=None):
     raise PluginCompatibilityException(self._err_msg())
Пример #5
0
 def executemany(self, sql, args_rows):
     raise PluginCompatibilityException(self._err_msg())
Пример #6
0
 def cursor(self, dictionary=True, buffered=False) -> R:
     raise PluginCompatibilityException(self._err_msg())
Пример #7
0
 def connection(self) -> N:
     raise PluginCompatibilityException(self._err_msg())