Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look for DOIT_CONFIG in config so it can be set in conf.py #1716

Merged
merged 7 commits into from
May 12, 2015
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions nikola/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,15 @@ def load_tasks(self, cmd, opt_values, pos_args):
if self.quiet:
DOIT_CONFIG = {
'verbosity': 0,
'reporter': 'zero',
'reporter': 'zero'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to change it, but I tend to leave the last commas in this sort of things because it makes the diff better the next time something is added :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(It also lets the next person just type in their changes without having to care about adding a comma.)

}
else:
DOIT_CONFIG = {
'reporter': ExecutedOnlyReporter,
'outfile': sys.stderr,
'outfile': sys.stderr
}
DOIT_CONFIG['default_tasks'] = ['render_site', 'post_render']
DOIT_CONFIG.update(self.nikola._doit_config)
tasks = generate_tasks(
'render_site',
self.nikola.gen_tasks('render_site', "Task", 'Group of tasks to render the site.'))
Expand Down
1 change: 1 addition & 0 deletions nikola/nikola.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ def __init__(self, **config):
self.colorful = config.pop('__colorful__', False)
self.invariant = config.pop('__invariant__', False)
self.quiet = config.pop('__quiet__', False)
self._doit_config = config.pop('DOIT_CONFIG', {})
self.configuration_filename = config.pop('__configuration_filename__', False)
self.configured = bool(config)
self.injected_deps = defaultdict(list)
Expand Down