Only adds filename to list, not full path.

master
Travis Howse 2011-09-16 15:47:58 +10:00
parent 50c2c4346f
commit 21c0b9aaa8
1 changed files with 20 additions and 19 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python
import wx,time,random,threading,os,math
import stltool
import re
class stlwrap:
def __init__(self,obj,name=None):
@ -131,10 +132,11 @@ class showstl(wx.Window):
t=time.time()
#print name
if name.lower().endswith(".stl"):
newname=name
#Filter out the path, just show the STL filename.
newname=re.match(r".*[/\\](.*?\.stl)", name.lower()).group(1)
c=1
while newname in self.models:
newname=name+"(%d)"%c
newname=newname+"(%d)"%c
c+=1
self.models[newname]=stltool.stl(name)
self.models[newname].offsets=[0,0,0]
@ -300,4 +302,3 @@ if __name__ == '__main__':
main = stlwin()
main.Show()
app.MainLoop()