Skip to content

Commit

Permalink
Changed '__' to ':' and prepending 'nikola.' to every new use of util…
Browse files Browse the repository at this point in the history
…s.config_changed.
  • Loading branch information
felixfontein committed Dec 7, 2014
1 parent 2812aa0 commit b1b86c1
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions nikola/nikola.py
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ def generic_page_renderer(self, lang, post, filters):
'actions': [(self.render_template, [post.template_name,
output_name, context])],
'clean': True,
'uptodate': [config_changed(deps_dict, 'Nikola.generic_post_renderer')],
'uptodate': [config_changed(deps_dict, 'nikola.Nikola.generic_post_renderer')],
}

yield utils.apply_filters(task, filters)
Expand Down Expand Up @@ -1432,7 +1432,7 @@ def generic_post_list_renderer(self, lang, posts, output_name,
'actions': [(self.render_template, [template_name, output_name,
context])],
'clean': True,
'uptodate': [config_changed(deps_context, 'Nikola.generic_post_list_renderer')]
'uptodate': [config_changed(deps_context, 'nikola.Nikola.generic_post_list_renderer')]
}

return utils.apply_filters(task, filters)
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _prepare_task(self, kw, name, lang, posts, items, template_name,
task_cfg = {1: task['uptodate'][0].config, 2: kw, 3: n}
if deps_translatable is not None:
task_cfg[4] = deps_translatable
task['uptodate'] = [config_changed(task_cfg, 'plugins.task.archive')]
task['uptodate'] = [config_changed(task_cfg, 'nikola.plugins.task.archive')]
task['basename'] = self.name
return task

Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def build_bundle(output, inputs):
utils.config_changed({
1: kw,
2: file_dep
}, 'plugins.task.bundles')],
}, 'nikola.plugins.task.bundles')],
'clean': True,
}
yield utils.apply_filters(task, kw['filters'])
Expand Down
4 changes: 2 additions & 2 deletions nikola/plugins/task/copy_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def gen_tasks(self):
if task['name'] in tasks:
continue
tasks[task['name']] = task
task['uptodate'] = [utils.config_changed(kw, 'plugins.task.copy_assets')]
task['uptodate'] = [utils.config_changed(kw, 'nikola.plugins.task.copy_assets')]
task['basename'] = self.name
if code_css_input:
task['file_dep'] = [code_css_input]
Expand All @@ -99,7 +99,7 @@ def create_code_css():
'basename': self.name,
'name': code_css_path,
'targets': [code_css_path],
'uptodate': [utils.config_changed(kw, 'plugins.task.copy_assets'), testcontents],
'uptodate': [utils.config_changed(kw, 'nikola.plugins.task.copy_assets'), testcontents],
'actions': [(create_code_css, [])],
'clean': True,
}
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/copy_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ def gen_tasks(self):
real_dst = os.path.join(dst, kw['files_folders'][src])
for task in utils.copy_tree(src, real_dst, link_cutoff=dst):
task['basename'] = self.name
task['uptodate'] = [utils.config_changed(kw, 'plugins.task.copy_files')]
task['uptodate'] = [utils.config_changed(kw, 'nikola.plugins.task.copy_files')]
yield utils.apply_filters(task, filters, skip_ext=['.html'])
16 changes: 8 additions & 8 deletions nikola/plugins/task/galleries.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def gen_tasks(self):
'targets': [post.translated_base_path(lang)],
'file_dep': post.fragment_deps(lang),
'actions': [(post.compile, [lang])],
'uptodate': [utils.config_changed(self.kw, 'plugins.task.galleries__post')]
'uptodate': [utils.config_changed(self.kw, 'nikola.plugins.task.galleries:post')]
}
context['post'] = post
else:
Expand Down Expand Up @@ -276,7 +276,7 @@ def gen_tasks(self):
1: self.kw,
2: self.site.config["COMMENTS_IN_GALLERIES"],
3: context,
}, 'plugins.task.galleries__gallery')],
}, 'nikola.plugins.task.galleries:gallery')],
}, self.kw['filters'])

# RSS for the gallery
Expand Down Expand Up @@ -304,7 +304,7 @@ def gen_tasks(self):
'clean': True,
'uptodate': [utils.config_changed({
1: self.kw,
}, 'plugins.task.galleries__rss')],
}, 'nikola.plugins.task.galleries:rss')],
}, self.kw['filters'])

