boxes_proxy (for Inkscape): Use temp file
Resolves permission issues when trying to place files into system extension directory. Resolves: #516
This commit is contained in:
parent
455f5ae69a
commit
8b961797f9
|
@ -16,6 +16,7 @@ import inkex
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
import tempfile
|
||||||
|
|
||||||
class boxesPyWrapper(inkex.GenerateExtension):
|
class boxesPyWrapper(inkex.GenerateExtension):
|
||||||
|
|
||||||
|
@ -31,9 +32,7 @@ class boxesPyWrapper(inkex.GenerateExtension):
|
||||||
pass #ignore duplicate id arg
|
pass #ignore duplicate id arg
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
box_file = "box.svg"
|
f, box_file = tempfile.mkstemp(".svg", "boxes.py-inkscape")
|
||||||
if os.path.exists(box_file):
|
|
||||||
os.remove(box_file) #remove previously generated box file at the beginning
|
|
||||||
|
|
||||||
cmd = "boxes" #boxes.exe in this local dir (or if present in %PATH%), or boxes from $PATH in linux
|
cmd = "boxes" #boxes.exe in this local dir (or if present in %PATH%), or boxes from $PATH in linux
|
||||||
for arg in vars(self.options):
|
for arg in vars(self.options):
|
||||||
|
|
Loading…
Reference in New Issue