Mercurial > hg > env-test-daniele
comparison sawautil/.svn/text-base/Utilities.py.svn-base @ 0:032bc65ebafc
added core components
author | George Fazekas <gyorgy.fazekas@eecs.qmul.ac.uk> |
---|---|
date | Wed, 06 Mar 2013 15:45:48 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:032bc65ebafc |
---|---|
1 import os | |
2 | |
3 # ============================================ | |
4 # Some global utility functions | |
5 # ============================================ | |
6 | |
7 def convertFilename(upload_filename): | |
8 # we don't have to convert everything to unicode. It works just fine. | |
9 # upload_filename = upload_filename.decode('utf-8') | |
10 filename = upload_filename.replace('\\','/').replace(' ','_') | |
11 filename = os.path.basename(filename) | |
12 #remove additional dots since that confuses sonic annotator | |
13 base,ext = os.path.splitext(filename) | |
14 base = base.replace('.','_') | |
15 filename = ''.join([base,ext]) | |
16 return filename |