Select other than standard DrawBot export builders here. Save the current image as path, rendering depending on the extension of the path file. In case the path starts with "_export", then create it directories. >>> context = SvgContext() >>> context.newPage(
(self, path, multiPage=None)
| 128 | # Save / export. |
| 129 | |
| 130 | def saveDrawing(self, path, multiPage=None): |
| 131 | """Select other than standard DrawBot export builders here. Save the |
| 132 | current image as path, rendering depending on the extension of the path |
| 133 | file. In case the path starts with "_export", then create it |
| 134 | directories. |
| 135 | |
| 136 | >>> context = SvgContext() |
| 137 | >>> context.newPage(1000, 1000) |
| 138 | >>> context.saveImage('_export/MyFile.svg') |
| 139 | |
| 140 | """ |
| 141 | # Only save to SVG for now. Maybe use Flat context to save PDF / bitmap? |
| 142 | parts = path.split('.') |
| 143 | ext = parts[-1] |
| 144 | assert ext.lower() == 'svg' |
| 145 | self._drawing.save() |
| 146 | self.checkExportPath(path) |
| 147 | shutil.move(self._filePath, path) |
| 148 | |
| 149 | saveImage = saveDrawing # Compatible API with DrawBot |
| 150 |
no test coverage detected