Commit 78b8fc9a authored by 张彦钊's avatar 张彦钊

change test file

parent 0f3cdc3d
......@@ -86,15 +86,22 @@ def tag_boost(cid_str, tag_list=[15,21,22,85,86]):
cursor = db.cursor()
cursor.execute(sql)
result = cursor.fetchall()
print(result)
# if len(result) > 0:
# cid_tag = {}
# for i in result:
# cid_tag[i[0]] = i[1]
# if
#
# else:
# return cid_str
if len(result) > 0:
tag_cids = {}
left_cids = []
for i in result:
tmp = i[1].split(",")
tag_cids[i[0]] = tmp
left_cids.extend(tmp)
print(tag_cids)
left_cids = list(set(left_cids))
right_cids = [i for i in cids if i not in left_cids]
print(len(left_cids))
print(len(right_cids))
print(cids)
else:
return cid_str
else:
return cid_str
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment