Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

configurator changes (I swapped the argument order, to make it consis…

…tent with configurator methods), and fixed category
  • Loading branch information...
commit 79ae17c3e4d42298e377e6bcd075276a5d0ee8ac 1 parent 1f46f84
@colinta colinta authored
View
8 strange_case/extensions/category.py
@@ -60,7 +60,7 @@ def populate(self, site):
target_name = re.sub(r'[\W -]+', '_', page.category, re.UNICODE)
config['name'] = target_name
config['target_name'] = target_name + config['html_extension']
- Registry.configurate(config, CategoryDetail.source_path)
+ Registry.configurate(CategoryDetail.source_path, config)
categories[page.category] = CategoryDetail(config, self.target_folder, page.category)
categories[page.category].count += 1
@@ -73,19 +73,21 @@ def populate(self, site):
def processor(config, source_path, target_path):
+ Registry.configurate(source_path, config)
categories_name = config.get('name', 'categories')
folder_config = config.copy()
folder_config['target_name'] = categories_name
folder_config['name'] = categories_name
- Registry.configurate(folder_config, source_path)
+ Registry.configurate(source_path, folder_config)
folder = FolderNode(folder_config, None, target_path)
categories_folder_target_path = os.path.join(target_path, categories_name)
+ config['dont_inherit'] = [key for key in config['dont_inherit'] if key != 'title']
index_config = config.copy()
index_config['target_name'] = config['index.html']
index_config['name'] = 'index'
- Registry.configurate(index_config, os.path.join(source_path, index_config['target_name']))
+ Registry.configurate(os.path.join(source_path, index_config['target_name']), index_config)
index_node = JinjaNode(index_config, source_path, categories_folder_target_path)
folder.append(index_node)
CategoryDetail.index_node = index_node
View
2  strange_case/extensions/image.py
@@ -82,7 +82,7 @@ def processor(config, source_path, target_path):
thumb_config['is_thumbnail'] = True
thumb_config['skip'] = config['skip']
- Registry.configurate(thumb_config, os.path.join(source_path, target_name))
+ Registry.configurate(os.path.join(source_path, target_name), thumb_config)
thumbnail_node = ImageNode(thumb_config, source_path, target_path)
image_node.config[thumbnail] = thumbnail_node
thumbs.append(thumbnail_node)
View
2  strange_case/extensions/paginated.py
@@ -216,7 +216,7 @@ def populate(self, site):
page_config.setdefault('title', "%s %i" % (page_title, page_index))
page_config.setdefault('page', page)
page_config.setdefault('iterable', False)
- Registry.configurate(page_config, source_path)
+ Registry.configurate(source_path, page_config)
more_page_config = self.config.get('pages', {}).get(page_index, None)
if more_page_config:
page_config.update(more_page_config)
View
2  strange_case/processors.py
@@ -21,7 +21,7 @@ def your_processor(config, source_file, target_path):
def build_node(config, source_path, target_path, file_name):
source_file = os.path.join(source_path, file_name)
- config = Registry.configurate(config, source_file)
+ config = Registry.configurate(source_file, config)
if not config:
return
View
2  strange_case/registry.py
@@ -64,7 +64,7 @@ def add_configurator(cls, configurator):
cls.configurators.append(configurator)
@classmethod
- def configurate(cls, config, source_file):
+ def configurate(cls, source_file, config):
configurators = Registry.configurators
# Run the config through each configurator.
# If a configurator returns a falsey
Please sign in to comment.
Something went wrong with that request. Please try again.