diff --git a/mkdocs/config/config_options.py b/mkdocs/config/config_options.py index c615d357..1d7060d7 100644 --- a/mkdocs/config/config_options.py +++ b/mkdocs/config/config_options.py @@ -25,10 +25,9 @@ class BaseConfigOption(object): def pre_validation(self, config, key_name): """ - After all options have passed validation, perform a post validation - process to do any additional changes dependant on other config values. + Before all options are validated, perform a pre-validation process. - The post validation process method should be implemented by subclasses. + The pre-validation process method should be implemented by subclasses. """ def run_validation(self, value): @@ -41,10 +40,10 @@ class BaseConfigOption(object): def post_validation(self, config, key_name): """ - After all options have passed validation, perform a post validation + After all options have passed validation, perform a post-validation process to do any additional changes dependant on other config values. - The post validation process method should be implemented by subclasses. + The post-validation process method should be implemented by subclasses. """ @@ -147,10 +146,10 @@ class Type(OptionallyRequired): def run_validation(self, value): if not isinstance(value, self._type): - msg = ("Expected type: {0} but recieved: {1}" + msg = ("Expected type: {0} but received: {1}" .format(self._type, type(value))) elif self.length is not None and len(value) != self.length: - msg = ("Expected type: {0} with lenght {2} but recieved: {1} with " + msg = ("Expected type: {0} with length {2} but received: {1} with " "length {3}").format(self._type, value, self.length, len(value)) else: @@ -518,12 +517,11 @@ class Pages(Extras): return config_types = set(type(l) for l in value) - if config_types.issubset(set([utils.text_type, dict, str])): + if config_types.issubset({utils.text_type, dict, str}): return value raise ValidationError("Invalid pages config. {0} {1}".format( - config_types, - set([utils.text_type, dict, ]) + config_types, {utils.text_type, dict} )) def post_validation(self, config, key_name): diff --git a/mkdocs/contrib/legacy_search/__init__.py b/mkdocs/contrib/legacy_search/__init__.py index 1c1effc5..4360dfc8 100644 --- a/mkdocs/contrib/legacy_search/__init__.py +++ b/mkdocs/contrib/legacy_search/__init__.py @@ -1,13 +1,13 @@ # coding: utf-8 -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals import os import logging from mkdocs import utils from mkdocs.plugins import BasePlugin +from mkdocs.contrib.legacy_search.search_index import SearchIndex -from .search_index import SearchIndex log = logging.getLogger(__name__)