1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

Add basic recommend feature

This commit is contained in:
xiez
2012-08-10 21:16:55 +08:00
parent 354b1154a4
commit bfefa7df70
13 changed files with 160 additions and 28 deletions

View File

@@ -297,14 +297,15 @@ def get_ccnet_server_addr_port():
"""get ccnet server host and port"""
return CCNET_SERVER_ADDR, CCNET_SERVER_PORT
def emails2list(emails):
def string2list(string):
"""
Split email strings contacted with diffent separator.
Split strings contacted with diffent separator to a list, and remove
duplicated string.
"""
email_str = emails.replace(';', ',').replace('\n', ',').replace('\r', ',')
# Remove empty strings and duplicate emails
tmp_str = string.replace(';', ',').replace('\n', ',').replace('\r', ',')
# Remove empty and duplicate strings
s = set()
for e in email_str.split(','):
for e in tmp_str.split(','):
e = e.strip(' ')
if not e:
continue