From 547b2f2457c0e1746c2b5ef9a95d776a5eb50fe5 Mon Sep 17 00:00:00 2001 From: Travis Howse Date: Fri, 16 Sep 2011 16:11:23 +1000 Subject: [PATCH] Replaced re with os.path.split. Fixed duplicates. --- plater.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plater.py b/plater.py index bc0ae23..5f30cde 100755 --- a/plater.py +++ b/plater.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import wx,time,random,threading,os,math import stltool -import re class stlwrap: def __init__(self,obj,name=None): @@ -132,11 +131,12 @@ class showstl(wx.Window): t=time.time() #print name if name.lower().endswith(".stl"): - #Filter out the path, just show the STL filename. - newname=re.match(r".*[/\\](.*?\.stl)", name.lower()).group(1) + #Filter out the path, just show the STL filename. + #newname=re.match(r".*[/\\](.*?\.stl)", name.lower()).group(1) + newname=os.path.split(name.lower())[1] c=1 while newname in self.models: - newname=newname+"(%d)"%c + newname=os.path.split(name.lower()+"(%d)"%c)[1] c+=1 self.models[newname]=stltool.stl(name) self.models[newname].offsets=[0,0,0]