<commit_before># -*- coding: utf8 -*-
"""

"""
from controller import *
logger = logging.getLogger('jsoncatalog')


class JsoncatalogPlugin(plugins.SingletonPlugin):
    """
    Implementación del plugin JSON Catalog plugin
    """
    plugins.implements(plugins.interfaces.IConfigurer)
    plugins.implements(plugins.interfaces.IRoutes, inherit=True)

    def update_config(self, config_):
        """

        Args:
            - config_:
        Returns:
            - None
        """
        JsoncatalogPlugin.plugin_is_enable = config_.get("ckanext.json_catalog.is_active", "True") == 'True'
        JsoncatalogPlugin.catalog_url = config_.get("ckanext.json_catalog.uri", "/catalog.json")
        JsoncatalogPlugin.mapper_version = config_.get("ckanext.json_catalog.mapper_version", "1.0")
        JsoncatalogPlugin.theme_taxonomy_url = config_.get("ckanext.json_catalog.uri", "/themeTaxonomy.json")
        plugin_folder = path.dirname(__file__)
        JsoncatalogPlugin.mappers_folder = path.join(plugin_folder, 'mappers')
        toolkit.add_template_directory(config_, 'templates')

    def before_map(self, m):
        return m

    def after_map(self, m):
        if JsoncatalogPlugin.plugin_is_enable:
            m.connect('write_catalog',
                      JsoncatalogPlugin.catalog_url,
                      controller='ckanext.jsoncatalog.plugin:JsonCatalogController',
                      action='generate_catalog')
            m.connect('write_theme_taxonomy',
                      JsoncatalogPlugin.theme_taxonomy_url,
                      controller='ckanext.jsoncatalog.plugin:JsonCatalogController',
                      action='generate_theme_taxonomy')
            return m
<commit_msg>Documentaciones minimas<commit_after># -*- coding: utf8 -*-
"""

"""
from controller import *
logger = logging.getLogger('jsoncatalog')


class JsoncatalogPlugin(plugins.SingletonPlugin):
    """
    Implementación del plugin JSON Catalog plugin
    """
    plugins.implements(plugins.interfaces.IConfigurer)
    plugins.implements(plugins.interfaces.IRoutes, inherit=True)

    def update_config(self, config_):
        """
        Actualizar configuraciones, agregando las configuraciones del plugin.

        Args:
            - config_:
        Returns:
            - None
        """
        JsoncatalogPlugin.plugin_is_enable = config_.get("ckanext.json_catalog.is_active", "True") == 'True'
        JsoncatalogPlugin.catalog_url = config_.get("ckanext.json_catalog.uri", "/catalog.json")
        JsoncatalogPlugin.mapper = config_.get("ckanext.json_catalog.mapper_version", "default")
        JsoncatalogPlugin.version = config_.get("ckanext.json_catalog.mapper_version", "1.0")
        JsoncatalogPlugin.theme_taxonomy_url = config_.get("ckanext.json_catalog.uri", "/themeTaxonomy.json")
        plugin_folder = path.dirname(__file__)
        JsoncatalogPlugin.mappers_folder = path.join(plugin_folder, 'mappers')
        toolkit.add_template_directory(config_, 'templates')

    def before_map(self, m):
        return m

    def after_map(self, m):
        if JsoncatalogPlugin.plugin_is_enable:
            m.connect('write_catalog',
                      JsoncatalogPlugin.catalog_url,
                      controller='ckanext.jsoncatalog.plugin:JsonCatalogController',
                      action='generate_catalog')
            m.connect('write_theme_taxonomy',
                      JsoncatalogPlugin.theme_taxonomy_url,
                      controller='ckanext.jsoncatalog.plugin:JsonCatalogController',
                      action='generate_theme_taxonomy')
            return m

{'fraction_non_alphanumeric': 0.10436223081170624, 'fraction_numerical': 0.0016565433462175593, 'mean_word_length': 2.7350515463917526, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6692501', 'n_tokens_mistral': 993, 'n_tokens_neox': 974, 'n_words': 143}