| 643 | |
| 644 | |
| 645 | def check_output_base_name(env, output_base): |
| 646 | docname = env.docname |
| 647 | |
| 648 | if '.' in output_base or '/' in output_base or '\\' in output_base: |
| 649 | raise PlotError( |
| 650 | f"The filename-prefix '{output_base}' is invalid. " |
| 651 | f"It must not contain dots or slashes.") |
| 652 | |
| 653 | for d in env.mpl_plot_image_basenames: |
| 654 | if output_base in env.mpl_plot_image_basenames[d]: |
| 655 | if d == docname: |
| 656 | raise PlotError( |
| 657 | f"The filename-prefix {output_base!r} is used multiple times.") |
| 658 | raise PlotError(f"The filename-prefix {output_base!r} is used multiple" |
| 659 | f"times (it is also used in {env.doc2path(d)}).") |
| 660 | |
| 661 | env.mpl_plot_image_basenames[docname].add(output_base) |
| 662 | |
| 663 | |
| 664 | def render_figures(code, code_path, output_dir, output_base, context, |