(config)
| 610 | |
| 611 | |
| 612 | def get_plot_formats(config): |
| 613 | default_dpi = {'png': 80, 'hires.png': 200, 'pdf': 200} |
| 614 | formats = [] |
| 615 | plot_formats = config.plot_formats |
| 616 | for fmt in plot_formats: |
| 617 | if isinstance(fmt, str): |
| 618 | if ':' in fmt: |
| 619 | suffix, dpi = fmt.split(':') |
| 620 | formats.append((str(suffix), int(dpi))) |
| 621 | else: |
| 622 | formats.append((fmt, default_dpi.get(fmt, 80))) |
| 623 | elif isinstance(fmt, (tuple, list)) and len(fmt) == 2: |
| 624 | formats.append((str(fmt[0]), int(fmt[1]))) |
| 625 | else: |
| 626 | raise PlotError('invalid image format "%r" in plot_formats' % fmt) |
| 627 | return formats |
| 628 | |
| 629 | |
| 630 | def _parse_srcset(entries): |
no test coverage detected
searching dependent graphs…