Bugfix in Draft custom hatch patterns

This commit is contained in:
Yorik van Havre 2012-01-24 20:30:04 -02:00
parent 983e2b44de
commit 985b7da5b3
2 changed files with 4 additions and 4 deletions

View File

@ -50,9 +50,10 @@ FreeCAD.svgpatterns = importSVG.getContents(Draft_rc.qt_resource_data,'pattern',
altpat = Draft.getParam("patternFile")
if os.path.isdir(altpat):
for f in os.listdir(altpat):
if '.svg' in f:
if f[-4:].upper() == ".SVG":
p = importSVG.getContents(altpat+os.sep+f,'pattern')
if p: FreeCAD.svgpatterns[p[0]]=p[1]
if p:
FreeCAD.svgpatterns.update(p)
# sets the default working plane
plane = WorkingPlane.plane()

View File

@ -896,8 +896,7 @@ def getContents(filename,tag,stringmode=False):
contents = filename
else:
f = pythonopen(filename)
contents = ''
for line in f: contents += line
contents = f.read()
f.close()
contents = contents.replace('\n','_linebreak')
searchpat = '<'+tag+'.*?</'+tag+'>'