def find_galleries(self):
Expand Down Expand Up @@ -364,7 +364,7 @@ def create_galleries(self):
'actions': [(utils.makedirs, (output_gallery,))],
'targets': [output_gallery],
'clean': True,
'uptodate': [utils.config_changed(self.kw, 'plugins.task.galleries__mkdir')],
'uptodate': [utils.config_changed(self.kw, 'nikola.plugins.task.galleries:mkdir')],
}

def parse_index(self, gallery, input_folder, output_folder):
Expand Down Expand Up @@ -452,7 +452,7 @@ def create_target_images(self, img, input_path):
'clean': True,
'uptodate': [utils.config_changed({
1: self.kw['thumbnail_size']
}, 'plugins.task.galleries__resize_thumb')],
}, 'nikola.plugins.task.galleries:resize_thumb')],
}, self.kw['filters'])

yield utils.apply_filters({
Expand All @@ -467,7 +467,7 @@ def create_target_images(self, img, input_path):
'clean': True,
'uptodate': [utils.config_changed({
1: self.kw['max_image_size']
}, 'plugins.task.galleries__resize_max')],
}, 'nikola.plugins.task.galleries:resize_max')],
}, self.kw['filters'])

def remove_excluded_image(self, img, input_folder):
Expand All @@ -491,7 +491,7 @@ def remove_excluded_image(self, img, input_folder):
(utils.remove_file, (thumb_path,))
],
'clean': True,
'uptodate': [utils.config_changed(self.kw, 'plugins.task.galleries__clean_thumb')],
'uptodate': [utils.config_changed(self.kw, 'nikola.plugins.task.galleries:clean_thumb')],
}, self.kw['filters'])

yield utils.apply_filters({
Expand All @@ -501,7 +501,7 @@ def remove_excluded_image(self, img, input_folder):
(utils.remove_file, (img_path,))
],
'clean': True,
'uptodate': [utils.config_changed(self.kw, 'plugins.task.galleries__clean_file')],
'uptodate': [utils.config_changed(self.kw, 'nikola.plugins.task.galleries:clean_file')],
}, self.kw['filters'])

def render_gallery_index(
Expand Down
4 changes: 2 additions & 2 deletions nikola/plugins/task/indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def gen_tasks(self):
kw['filters'],
context,
)
task['uptodate'] = task['uptodate'] + [config_changed(kw, 'plugins.task.indexes')]
task['uptodate'] = task['uptodate'] + [config_changed(kw, 'nikola.plugins.task.indexes')]
task['basename'] = 'render_indexes'
yield task

Expand Down Expand Up @@ -172,7 +172,7 @@ def gen_tasks(self):
template_name,
kw['filters'],
context)
task['uptodate'] = task['uptodate'] + [config_changed(kw, 'plugins.task.indexes')]
task['uptodate'] = task['uptodate'] + [config_changed(kw, 'nikola.plugins.task.indexes')]
task['basename'] = self.name
yield task

Expand Down
4 changes: 2 additions & 2 deletions nikola/plugins/task/listings.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def render_listing(in_name, out_name, input_folder, output_folder, folders=[], f
'actions': [(render_listing, [None, out_name, input_folder, output_folder, dirs, files])],
# This is necessary to reflect changes in blog title,
# sidebar links, etc.
'uptodate': [utils.config_changed(uptodate2, 'plugins.task.listings__folder')],
'uptodate': [utils.config_changed(uptodate2, 'nikola.plugins.task.listings:folder')],
'clean': True,
}, self.kw["filters"])
for f in files:
Expand All @@ -229,7 +229,7 @@ def render_listing(in_name, out_name, input_folder, output_folder, folders=[], f
'actions': [(render_listing, [in_name, out_name, input_folder, output_folder])],
# This is necessary to reflect changes in blog title,
# sidebar links, etc.
'uptodate': [utils.config_changed(uptodate, 'plugins.task.listings__source')],
'uptodate': [utils.config_changed(uptodate, 'nikola.plugins.task.listings:source')],
'clean': True,
}, self.kw["filters"])
if self.site.config['COPY_SOURCES']:
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def gen_tasks(self):
continue
for task in self.site.generic_page_renderer(lang, post,
kw["filters"]):
task['uptodate'] = task['uptodate'] + [config_changed(kw, 'plugins.task.pages')]
task['uptodate'] = task['uptodate'] + [config_changed(kw, 'nikola.plugins.task.pages')]
task['basename'] = self.name
task['task_dep'] = ['render_posts']
yield task
2 changes: 1 addition & 1 deletion nikola/plugins/task/posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ def gen_tasks(self):
(rest_deps, (post,)),
],
'clean': True,
'uptodate': [utils.config_changed(deps_dict, 'plugins.task.posts')],
'uptodate': [utils.config_changed(deps_dict, 'nikola.plugins.task.posts')],
}
yield task
2 changes: 1 addition & 1 deletion nikola/plugins/task/redirect.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def gen_tasks(self):
'targets': [src_path],
'actions': [(create_redirect, (src_path, dst))],
'clean': True,
'uptodate': [utils.config_changed(kw, 'plugins.task.redirect')],
'uptodate': [utils.config_changed(kw, 'nikola.plugins.task.redirect')],
}, kw["filters"])


Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/robots.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def write_robots():
"name": robots_path,
"targets": [robots_path],
"actions": [(write_robots)],
"uptodate": [utils.config_changed(kw, 'plugins.task.robots')],
"uptodate": [utils.config_changed(kw, 'nikola.plugins.task.robots')],
"clean": True,
"task_dep": ["sitemap"]
}, kw["filters"])
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def gen_tasks(self):

