Skip to content
Permalink
Browse files

PEP 257 compliance for path docstrings

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Sep 4, 2015
1 parent 468d972 commit 2cd8d8ecf3fe86ab7741f54c443d517e23b91f3f
@@ -811,7 +811,7 @@ def init_plugins(self, commands_only=False):
# Remove compiler extensions we don't need
if p[-1].details.has_option('Nikola', 'compiler') and p[-1].details.get('Nikola', 'compiler') in self.disabled_compilers:
bad_candidates.add(p)
utils.LOGGER.debug('Not loading comopiler extension {}', p[-1].name)
utils.LOGGER.debug('Not loading compiler extension {}', p[-1].name)
self.plugin_manager._candidates = list(set(self.plugin_manager._candidates) - bad_candidates)
self.plugin_manager.loadPlugins()

@@ -1365,7 +1365,9 @@ def path(self, kind, name, lang=None, is_link=False):
return ""

def post_path(self, name, lang):
"""Link to the destination of an element in the POSTS/PAGES settings. For example:
"""Link to the destination of an element in the POSTS/PAGES settings.
Example:
link://post_path/posts => /blog
"""
@@ -1374,10 +1376,12 @@ def post_path(self, name, lang):
self.config['INDEX_FILE']] if _f]

def root_path(self, name, lang):
"""Link to the current language's root. For example:
"""Link to the current language's root.
Example:
link://root_path => /
link://root_path => /translations/spanish/
"""
d = self.config['TRANSLATIONS'][lang]
@@ -1387,7 +1391,9 @@ def root_path(self, name, lang):
return []

def slug_path(self, name, lang):
"""A link to a post with given slug, if not ambiguous. For example:
"""A link to a post with given slug, if not ambiguous.
Example:
links://slug/yellow-camaro => /posts/cars/awful/yellow-camaro/index.html
"""
@@ -1400,7 +1406,9 @@ def slug_path(self, name, lang):
return [_f for _f in results[0].permalink(lang).split('/') if _f]

def filename_path(self, name, lang):
"""Link to post or story by source filename. For example:
"""Link to post or story by source filename.
Example:
link://filename/manual.txt => /docs/handbook.html
"""
@@ -223,7 +223,9 @@ def gen_tasks(self):
yield self._prepare_task(kw, None, lang, None, items, "list.tmpl", kw["messages"][lang]["Archive"])

def archive_path(self, name, lang, is_feed=False):
"""Link to archive path, name is the year. For example:
"""Link to archive path, name is the year.
Example:
link://archive/2013 => /archives/2013/index.html
"""
@@ -244,7 +246,9 @@ def archive_path(self, name, lang, is_feed=False):
archive_file] if _f]

def archive_atom_path(self, name, lang):
"""Link to atom archive path, name is the year. For example:
"""Link to atom archive path, name is the year.
Example:
link://archive_atom/2013 => /archives/2013/index.atom
"""
@@ -252,7 +252,9 @@ def slugify_author_name(self, name):
return name

def author_index_path(self, name, lang):
"""Link to the author's index. For example:
"""Link to the author's index.
Example:
link://authors/ => /authors/index.html
"""
@@ -261,7 +263,9 @@ def author_index_path(self, name, lang):
self.site.config['INDEX_FILE']] if _f]

def author_path(self, name, lang):
"""Link to an author's page. For example:
"""Link to an author's page.
Example:
link://author/joe => /authors/joe.html
"""
@@ -278,7 +282,9 @@ def author_path(self, name, lang):
self.slugify_author_name(name) + ".html"] if _f]

def author_atom_path(self, name, lang):
"""Link to an author's Atom feed. For example:
"""Link to an author's Atom feed.
Example:
link://author_atom/joe => /authors/joe.atom
"""
@@ -287,7 +293,9 @@ def author_atom_path(self, name, lang):
_f]

def author_rss_path(self, name, lang):
"""Link to an author's RSS feed. For example:
"""Link to an author's RSS feed.
Example:
link://author_rss/joe => /authors/joe.rss
"""
@@ -217,7 +217,9 @@ def cat_path(i, displayed_i, num_pages, force_addition, extension=None):
yield task

