소스 검색

- strip() is not the right way to remove substrings, replace() is the right one

Mr.doob 15 년 전
부모
커밋
1c729ec8a0
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      utils/export_threejs_25a2.py
  2. 1 1
      utils/export_threejs_25b.py

+ 1 - 1
utils/export_threejs_25a2.py

@@ -22,7 +22,7 @@ def write(filename, scene, ob, \
     if not filename.lower().endswith('.js'):
         filename += '.js'
 
-    classname = filename.split('/')[-1].strip('.js')
+    classname = filename.replace('.js','').split('/')[-1]
 
     if not ob:
         raise Exception("Error, Select the object to export")

+ 1 - 1
utils/export_threejs_25b.py

@@ -22,7 +22,7 @@ def write(filename, scene, ob, \
     if not filename.lower().endswith('.js'):
         filename += '.js'
 
-    classname = filename.split('/')[-1].strip('.js')
+    classname = filename.replace('.js','').split('/')[-1]
 
     if not ob:
         raise Exception("Error, Select the object to export")