'task_dep': ['render_posts'],
'clean': True,
'uptodate': [utils.config_changed(kw, 'plugins.task.rss')],
'uptodate': [utils.config_changed(kw, 'nikola.plugins.task.rss')],
}
yield utils.apply_filters(task, kw['filters'])

Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ def gen_tasks(self):
'targets': [output_name],
'actions': [(utils.copy_file, (source, output_name))],
'clean': True,
'uptodate': [utils.config_changed(kw, 'plugins.task.sources')],
'uptodate': [utils.config_changed(kw, 'nikola.plugins.task.sources')],
}
10 changes: 5 additions & 5 deletions nikola/plugins/task/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def write_tag_data(data):
'name': str(output_name)
}

task['uptodate'] = [utils.config_changed(tag_cloud_data, 'plugins.task.tags__tagdata')]
task['uptodate'] = [utils.config_changed(tag_cloud_data, 'nikola.plugins.task.tags:tagdata')]
task['targets'] = [output_name]
task['actions'] = [(write_tag_data, [tag_cloud_data])]
task['clean'] = True
Expand Down Expand Up @@ -180,7 +180,7 @@ def list_tags_page(self, kw):
kw['filters'],
context,
)
task['uptodate'] = task['uptodate'] + [utils.config_changed(kw, 'plugins.task.tags__page')]
task['uptodate'] = task['uptodate'] + [utils.config_changed(kw, 'nikola.plugins.task.tags:page')]
task['basename'] = str(self.name)
yield task

Expand Down Expand Up @@ -243,7 +243,7 @@ def page_name(tagname, i, lang):
kw['filters'],
context,
)
task['uptodate'] = task['uptodate'] + [utils.config_changed(kw, 'plugins.task.tags__index')]
task['uptodate'] = task['uptodate'] + [utils.config_changed(kw, 'nikola.plugins.task.tags:index')]
task['basename'] = str(self.name)

yield task
Expand Down Expand Up @@ -272,7 +272,7 @@ def tag_page_as_list(self, tag, lang, post_list, kw, is_category):
kw['filters'],
context,
)
task['uptodate'] = task['uptodate'] + [utils.config_changed(kw, 'plugins.task.tags__list')]
task['uptodate'] = task['uptodate'] + [utils.config_changed(kw, 'nikola.plugins.task.tags:list')]
task['basename'] = str(self.name)
yield task

Expand Down Expand Up @@ -300,7 +300,7 @@ def tag_rss(self, tag, lang, posts, kw, is_category):
output_name, kw["rss_teasers"], kw["rss_plain"], kw['feed_length'],
feed_url))],
'clean': True,
'uptodate': [utils.config_changed(kw, 'plugins.task.tags__rss')],
'uptodate': [utils.config_changed(kw, 'nikola.plugins.task.tags:rss')],
'task_dep': ['render_posts'],
}
return utils.apply_filters(task, kw['filters'])
Expand Down
2 changes: 1 addition & 1 deletion nikola/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def __init__(self, config, identifier=None):
super(config_changed, self).__init__(config)
self.identifier = '_config_changed'
if identifier is not None:
self.identifier += '__' + identifier
self.identifier += ':' + identifier

def _calc_digest(self):
if isinstance(self.config, str):
Expand Down

0 comments on commit b1b86c1

Please sign in to comment.