trimbom.py
#!/usr/bin/python
#coding=utf-8
import os
import sys
import codecs
class RemoveBom:
basePath = ''
fileList = []
trimExtList = []
def showMessages(self):
print 'the Path is [',self.basePath,']'
n = ''
for ext in self.trimExtList:
n+=ext
n+=' '
print 'the Exts is [' ,n,']'
def trimFile(self,name):
file = open(name,'rb')
content = file.read(3)
if content != '\xEF\xBB\xBF':
return False
content = file.read()
file.close()
file = open(name,'wb')
file.write(content)
file.close
print 'convert ',name,' finish'
return True
def getFileList(self,p