aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/extensions/__init__.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2014-11-20 16:07:03 -0500
committerWaylan Limberg <waylan.limberg@icloud.com>2014-11-20 16:07:03 -0500
commit8f66a94eab1389d97041944ed24afd2bf7c4389c (patch)
tree10b53664076650be951468cbbb163f3d637e5891 /markdown/extensions/__init__.py
parent0c2143819ef7de53be52f7a4d47e027ff194a9b4 (diff)
downloadmarkdown-8f66a94eab1389d97041944ed24afd2bf7c4389c.tar.gz
markdown-8f66a94eab1389d97041944ed24afd2bf7c4389c.tar.bz2
markdown-8f66a94eab1389d97041944ed24afd2bf7c4389c.zip
Flake8 cleanup (mostly whitespace).
Got all but a couple files in the tests (ran out of time today). Apparently I have been using some bad form for years (although a few things seemed to look better before the update). Anyway, conformant now.
Diffstat (limited to 'markdown/extensions/__init__.py')
-rw-r--r--markdown/extensions/__init__.py33
1 files changed, 19 insertions, 14 deletions
diff --git a/markdown/extensions/__init__.py b/markdown/extensions/__init__.py
index 03b2a4c..a823fef 100644
--- a/markdown/extensions/__init__.py
+++ b/markdown/extensions/__init__.py
@@ -7,9 +7,10 @@ from __future__ import unicode_literals
from ..util import parseBoolValue
import warnings
+
class Extension(object):
""" Base class for extensions to subclass. """
-
+
# Default config -- to be overriden by a subclass
# Must be of the following format:
# {
@@ -18,7 +19,7 @@ class Extension(object):
# Note that Extension.setConfig will raise a KeyError
# if a default is not set here.
config = {}
-
+
def __init__(self, *args, **kwargs):
""" Initiate Extension and set up configs. """
@@ -26,23 +27,26 @@ class Extension(object):
# (there only ever used to be one so we use arg[0])
if len(args):
self.setConfigs(args[0])
- warnings.warn('Extension classes accepting positional args is pending Deprecation. '
- 'Each setting should be passed into the Class as a keyword. Positional '
- 'args will be deprecated in version 2.6 and raise an error in version '
- '2.7. See the Release Notes for Python-Markdown version 2.5 for more info.',
+ warnings.warn('Extension classes accepting positional args is '
+ 'pending Deprecation. Each setting should be '
+ 'passed into the Class as a keyword. Positional '
+ 'args will be deprecated in version 2.6 and raise '
+ 'an error in version 2.7. See the Release Notes for '
+ 'Python-Markdown version 2.5 for more info.',
PendingDeprecationWarning)
# check for configs kwarg for backward compat.
if 'configs' in kwargs.keys():
self.setConfigs(kwargs.pop('configs', {}))
- warnings.warn('Extension classes accepting a dict on the single keyword "config" is '
- 'pending Deprecation. Each setting should be passed into the Class as '
- 'a keyword directly. The "config" keyword will be deprecated in version '
- '2.6 and raise an error in version 2.7. See the Release Notes for '
+ warnings.warn('Extension classes accepting a dict on the single '
+ 'keyword "config" is pending Deprecation. Each '
+ 'setting should be passed into the Class as a '
+ 'keyword directly. The "config" keyword will be '
+ 'deprecated in version 2.6 and raise an error in '
+ 'version 2.7. See the Release Notes for '
'Python-Markdown version 2.5 for more info.',
PendingDeprecationWarning)
# finally, use kwargs
self.setConfigs(kwargs)
-
def getConfig(self, key, default=''):
""" Return a setting for the given key or an empty string. """
@@ -88,6 +92,7 @@ class Extension(object):
* md_globals: Global variables in the markdown module namespace.
"""
- raise NotImplementedError('Extension "%s.%s" must define an "extendMarkdown"' \
- 'method.' % (self.__class__.__module__, self.__class__.__name__))
-
+ raise NotImplementedError(
+ 'Extension "%s.%s" must define an "extendMarkdown"'
+ 'method.' % (self.__class__.__module__, self.__class__.__name__)
+ )