Skip to content
Open
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
23 changes: 8 additions & 15 deletions lolstaticdata/champions/pull_champions_wiki.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Tuple, List, Union, Iterator, Dict
import re
from bs4 import BeautifulSoup
from collections import Counter
from slpp import slpp as lua
from datetime import datetime

Expand All @@ -14,16 +13,9 @@
Armor,
MagicResistance,
AttackDamage,
AbilityPower,
AttackSpeed,
AttackRange,
Movespeed,
Lethality,
CooldownReduction,
GoldPer10,
HealAndShieldPower,
Lifesteal,
MagicPenetration,
Stat,
)
from ..common.utils import (
Expand Down Expand Up @@ -732,11 +724,12 @@ def _render_modifiers(self, mods: str, nvalues: int) -> List[Modifier]:
except Exception as error:
print(f"ERROR: FAILURE TO PARSE MODIFIER: {lvling}")
print("ERROR:", error)
modifier = Modifier(
values=[0 for _ in range(nvalues)],
units=[lvling for _ in range(nvalues)],
)
modifiers.append(modifier)
if nvalues is not None:
modifier = Modifier(
values=[0 for _ in range(nvalues)],
units=[lvling for _ in range(nvalues)],
)
modifiers.append(modifier)
return modifiers

def _render_modifier(self, mod: str, nvalues: int) -> Modifier:
Expand All @@ -763,7 +756,7 @@ def _render_ability_cooldown(self, mods: str, static_cooldown: bool, nvalues: in
def _get_sale(self):

get_prices = re.compile(r"(\d+) (\d+)")
url = f"https://wiki.leagueoflegends.com/en-us/Sales"
url = "https://wiki.leagueoflegends.com/en-us/Sales"
html = download_soup(url, False)
soup = BeautifulSoup(html, "lxml")
spans = soup.findAll("div", {"class": "skin_portrait skin-icon"})
Expand Down Expand Up @@ -816,7 +809,7 @@ def _get_chroma_attribs(self, id, name):
print(f"Chroma Mismatch: {id} not available in {available}")

def _get_skins(self):
url = f"https://wiki.leagueoflegends.com/en-us/Module:SkinData/data"
url = "https://wiki.leagueoflegends.com/en-us/Module:SkinData/data"

html = download_soup(url, False)
soup = BeautifulSoup(html, "lxml")
Expand Down