Media gallery improvements

svn: r1165
This commit is contained in:
Don Allingham
2002-11-05 04:15:04 +00:00
parent 2eacdd41e6
commit 2f9f1660ee
5 changed files with 8 additions and 19 deletions

View File

@@ -42,11 +42,12 @@ TABLE = string.maketrans('ABCDEFGHIJKLMNOPQRSTUVWXYZ',
def soundex(str):
"Return the soundex value to a string argument."
str = string.strip(string.upper(str))
str = str.upper().strip()
if not str:
return "Z000"
str = str.encode('iso-8859-1')
str2 = str[0]
str = string.translate(str, TABLE, IGNORE)
str = str.translate(TABLE, IGNORE)
if not str:
return "Z000"
prev = str[0]