Mercurial > hg > env-test-daniele
view sawautil/Utilities.py @ 21:a647bd7dd38d
added auto commit scrip
author | gyorgyf |
---|---|
date | Tue, 19 Mar 2013 16:50:54 +0000 |
parents | 032bc65ebafc |
children |
line wrap: on
line source
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