Skip to content
This repository has been archived by the owner on Nov 24, 2019. It is now read-only.

Commit

Permalink
Release v0.10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sco1 committed Oct 26, 2018
2 parents 6e57d83 + 5e02699 commit f57e457
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bot/cogs/overwatch.py
Expand Up @@ -123,7 +123,7 @@ def __init__(self, bot):
self._parsername = "OW Patch(es)"
self._loadconverter = str
self._saveconverter = str
self._comparator = "ver"
self._comparator = "verpatch"

async def postembed(self, postobj: OWPatch = None, channelID: int = None):
channelID = channelID if channelID is not None else self.postchannelID
Expand Down
10 changes: 9 additions & 1 deletion bot/models/Overwatch.py
Expand Up @@ -13,6 +13,7 @@ def __init__(
self,
patchref: str = None,
ver: str = None,
verpatch: str = None,
patchdate: datetime = None,
patchURL: URL = None,
bannerURL: URL = None,
Expand All @@ -28,11 +29,12 @@ def __init__(
self.patchref = patchref
self.ver = ver
self.patchdate = patchdate
self.verpatch = verpatch
self.patchURL = patchURL if patchURL is not None else defaultpatchURL
self.bannerURL = bannerURL if bannerURL is not None else defaultbannerURL

def __repr__(self):
return f"OWPatch: v{self.ver}, Released: {datetime.strftime(self.patchdate, '%Y-%m-%d')}"
return f"OWPatch: v{self.verpatch}, Released: {datetime.strftime(self.patchdate, '%Y-%m-%d')}"

@staticmethod
def fromURL(
Expand Down Expand Up @@ -88,6 +90,11 @@ def _parseOWpatchHTML(inHTML: str) -> typing.List:
# Get version number from sidebar using patch reference ID
sidebaritem = soup.select_one(f"a[href=#{patchref}]").parent
ver = sidebaritem.find("h3").get_text().split()[-1]

# Generate full reference from version number & patch reference because
# Blizzard reuses version numbers for some patches
# e.g. 1.29.0.1.51948 and 1.29.0.1.51575
verpatch = f"{ver}.{patchref_num}"

# Get date
dateheader = patch.find("h2", class_="HeadingBanner-header")
Expand Down Expand Up @@ -118,6 +125,7 @@ def _parseOWpatchHTML(inHTML: str) -> typing.List:
OWPatch(
patchref,
ver,
verpatch,
patchdate,
OWPatch.getblizztrack(patchref_num),
patchbanner,
Expand Down

0 comments on commit f57e457

Please sign in to comment.