use temp dir for boxes.py; remove some useless import in paperfold
extension
This commit is contained in:
parent
bebf4fe61c
commit
aecbd00c1e
@ -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,7 +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"
|
box_file = os.path.join(tempfile.gettempdir(), "box.svg")
|
||||||
if os.path.exists(box_file):
|
if os.path.exists(box_file):
|
||||||
os.remove(box_file) #remove previously generated box file at the beginning
|
os.remove(box_file) #remove previously generated box file at the beginning
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
import math
|
import math
|
||||||
import inkex
|
import inkex
|
||||||
from inkex import Transform, TextElement, Tspan, Color, Circle, PathElement, CubicSuperPath
|
from inkex import Transform, TextElement, Tspan, Color, Circle, PathElement, CubicSuperPath
|
||||||
import tempfile
|
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
Reference in New Issue
Block a user