Skip to content

Commit

Permalink
refactor: remove grequests (#33)
Browse files Browse the repository at this point in the history
Signed-off-by: Dup4 <lyuzhi.pan@gmail.com>
  • Loading branch information
Dup4 authored Sep 22, 2024
1 parent bfd0679 commit 7a2e8ca
Show file tree
Hide file tree
Showing 6 changed files with 200 additions and 207 deletions.
2 changes: 0 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
"DOCKERHUB",
"domjudge",
"execjs",
"gevent",
"grequests",
"guilin",
"gxcpc",
"hbcpc",
Expand Down
110 changes: 49 additions & 61 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ classifiers = [
python = "^3.11"
pyyaml = "^6.0"
pyexecjs = "^1.5.1"
grequests = "^0.6.0"
gevent = "^22.10.2"
beautifulsoup4 = "^4.12.2"
lxml = "^4.9.2"
html5lib = "^1.1"
Expand Down
File renamed without changes.
16 changes: 12 additions & 4 deletions xcpcio_board_spider/spider/nowcoder/v1/nowcoder.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
from xcpcio_board_spider.core import utils, logger
from xcpcio_board_spider.type import Contest, Team, Teams, Submission, Submissions, constants

import json

import requests

from xcpcio_board_spider.core import logger, utils
from xcpcio_board_spider.type import (
Contest,
Submission,
Submissions,
Team,
Teams,
constants,
)


class NowCoder:
CONSTANT_RANK_URL = "https://ac.nowcoder.com/acm-heavy/acm/contest/real-time-rank-data"
Expand Down Expand Up @@ -212,7 +220,7 @@ def parse_runs(self):

runs.append(run)

if status == RESULT_CORRECT:
if status == constants.RESULT_CORRECT:
run = Submission()
run.team_id = team_id
run.timestamp = timestamp
Expand Down
Loading

0 comments on commit 7a2e8ca

Please sign in to comment.