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

Allowing to configure executables for filters (fixes #2615). #2638

Merged
merged 7 commits into from Jan 15, 2017

Conversation

felixfontein
Copy link
Contributor

As discussed in #2615.

@@ -562,6 +562,29 @@ GITHUB_COMMIT_SOURCE = True
# ".jpg": ["jpegoptim --strip-all -m75 -v %s"],
# }

# The executable for the filter "yui_compressor" from nikola.filters can
Copy link
Member

Choose a reason for hiding this comment

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

I’d prefer something else (matches how we describe other settings):

# Executable for the "yui_compressor" filter (defaults to 'yui-compressor').

And perhaps name those settings *_EXECUTABLE. With YUI Compressor, we should be prepared to take this:

java -jar ~/yui-compressor.jar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since YUI_COMPRESSOR is simply inserted in the command line, it can also be java -jar ~/yui-compressor.jar.

About the naming: I'll adjust that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also adjusted the comments in conf.py.in.


# The executable for the filter "jpegoptim" from nikola.filters can be
# configured here:
# JPEG_OPTIM = 'jpegoptim'
Copy link
Member

Choose a reason for hiding this comment

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

JPEGOPTIM_EXECUTABLE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@@ -45,6 +45,19 @@
from .utils import req_missing, LOGGER


class configurable_filter(object):
Copy link
Member

Choose a reason for hiding this comment

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

A better name would be _ConfigurableFilter, because we don’t want this to be considered public.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -925,6 +926,17 @@ def __init__(self, **config):
utils.LOGGER.warn('The STORY_INDEX option is deprecated, use PAGE_INDEX instead.')
self.config['PAGE_INDEX'] = config['STORY_INDEX']

# Configure filters
for _, actions in self.config['FILTERS'].items():
Copy link
Member

Choose a reason for hiding this comment

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

for actions in self.config['FILTERS'].values():

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@felixfontein felixfontein merged commit 741a5df into master Jan 15, 2017
@felixfontein felixfontein deleted the configurable-filters branch January 15, 2017 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants