From 7843b51054db18b70fb3e6e957f9198fab2bcdbd Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 7 Jan 2017 22:02:25 +0100 Subject: [PATCH] Renamed static_tagcloud to static_tag_cloud. Fixes #199. --- .../README.md | 0 .../conf.py.sample | 2 +- .../static_tag_cloud.plugin} | 4 ++-- .../static_tag_cloud}/__init__.py | 22 +++++++++---------- .../static_tag_cloud}/engine.py | 0 5 files changed, 14 insertions(+), 14 deletions(-) rename v7/{static_tagcloud => static_tag_cloud}/README.md (100%) rename v7/{static_tagcloud => static_tag_cloud}/conf.py.sample (99%) rename v7/{static_tagcloud/static_tagcloud.plugin => static_tag_cloud/static_tag_cloud.plugin} (74%) rename v7/{static_tagcloud/static_tagcloud => static_tag_cloud/static_tag_cloud}/__init__.py (89%) rename v7/{static_tagcloud/static_tagcloud => static_tag_cloud/static_tag_cloud}/engine.py (100%) diff --git a/v7/static_tagcloud/README.md b/v7/static_tag_cloud/README.md similarity index 100% rename from v7/static_tagcloud/README.md rename to v7/static_tag_cloud/README.md diff --git a/v7/static_tagcloud/conf.py.sample b/v7/static_tag_cloud/conf.py.sample similarity index 99% rename from v7/static_tagcloud/conf.py.sample rename to v7/static_tag_cloud/conf.py.sample index a14dc846..48054844 100644 --- a/v7/static_tagcloud/conf.py.sample +++ b/v7/static_tag_cloud/conf.py.sample @@ -12,7 +12,7 @@ # - output/assets/css/tagcloud-LANG-large.css # - output/assets/css/catcloud-LANG-large.css -RENDER_STATIC_TAGCLOUDS = { +RENDER_STATIC_TAG_CLOUDS = { 'tag-small': { # Tag cloud's name (used as CSS class). {0} will be replaced # by the language. diff --git a/v7/static_tagcloud/static_tagcloud.plugin b/v7/static_tag_cloud/static_tag_cloud.plugin similarity index 74% rename from v7/static_tagcloud/static_tagcloud.plugin rename to v7/static_tag_cloud/static_tag_cloud.plugin index 58d95ec3..31e0611b 100644 --- a/v7/static_tagcloud/static_tagcloud.plugin +++ b/v7/static_tag_cloud/static_tag_cloud.plugin @@ -1,6 +1,6 @@ [Core] -Name = render_static_tagcloud -Module = static_tagcloud +Name = render_static_tag_cloud +Module = static_tag_cloud [Documentation] Author = Felix Fontein diff --git a/v7/static_tagcloud/static_tagcloud/__init__.py b/v7/static_tag_cloud/static_tag_cloud/__init__.py similarity index 89% rename from v7/static_tagcloud/static_tagcloud/__init__.py rename to v7/static_tag_cloud/static_tag_cloud/__init__.py index 64dc9004..90c89361 100644 --- a/v7/static_tagcloud/static_tagcloud/__init__.py +++ b/v7/static_tag_cloud/static_tag_cloud/__init__.py @@ -34,7 +34,7 @@ import natsort import os -_LOGGER = utils.get_logger('render_static_tagcloud', utils.STDERR_HANDLER) +_LOGGER = utils.get_logger('render_static_tag_cloud', utils.STDERR_HANDLER) _DEFAULT_CONFIG = { @@ -79,9 +79,9 @@ class StaticTagCloud(Task): """Render tag clouds for various taxonomies.""" - name = "render_static_tagcloud" + name = "render_static_tag_cloud" - def _render_tagcloud_html(self, fn, tags, level_weights, config, lang, url_type): + def _render_tag_cloud_html(self, fn, tags, level_weights, config, lang, url_type): """Create tag cloud HTML fragment.""" assert fn.startswith(self.site.config["OUTPUT_FOLDER"]) # Create fragment @@ -99,7 +99,7 @@ def _render_tagcloud_html(self, fn, tags, level_weights, config, lang, url_type) with open(fn, "wb") as html_file: html_file.write(html) - def _render_tagcloud_css(self, css_fn, tags, level_weights, config): + def _render_tag_cloud_css(self, css_fn, tags, level_weights, config): """Create tag cloud CSS.""" assert css_fn.startswith(self.site.config["OUTPUT_FOLDER"]) @@ -112,7 +112,7 @@ def _render_tagcloud_css(self, css_fn, tags, level_weights, config): with open(css_fn, "wb") as css_file: css_file.write(css.encode('utf-8')) - def _prepare_tagcloud(self, lang, config): + def _prepare_tag_cloud(self, lang, config): """Create tag cloud task.""" # Collect information fn = os.path.join(self.site.config['OUTPUT_FOLDER'], config['filename']) @@ -143,9 +143,9 @@ def _prepare_tagcloud(self, lang, config): 'basename': self.name, 'name': fn, 'targets': [fn], - 'actions': [(self._render_tagcloud_html, [fn, tags, level_weights, config, lang, url_type])], + 'actions': [(self._render_tag_cloud_html, [fn, tags, level_weights, config, lang, url_type])], 'clean': True, - 'uptodate': [utils.config_changed({1: tags, 2: level_weights}, 'nikola.plugins.render_tagcloud:tags'), utils.config_changed(config, 'nikola.plugins.render_tagcloud:config')] + 'uptodate': [utils.config_changed({1: tags, 2: level_weights}, 'nikola.plugins.render_tag_cloud:tags'), utils.config_changed(config, 'nikola.plugins.render_tag_cloud:config')] } yield utils.apply_filters(task, self.site.config["FILTERS"]) # Create task for CSS @@ -153,9 +153,9 @@ def _prepare_tagcloud(self, lang, config): 'basename': self.name, 'name': css_fn, 'targets': [css_fn], - 'actions': [(self._render_tagcloud_css, [css_fn, tags, level_weights, config])], + 'actions': [(self._render_tag_cloud_css, [css_fn, tags, level_weights, config])], 'clean': True, - 'uptodate': [utils.config_changed({1: tags, 2: level_weights}, 'nikola.plugins.render_tagcloud:tags'), utils.config_changed(config, 'nikola.plugins.render_tagcloud:config')] + 'uptodate': [utils.config_changed({1: tags, 2: level_weights}, 'nikola.plugins.render_tag_cloud:tags'), utils.config_changed(config, 'nikola.plugins.render_tag_cloud:config')] } yield utils.apply_filters(task, self.site.config["FILTERS"]) @@ -165,7 +165,7 @@ def gen_tasks(self): yield self.group_task() # Create tag clouds - for name, config in self.site.config['RENDER_STATIC_TAGCLOUDS'].items(): + for name, config in self.site.config['RENDER_STATIC_TAG_CLOUDS'].items(): try: # Generic complete config generic_config = _DEFAULT_CONFIG.copy() @@ -178,7 +178,7 @@ def gen_tasks(self): config['filename'] = config['filename'].format(lang) config['style_filename'] = config['style_filename'].format(lang) # Generate tasks - yield self._prepare_tagcloud(lang, config) + yield self._prepare_tag_cloud(lang, config) except Exception as e: _LOGGER.error("Error occured while creating tag cloud '{0}': {1}".format(name, e)) raise e diff --git a/v7/static_tagcloud/static_tagcloud/engine.py b/v7/static_tag_cloud/static_tag_cloud/engine.py similarity index 100% rename from v7/static_tagcloud/static_tagcloud/engine.py rename to v7/static_tag_cloud/static_tag_cloud/engine.py