Skip to content
Permalink
Browse files
Making flake8 happy.
  • Loading branch information
felixfontein committed May 10, 2015
1 parent b6e0971 commit 152c608d93dc4082296015069acffc9e7991d532
Showing with 3 additions and 1 deletion.
  1. +3 −1 nikola/nikola.py
@@ -1411,8 +1411,9 @@ def _add_post_to_category(self, post, category_name):
self.posts_per_category[self.category_path_to_category_name(current_path)].append(post)

def _sort_category_hierarchy(self):
self.category_hierarchy_lookup = {}
# First create a hierarchy of TreeNodes
self.category_hierarchy_lookup = {}

def create_hierarchy(cat_hierarchy, parent=None):
result = []
for name, children in cat_hierarchy.items():
@@ -1424,6 +1425,7 @@ def create_hierarchy(cat_hierarchy, parent=None):
if node.category_name not in self.config.get('HIDDEN_CATEGORIES'):
result.append(node)
return natsort.natsorted(result, key=lambda e: e.name, alg=natsort.ns.F | natsort.ns.IC)

root_list = create_hierarchy(self.category_hierarchy)
# Next, flatten the hierarchy
self.category_hierarchy = utils.flatten_tree_structure(root_list)

0 comments on commit 152c608

Please sign in to comment.