summaryrefslogtreecommitdiff
path: root/support/inkscape/__main__.py
diff options
context:
space:
mode:
authorMichael Schwarz <michi.schwarz@gmail.com>2015-08-06 16:19:19 +0200
committerMichael Schwarz <michi.schwarz@gmail.com>2015-08-06 16:32:59 +0200
commite2d477640ffef84011860f00694a58374e7c3a29 (patch)
treef35a949ac419eb2cbfa92a1d455a4516610ba7bc /support/inkscape/__main__.py
parentb34b948f0ae88fa632b196d5fb0682b552555764 (diff)
downloadpogojig-e2d477640ffef84011860f00694a58374e7c3a29.tar.gz
pogojig-e2d477640ffef84011860f00694a58374e7c3a29.tar.bz2
pogojig-e2d477640ffef84011860f00694a58374e7c3a29.zip
Inkscape export: Support to export to Asymptote.
Diffstat (limited to 'support/inkscape/__main__.py')
-rw-r--r--support/inkscape/__main__.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/support/inkscape/__main__.py b/support/inkscape/__main__.py
index 7b3ea1a..ff23cc3 100644
--- a/support/inkscape/__main__.py
+++ b/support/inkscape/__main__.py
@@ -46,7 +46,16 @@ def main(in_path, out_path):
_unfuck_svg_document(temp_svg_path)
- _export_dxf(temp_svg_path, out_path, layers)
+ export_effect = effect.ExportEffect()
+ export_effect.affect(args = [temp_svg_path], output = False)
+
+ with open(out_path, 'w') as file:
+ if out_suffix == '.dxf':
+ export_effect.write_dxf(file)
+ elif out_suffix == '.asy':
+ export_effect.write_asy(file)
+ else:
+ raise Exception('Unknown file type: {}'.format(out_suffix))
try: