Skip to content
Browse files
Added docstrings and fixed typo.
  • Loading branch information
felixfontein committed Sep 10, 2015
1 parent 168d1e4 commit ff6a71ba8b70ba069283a1e6a86027061734e8d9
Showing 1 changed file with 7 additions and 1 deletion.
@@ -55,12 +55,18 @@ def set_site(self, site):
return super(Indexes, self).set_site(site)

def _get_filtered_posts(self, lang, show_untranslated_posts):
"""Return a filtered list of all posts for the given language.
If show_untranslated_posts is True, will only include posts which
are translated to the given language. Otherwise, returns all posts.
if show_untranslated_posts:
return [x for x in if x.is_translation_available(lang)]

def _compute_number_of_pages(self, filtered_posts, posts_count):
"""Given a list of posts and the maximal number of posts per page, computes the number of pages needed."""
return min(1, (len(filtered_posts) + posts_count - 1) // posts_count)

def gen_tasks(self):
@@ -242,7 +248,7 @@ def index_path(self, name, lang, is_feed=False):['INDEX_PATH'],
index_file] if _f],
utils.get_displayed_page_number(name, self.number_of_pages,,
utils.get_displayed_page_number(name, number_of_pages,,

0 comments on commit ff6a71b

Please sign in to comment.