Skip to content
Permalink
Browse files

Fixed some bugs found by codacy.

  • Loading branch information
felixfontein committed Dec 4, 2016
1 parent ca73d70 commit e775b0fe93891aa05b9e31a505fedc6b121aaaa7
Showing with 4 additions and 4 deletions.
  1. +3 −3 nikola/plugins/misc/taxonomies_classifier.py
  2. +1 −1 nikola/plugins/task/taxonomies.py
@@ -106,9 +106,9 @@ def _do_classification(self, site):
else:
utils.LOGGER.error('You have classifications that are too similar: {0} "{1}" and {2} "{3}" both result in output path {4} for language {5}.'.format(
taxonomy.classification_name, classification, other_classification_name, other_classification, path, lang))
utils.LOGGER.error('{0} {1} is used in: {1}'.format(
utils.LOGGER.error('{0} {1} is used in: {2}'.format(
taxonomy.classification_name.title(), classification, ', '.join(sorted([p.source_path for p in posts]))))
utils.LOGGER.error('{0} {1} is used in: {1}'.format(
utils.LOGGER.error('{0} {1} is used in: {2}'.format(
other_classification_name.title(), other_classification, ', '.join(sorted([p.source_path for p in other_posts]))))
quit = True
else:
@@ -277,7 +277,7 @@ def _taxonomy_path(self, name, lang, taxonomy, dest_type='page'):
if not taxonomy.show_list_as_index and page is not None:
number_of_pages = self.site.page_count_per_classification[taxonomy.classification_name][lang].get(name)
if number_of_pages is None:
number_of_pages = self._compute_number_of_pages(self._get_filtered_list(name, lang), self.site.config['INDEX_DISPLAY_POST_COUNT'])
number_of_pages = self._compute_number_of_pages(self._get_filtered_list(taxonomy, name, lang), self.site.config['INDEX_DISPLAY_POST_COUNT'])
self.site.page_count_per_classification[taxonomy.classification_name][lang][name] = number_of_pages
page_info = (page, number_of_pages)
return self._postprocess_path(path, lang, append_index=append_index, dest_type=dest_type, page_info=page_info)
@@ -277,7 +277,7 @@ def _generate_classification_page_as_list(self, taxonomy, classification, filter
yield task

if taxonomy.generate_atom_feeds_for_post_lists and self.site.config['GENERATE_ATOM']:
yield self._generate_classification_page_as_list_atom(kind, taxonomy, classification, filtered_posts, context, kw, lang)
yield self._generate_classification_page_as_list_atom(taxonomy, classification, filtered_posts, context, kw, lang)

def _filter_list(self, post_list, lang):
"""Return only the posts which should be shown for this language."""

0 comments on commit e775b0f

Please sign in to comment.
You can’t perform that action at this time.