-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.0-EXP' of https://github.com/Rexeh/joystick-diagrams …
…into 2.0-EXP
- Loading branch information
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
""" Update service for Joystick Diagrams | ||
Author: Robert Cox | ||
""" | ||
import requests | ||
|
||
SERVER_URL = "http://localhost:5000/api/v1/version/" | ||
|
||
|
||
def get_current_version() -> str: | ||
"""Get current version from file""" | ||
return "1.0.0" | ||
|
||
|
||
def check_server_version() -> str: | ||
"""Query API with current version, and handle response""" | ||
current_version = get_current_version() | ||
response = requests.get(SERVER_URL + current_version) | ||
if response.status_code == 200: | ||
return response.json() | ||
else: | ||
return "Error" | ||
|
||
|
||
def check_templates_hash() -> bool: | ||
"""Check the hash of the templates directory against API hash""" | ||
|
||
|
||
if __name__ == "__main__": | ||
pass |