Skip to content

Commit

Permalink
feat: support location
Browse files Browse the repository at this point in the history
Signed-off-by: Dup4 <lyuzhi.pan@gmail.com>
  • Loading branch information
Dup4 committed Oct 15, 2023
1 parent 0200825 commit bbab4ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions xcpcio_board_spider/spider/csg_cpc/v1/csg_cpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def parse_teams(self):
name = raw_team["name"]
school = raw_team["school"]
members = raw_team["tmember"].split("、")
coach = raw_team["coach"]
coach = str(raw_team["coach"])
kind = int(raw_team["tkind"])
room = str(raw_team["room"])

Expand All @@ -69,7 +69,9 @@ def parse_teams(self):
team.organization = school
team.members = members
team.coach = coach
team.location = room

if len(room) > 0:
team.location = room

if kind == 0:
team.official = True
Expand Down
5 changes: 4 additions & 1 deletion xcpcio_board_spider/type/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self,
official: bool = False,
unofficial: bool = False,
girl: bool = False,
location: str = "",
location: str = None,
extra: typing.Dict[str, typing.Any] = None):
self.team_id = team_id
self.name = name
Expand Down Expand Up @@ -54,6 +54,9 @@ def get_dict(self):
if self.girl is not None:
obj[constants.TEAM_TYPE_GIRL] = self.girl

if self.location is not None:
obj["location"] = self.location

return obj

@property
Expand Down

0 comments on commit bbab4ac

Please sign in to comment.