Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #80 from LeagueOfPoro/version-manager
Browse files Browse the repository at this point in the history
Check for updates
  • Loading branch information
LeagueOfPoro committed Oct 10, 2022
2 parents a2a10dc + d95365c commit 353d17a
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 96 deletions.
17 changes: 17 additions & 0 deletions EsportsCapsuleFarmer/Setup/VersionManager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import requests as req

class VersionManager:

@staticmethod
def getLatestTag():
latestTagResponse = req.get("https://api.github.com/repos/LeagueOfPoro/EsportsCapsuleFarmer/releases/latest")
if 'application/json' in latestTagResponse.headers.get('Content-Type', ''):
latestTagJson = latestTagResponse.json()
if "tag_name" in latestTagJson:
return float(latestTagJson["tag_name"][1:])
return 0.0
@staticmethod
def isLatestVersion(currentVersion):
return currentVersion >= VersionManager.getLatestTag()

print(VersionManager.isLatestVersion(3.8))
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name = "pypi"
selenium = "*"
pyyaml = "*"
selenium-driver-updater = "*"
requests = "*"

[dev-packages]
pyinstaller = "*"
Expand Down
166 changes: 72 additions & 94 deletions Pipfile.lock

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

Loading

0 comments on commit 353d17a

Please sign in to comment.