Mercurial > hg > env-test-daniele
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sawautil/.svn/text-base/Utilities.py.svn-base Wed Mar 06 15:45:48 2013 +0000 @@ -0,0 +1,16 @@ +import os + +# ============================================ +# Some global utility functions +# ============================================ + +def convertFilename(upload_filename): + # we don't have to convert everything to unicode. It works just fine. + # upload_filename = upload_filename.decode('utf-8') + filename = upload_filename.replace('\\','/').replace(' ','_') + filename = os.path.basename(filename) + #remove additional dots since that confuses sonic annotator + base,ext = os.path.splitext(filename) + base = base.replace('.','_') + filename = ''.join([base,ext]) + return filename