simplification
This commit is contained in:
parent
6f802959ce
commit
d1dc9c85d0
1 changed files with 3 additions and 7 deletions
|
@ -41,8 +41,7 @@ The choice has been made when the file was saved!
|
||||||
ID_SEPARATOR = '_.:._'
|
ID_SEPARATOR = '_.:._'
|
||||||
|
|
||||||
|
|
||||||
import Blender, BPyMessages, sys, math, re
|
import Blender, BPyMessages, sys, math, re, xml.sax
|
||||||
from xml.sax import handler, make_parser
|
|
||||||
|
|
||||||
|
|
||||||
numwsp = re.compile('(?<=[\d.])\s+(?=[-+.\d])')
|
numwsp = re.compile('(?<=[\d.])\s+(?=[-+.\d])')
|
||||||
|
@ -165,7 +164,7 @@ def parse_transform(s):
|
||||||
return matrix
|
return matrix
|
||||||
|
|
||||||
|
|
||||||
class import_svg(handler.ContentHandler):
|
class import_svg(xml.sax.handler.ContentHandler):
|
||||||
# err_handler
|
# err_handler
|
||||||
def error(self, exception):
|
def error(self, exception):
|
||||||
raise Abort(str(exception))
|
raise Abort(str(exception))
|
||||||
|
@ -286,10 +285,7 @@ def run_parser(path):
|
||||||
Blender.Window.WaitCursor(1)
|
Blender.Window.WaitCursor(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
svg = make_parser()
|
xml.sax.parse(path, import_svg(), import_svg())
|
||||||
svg.setContentHandler(import_svg())
|
|
||||||
svg.setErrorHandler(import_svg())
|
|
||||||
svg.parse(path)
|
|
||||||
Blender.Registry.SetKey("UVImportExportSVG", { "path" : path }, False)
|
Blender.Registry.SetKey("UVImportExportSVG", { "path" : path }, False)
|
||||||
|
|
||||||
except Abort, e:
|
except Abort, e:
|
||||||
|
|
Loading…
Add table
Reference in a new issue