修正sort的错误
This commit is contained in:
parent
ec2e15a11d
commit
f2a8ad725c
4
app.py
4
app.py
|
|
@ -67,7 +67,11 @@ def parse_trustie(PR_url, error):
|
|||
|
||||
repo_info, pr_num = url_2_repo(PR_url)
|
||||
scores = detect_trustie.main(repo_info, pr_num, url_head)
|
||||
for i in scores:
|
||||
i["avg_score"] = float(i["avg_score"])
|
||||
scores = sorted(scores, key=operator.itemgetter("avg_score"), reverse=True)
|
||||
for i in scores:
|
||||
i["avg_score"] = str(i["avg_score"])
|
||||
|
||||
if scores is None:
|
||||
error = 1
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ def crawl_file_to_pr(all_pr_info, repo, url_head):
|
|||
response = requests.get(file_url, headers=header, stream=True)
|
||||
r = response.json()
|
||||
pr["files"] = r
|
||||
# print(pr)
|
||||
|
||||
return all_pr_info
|
||||
|
||||
|
|
@ -74,7 +73,6 @@ def crawl_all_pr(url):
|
|||
|
||||
|
||||
def detect_text_file_dup(all_pr_info, project_key, pr_num):
|
||||
print(r.get(project_key + "_" + str(pr_num)))
|
||||
current_pr_value = json.loads(r.get(project_key + "_" + str(pr_num)))
|
||||
current_word = jieba.lcut(current_pr_value["title"] + " " + current_pr_value['description'])
|
||||
current_word = [x.strip() for x in current_word if x.strip() != '']
|
||||
|
|
|
|||
Loading…
Reference in New Issue