Navigation Menu

Skip to content

Commit

Permalink
flake8ier
Browse files Browse the repository at this point in the history
  • Loading branch information
da2x committed Aug 27, 2015
1 parent 0b47d68 commit e059a57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions nikola/post.py
Expand Up @@ -746,15 +746,15 @@ def destination_path(self, lang=None, extension='.html', sep=os.sep):
return path

def category_color(self, lang=None):
""" Return the color of the post's category. """
"""Return the color of the post's category."""
slug = self.category_slug(lang)
if slug in self.config['POSTS_CATEGORY_COLORS'](lang):
return self.config['POSTS_CATEGORY_COLORS'](lang)[slug]
base = self.config['THEME_COLOR']
return utils.colorize_str_from_base_color(slug, base)

def category_link(self, lang=None):
""" Return the link to the post's category. """
"""Return the link to the post's category."""
slug = self.category_slug(lang)
if not self.pretty_urls:
link = urljoin('/' + slug + '/', self.index_file)
Expand All @@ -763,7 +763,7 @@ def category_link(self, lang=None):
return link

def category_name(self, lang=None):
""" Return the name of the post's category. """
"""Return the name of the post's category."""
slug = self.category_slug(lang)
if slug in self.config['POSTS_CATEGORY_NAME'](lang):
name = self.config['POSTS_CATEGORY_NAME'](lang)[slug]
Expand All @@ -772,7 +772,7 @@ def category_name(self, lang=None):
return name

def category_slug(self, lang=None):
""" Return the slug for the post's category. """
"""Return the slug for the post's category."""
if not self.config['POSTS_CATEGORY_FROM_META']:
dest = self.destination_path(lang)
if dest[-(1 + len(self.index_file)):] == '/' + self.index_file:
Expand Down
6 changes: 3 additions & 3 deletions nikola/utils.py
Expand Up @@ -1677,9 +1677,9 @@ def escape(s):
def colorize_str_from_base_color(string, base_color):
""" Find a perceptual similar color from a base color based on the hash of a sring.
Make up to 16 attempts (number of bytes returned by hashing) at picking a
hue for our color at least 27 deg removed from the base color, leaving
lightness and saturation untouched using HUSL colorspace.
Make up to 16 attempts (number of bytes returned by hashing) at picking a
hue for our color at least 27 deg removed from the base color, leaving
lightness and saturation untouched using HUSL colorspace.
"""
def hash_str(string, pos):
return hashlib.md5(string.encode('utf-8')).digest()[pos]
Expand Down

0 comments on commit e059a57

Please sign in to comment.