Commit 21c0b9aa authored by Travis Howse's avatar Travis Howse

Only adds filename to list, not full path.

parent 50c2c434
#!/usr/bin/env python #!/usr/bin/env python
import wx,time,random,threading,os,math import wx,time,random,threading,os,math
import stltool import stltool
import re
class stlwrap: class stlwrap:
def __init__(self,obj,name=None): def __init__(self,obj,name=None):
...@@ -131,10 +132,11 @@ class showstl(wx.Window): ...@@ -131,10 +132,11 @@ class showstl(wx.Window):
t=time.time() t=time.time()
#print name #print name
if name.lower().endswith(".stl"): 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 c=1
while newname in self.models: while newname in self.models:
newname=name+"(%d)"%c newname=newname+"(%d)"%c
c+=1 c+=1
self.models[newname]=stltool.stl(name) self.models[newname]=stltool.stl(name)
self.models[newname].offsets=[0,0,0] self.models[newname].offsets=[0,0,0]
...@@ -300,4 +302,3 @@ if __name__ == '__main__': ...@@ -300,4 +302,3 @@ if __name__ == '__main__':
main = stlwin() main = stlwin()
main.Show() main.Show()
app.MainLoop() app.MainLoop()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment