Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove unnecessary print statements #371

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion hinghwa-dict-backend/AudioCompare/Matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ def match(self):
else:
with open(os.path.join(os.getcwd(), "submit结果存储.pkl"), "rb") as f:
dir2_results = pickle.load(f)
print(len(dir2_results))
# Wait for pool to finish processing
# pool.close()
# pool.join()
Expand Down
1 change: 0 additions & 1 deletion hinghwa-dict-backend/AudioCompare/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def audio_matcher(args: Arg):
if filename not in a:
a[filename] = []
a[filename].append((os.path.split(match.file2)[-1], match.score))
# print(match)
for file1 in a.keys():
a[file1].sort(key=lambda x: x[1], reverse=True)
ans[file1] = a[file1][0][0] if a[file1][0][1] > 0 else None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def post(self, request):
record.quiz = quiz
record.contributor = contributor
record.timestamp = timezone.now()
print("test")
record.save()
return JsonResponse(quiz_record(record), status=200)

Expand Down
3 changes: 0 additions & 3 deletions hinghwa-dict-backend/user/view/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ def put(self, request, id):
user = get_user_by_id(id)
body = demjson3.decode(request.body)
info = body["user"]
print(info)
print(info["town"])
print(info["county"])
user_info_form = UserInfoForm(info)
if not user_info_form.is_valid:
raise ValueError
Expand Down
1 change: 0 additions & 1 deletion hinghwa-dict-backend/utils/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def get_request_user(request: request) -> User:
return AnonymousUser()
# get user
user = User.objects.get(id=info["id"])
print(user.username)
# exam username
if user.username != info["username"]:
return AnonymousUser()
Expand Down
2 changes: 0 additions & 2 deletions hinghwa-dict-backend/website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,6 @@ def test(request):
if ipa not in dic:
dic[ipa] = []
dic[ipa].append(music[start:end])
print(line[0])
sum = 0
for i in dic.values():
sum += len(i)
Expand All @@ -805,7 +804,6 @@ def test(request):
for i, music in zip(range(1, len(musics)), musics[1:]):
path = os.path.join(result, ipa + f"-{i}.mp3")
music.export(path, format="mp3")
print(idx)
return JsonResponse({}, status=200)
except Exception as e:
return JsonResponse({"msg": str(e)}, status=500)
Comment on lines 808 to 809
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这种整个函数都是try catch 的 其实现在都可以去掉了x

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

主要是泡泡说让我清一下issue 所以就清了一下(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

噢 忘记加type了

Loading