Exemple #1
0
def read(filename) :

	hash = {}
	try :
		(ok, content) = FileIO.full_read(filename)
		if not ok : return ( 0, filename + ' not founc')
		content = content.replace('\n\t', '')
		lines = content.split('\n')
		for line in lines :
			v = line.rstrip().split(':')
			if(len(v) != 2) : continue
			hash[v[0].lower()] = v[1][1:]

		return (1 , hash)
	except :
		t, v, tb = sys.exc_info()
		print 'MailHeader read(%s)' % v
		flag = 0 

	return (0, hash)