示例#1
0
    def configure(self, config_):
        if config_.get('ckanext.xloader.ignore_hash') in [
                'True', 'TRUE', '1', True, 1
        ]:
            self.ignore_hash = True
        else:
            self.ignore_hash = False

        for config_option in ('ckan.site_url', ):
            if not config_.get(config_option):
                raise Exception(
                    'Config option `{0}` must be set to use ckanext-xloader.'.
                    format(config_option))

        if p.toolkit.check_ckan_version(max_version='2.7.99'):
            # populate_full_text_trigger() needs to be defined, and this was
            # introduced in CKAN 2.8 when you installed datastore e.g.:
            #     paster datastore set-permissions
            # However before CKAN 2.8 we need to check the user has defined
            # this function manually.
            connection = get_write_engine().connect()
            if not fulltext_function_exists(connection):
                raise Exception('populate_full_text_trigger is not defined. '
                                'See ckanext-xloader\'s README.rst for more '
                                'details.')
示例#2
0
    def configure(self, config):
        self.config = config

        xloader_formats = config.get('ckanext.xloader.formats', '').lower()
        self.xloader_formats = xloader_formats.lower().split(
        ) or DEFAULT_FORMATS

        for config_option in ('ckan.site_url', ):
            if not config.get(config_option):
                raise Exception(
                    'Config option `{0}` must be set to use ckanext-xloader.'.
                    format(config_option))

        connection = get_write_engine().connect()
        if not fulltext_function_exists(connection):
            raise Exception('populate_full_text_trigger is not defined. See '
                            'ckanext-xloader\'s README.rst for more details.')
示例#3
0
    def configure(self, config_):
        if config_.get('ckanext.xloader.ignore_hash') in [
                'True', 'TRUE', '1', True, 1
        ]:
            self.ignore_hash = True
        else:
            self.ignore_hash = False

        for config_option in ('ckan.site_url', ):
            if not config_.get(config_option):
                raise Exception(
                    'Config option `{0}` must be set to use ckanext-xloader.'.
                    format(config_option))

        connection = get_write_engine().connect()
        if not fulltext_function_exists(connection):
            raise Exception('populate_full_text_trigger is not defined. See '
                            'ckanext-xloader\'s README.rst for more details.')