Skip to content

Commit

Permalink
Fixed some bugs found by codacy.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Dec 4, 2016
1 parent ca73d70 commit e775b0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions nikola/plugins/misc/taxonomies_classifier.py
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/taxonomies.py
Expand Up @@ -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."""
Expand Down

0 comments on commit e775b0f

Please sign in to comment.