def index_path(self, name, lang, is_feed=False):
"""Link to a numbered index. For example:
"""Link to a numbered index.
Example:
link://index/3 => /index-3.html
"""
@@ -237,7 +239,9 @@ def index_path(self, name, lang, is_feed=False):
extension=extension)

def index_section_path(self, name, lang, is_feed=False):
"""Link to the index for a section. For example:
"""Link to the index for a section.
Example:
link://section_index/cars => /cars/index.html
"""
@@ -258,14 +262,18 @@ def index_section_path(self, name, lang, is_feed=False):
extension=extension)

def index_atom_path(self, name, lang):
"""Link to a numbered Atom index. For example:
"""Link to a numbered Atom index.
Example:
link://index_atom/3 => /index-3.atom
"""
return self.index_path(name, lang, is_feed=True)

def index_section_atom_path(self, name, lang):
"""Link to the Atom index for a section. For example:
"""Link to the Atom index for a section.
Example:
link://section_index_atom/cars => /cars/index.atom
"""
@@ -255,11 +255,14 @@ def render_listing(in_name, out_name, input_folder, output_folder, folders=[], f
}, self.kw["filters"])

def listing_path(self, namep, lang):
"""A link to a listing. It will try to use the file name if
it's not ambiguous, or the file path. For example:
"""A link to a listing.
It will try to use the file name if it's not ambiguous, or the file path.
Example:
link://listing/hello.py => /listings/tutorial/hello.py.html
link://listing/tutorial/hello.py => /listings/tutorial/hello.py.html
"""
namep = namep.replace('/', os.sep)
@@ -106,7 +106,9 @@ def gen_tasks(self):
yield utils.apply_filters(task, kw['filters'])

def rss_path(self, name, lang):
"""A link to the RSS feed path. For example:
"""A link to the RSS feed path.
Example:
link://rss => /blog/rss.xml
"""
@@ -394,7 +394,9 @@ def slugify_tag_name(self, name):
return name

def tag_index_path(self, name, lang):
"""A link to the tag index. For example:
"""A link to the tag index.
Example:
link://tag_index => /tags/index.html
"""
@@ -403,7 +405,9 @@ def tag_index_path(self, name, lang):
self.site.config['INDEX_FILE']] if _f]

def category_index_path(self, name, lang):
"""A link to the category index. For example:
"""A link to the category index.
Example:
link://category_index => /categories/index.html
"""
@@ -412,7 +416,9 @@ def category_index_path(self, name, lang):
self.site.config['INDEX_FILE']] if _f]

def tag_path(self, name, lang):
"""A link to a tag's page. For example:
"""A link to a tag's page.
Example:
link://tag/cats => /tags/cats.html
"""
@@ -429,7 +435,9 @@ def tag_path(self, name, lang):
self.slugify_tag_name(name) + ".html"] if _f]

def tag_atom_path(self, name, lang):
"""A link to a tag's Atom feed. For example:
"""A link to a tag's Atom feed.
Example:
link://tag_atom/cats => /tags/cats.atom
"""
@@ -438,7 +446,9 @@ def tag_atom_path(self, name, lang):
_f]

def tag_rss_path(self, name, lang):
"""A link to a tag's RSS feed. For example:
"""A link to a tag's RSS feed.
Example:
link://tag_rss/cats => /tags/cats.xml
"""
@@ -462,7 +472,9 @@ def _add_extension(self, path, extension):
return path

def category_path(self, name, lang):
"""A link to a category. For example:
"""A link to a category.
Example:
link://category/dogs => /categories/dogs.html
"""
@@ -476,7 +488,9 @@ def category_path(self, name, lang):
_f] + self._add_extension(self.slugify_category_name(name), ".html")

def category_atom_path(self, name, lang):
"""A link to a category's Atom feed. For example:
"""A link to a category's Atom feed.
Example:
link://category_atom/dogs => /categories/dogs.atom
"""
@@ -485,7 +499,9 @@ def category_atom_path(self, name, lang):
_f] + self._add_extension(self.slugify_category_name(name), ".atom")

def category_rss_path(self, name, lang):
"""A link to a category's RSS feed. For example:
"""A link to a category's RSS feed.
Example:
link://category_rss/dogs => /categories/dogs.xml
"""

0 comments on commit 2cd8d8e

Please sign in to comment.