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

Skip to content

Commit e238368

Browse files
committed
STY: fix line length and indentation issues
1 parent 629fcce commit e238368

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@
7171
inserted. This is usually useful with the ``:context:`` option.
7272
7373
outname : str
74-
If specified, the names of the generated plots will start with the value
75-
of `:outname:`. This is handy for preserving output results if code is
76-
reordered between runs. The value of `:outname:` must be unique across
77-
the generated documentation.
74+
If specified, the names of the generated plots will start with the
75+
value of `:outname:`. This is handy for preserving output results if
76+
code is reordered between runs. The value of `:outname:` must be
77+
unique across the generated documentation.
7878
7979
Additionally, this directive supports all of the options of the `image`
8080
directive, except for *target* (since plot will add its own target). These
@@ -142,6 +142,7 @@
142142
Files with outnames are copied to this directory and files in this
143143
directory are copied back from into the build directory prior to the
144144
build beginning.
145+
145146
"""
146147

147148
import contextlib
@@ -677,13 +678,14 @@ def run(arguments, content, options, state_machine, state, lineno):
677678
#Ensure that the outname is unique, otherwise copied images will
678679
#not be what user expects
679680
if outname and outname in _outname_list:
680-
raise Exception("The outname '{0}' is not unique!".format(outname))
681+
raise Exception("The outname '{0}' is not unique!".format(outname))
681682
else:
682-
_outname_list.add(outname)
683+
_outname_list.add(outname)
683684

684685
if config.plot_preserve_dir:
685-
#Ensure `preserve_dir` ends with a slash, otherwise `copy2` will misbehave
686-
config.plot_preserve_dir = os.path.join(config.plot_preserve_dir, '')
686+
# Ensure `preserve_dir` ends with a slash, otherwise `copy2`
687+
# will misbehave
688+
config.plot_preserve_dir = os.path.join(config.plot_preserve_dir, '')
687689

688690
if len(arguments):
689691
if not config.plot_basedir:
@@ -723,7 +725,7 @@ def run(arguments, content, options, state_machine, state, lineno):
723725
#outname, if present, overrides output_base, but preserve
724726
#numbering of multi-figure code snippets
725727
if outname:
726-
output_base = re.sub('^[^-]*', outname, output_base)
728+
output_base = re.sub('^[^-]*', outname, output_base)
727729

728730
# ensure that LaTeX includegraphics doesn't choke in foo.bar.pdf filenames
729731
output_base = output_base.replace('.', '-')
@@ -775,10 +777,12 @@ def run(arguments, content, options, state_machine, state, lineno):
775777
#this copies them into the build directory so that they will
776778
#not be remade
777779
if config.plot_preserve_dir and outname:
778-
outfiles = glob.glob(os.path.join(config.plot_preserve_dir, outname) + '*')
779-
for of in outfiles:
780-
_log.info("Copying preserved copy of '{0}' into '{1}'".format(of, build_dir))
781-
shutil.copy2(of, build_dir)
780+
outfiles = glob.glob(
781+
os.path.join(config.plot_preserve_dir, outname) + '*')
782+
for of in outfiles:
783+
_log.info("Copying preserved copy of '{0}' into '{1}'".format(
784+
of, build_dir))
785+
shutil.copy2(of, build_dir)
782786

783787
# make figures
784788
try:

0 commit comments

Comments
 (0)