Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b3c4e0a

Browse files
committed
STY: style cleanup
1 parent 35b80cc commit b3c4e0a

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

lib/matplotlib/backends/__init__.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ def pylab_setup(backend=None):
4242
if backend.startswith('module://'):
4343
backend_name = backend[9:]
4444
else:
45-
backend_name = 'backend_'+backend
46-
backend_name = backend_name.lower() # until we banish mixed case
47-
backend_name = 'matplotlib.backends.%s'%backend_name.lower()
45+
backend_name = 'backend_' + backend
46+
backend_name = backend_name.lower() # until we banish mixed case
47+
backend_name = 'matplotlib.backends.%s' % backend_name.lower()
4848

4949
# the last argument is specifies whether to use absolute or relative
5050
# imports. 0 means only perform absolute imports.
51-
backend_mod = __import__(backend_name,
52-
globals(),locals(),[backend_name],0)
51+
backend_mod = __import__(backend_name, globals(), locals(),
52+
[backend_name], 0)
5353

5454
# Things we pull in from all backends
5555
new_figure_manager = backend_mod.new_figure_manager
@@ -66,11 +66,19 @@ def do_nothing_show(*args, **kwargs):
6666
Please select a GUI backend in your matplotlibrc file ('%s')
6767
or with matplotlib.use()""" %
6868
(backend, matplotlib.matplotlib_fname()))
69-
def do_nothing(*args, **kwargs): pass
70-
backend_version = getattr(backend_mod,'backend_version', 'unknown')
69+
70+
def do_nothing(*args, **kwargs):
71+
pass
72+
73+
backend_version = getattr(backend_mod, 'backend_version',
74+
'unknown')
75+
7176
show = getattr(backend_mod, 'show', do_nothing_show)
72-
draw_if_interactive = getattr(backend_mod, 'draw_if_interactive', do_nothing)
7377

74-
matplotlib.verbose.report('backend %s version %s' % (backend,backend_version))
78+
draw_if_interactive = getattr(backend_mod, 'draw_if_interactive',
79+
do_nothing)
80+
81+
matplotlib.verbose.report('backend %s version %s' %
82+
(backend, backend_version))
7583

7684
return backend_mod, new_figure_manager, draw_if_interactive, show

lib/matplotlib/tests/test_coding_standards.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ def test_pep8_conformance_installed_files():
216216
'tests/test_tightlayout.py',
217217
'tests/test_triangulation.py',
218218
'compat/subprocess.py',
219-
'backends/__init__.py',
220219
'backends/backend_agg.py',
221220
'backends/backend_cairo.py',
222221
'backends/backend_cocoaagg.py',

0 commit comments

Comments
 (0)