We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
homeId = int(re.search(r"^/team/([0-9]+)-[\w-]+$", match["HomeTeam"]["Link"]).group(1)) # type: ignore # pylint: disable=line-too-long
awayId = int(re.search(r"^/team/([0-9]+)-[\w-]+$", match["AwayTeam"]["Link"]).group(1)) # type: ignore # pylint: disable=line-too-long
cevlib/cevlib/competitions.py
Line 258 in 6fa393b
@property def pools(self) -> List[Pool]: return self._pools def get(self, index: int) -> Optional[Pool]: """pools[index]""" return self.pools[index] if index < len(self.pools) else None @staticmethod def ParsePool(pool: Dict[str, Any], competition: CompetitionLink, standings: Optional[StandingsPool]) -> Pool: pdex = DictEx(pool) draws: List[List[CalendarMatch]] = [ ] for match in pdex.ensureList("Results"): mdex = DictEx(match) homeId = 0 awayId = 0 try: # TODO safer regex solution homeId = int(re.search(r"^\/team\/([0-9]+)-[\w-]+$", match["HomeTeam"]["Link"]).group(1)) # type: ignore # pylint: disable=line-too-long awayId = int(re.search(r"^\/team\/([0-9]+)-[\w-]+$", match["AwayTeam"]["Link"]).group(1)) # type: ignore # pylint: disable=line-too-long except Exception as exc: print(exc) newMatch = CalendarMatch(mdex.ensureString("MatchCentreUrl"), CompetitionModel.BuildPlain(competition.name, competition.gender, season = str(competition.age) if competition.age else None, phase = pdex.ensureString("Name"), matchNumber = mdex.ensureString("MatchName")), Team.Build(mdex.ensureDictChain("HomeTeam").ensureString("Name"), mdex.ensureDictChain("HomeTeam").ensureDictChain("Logo").ensureString("Name"), "N/A", True, homeId), Team.Build(mdex.ensureDictChain("AwayTeam").ensureString("Name"), mdex.ensureDictChain("AwayTeam").ensureDictChain("Logo").ensureString("Name"), "N/A", False, awayId), mdex.ensureString("Location"), mdex.ensureString("MatchDateTime"), Result.ParseFromForm(match), mdex.ensureBool("IsComplete")) newDraw = True for draw in draws: if draw[0].awayTeam.name == newMatch.homeTeam.name and \ draw[0].homeTeam.name == newMatch.awayTeam.name: newDraw = False draw.append(newMatch) break if newDraw: draws.append([newMatch]) return Pool(pdex.ensureString("Name"), [ Draw([ match for match in draw ]) for draw in draws ], standings) def __repr__(self) -> str: return f"(cevlib.competitions.Round) {self._name} ({len(self.pools)} pools)" def toJson(self) -> Dict[str, Any]: return { "name": self._name, "pools": [ pool.toJson() for pool in self._pools ]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
homeId = int(re.search(r"^/team/([0-9]+)-[\w-]+$", match["HomeTeam"]["Link"]).group(1)) # type: ignore # pylint: disable=line-too-long
awayId = int(re.search(r"^/team/([0-9]+)-[\w-]+$", match["AwayTeam"]["Link"]).group(1)) # type: ignore # pylint: disable=line-too-long
cevlib/cevlib/competitions.py
Line 258 in 6fa393b
The text was updated successfully, but these errors were encountered: