/getScores is now implemented in api

This commit is contained in:
Joel 2021-03-05 15:45:34 +01:00
parent a7d1fca14a
commit ee9432317a
No known key found for this signature in database
GPG key ID: BDDDBECD0808290E
4 changed files with 16 additions and 3 deletions

View file

@ -34,7 +34,7 @@ fpm -s python --python-bin python3 --python-pip pip3 --python-package-name-prefi
-d "python3-pigpio" \
-d "python3-numpy" \
-d "ffmpeg" \
-v 0.1.0-3 -t deb setup.py
-v 0.1.1-0 -t deb setup.py
# --deb-changelog changelog \
# --deb-upstream-changelog changelog \

View file

@ -14,6 +14,7 @@ API_URL_GET_ITEMS = API_URL + "getItems"
API_URL_GET_PARK = API_URL + "getPark"
API_URL_PAY_PARK = API_URL + "payPark"
API_URL_SIMON_SAYS = API_URL + "simonSays"
API_URL_GET_SCORES = API_URL + "getScores"
class Seeding:
@ -123,3 +124,15 @@ class DoubleElim:
response = json.loads(res.content)
Logging.get_logger().debug(f"DoubleElim.get_items = {response}, status code = {res.status_code}")
return response, res.status_code
@staticmethod
def get_scores() -> Tuple[Dict, int]:
"""Get the current scores
:return: A dictionary with all scores included like: {"self":2,"opponent":0}
:rtype: Tuple[Dict, int]
"""
res = requests.get(API_URL_GET_SCORES)
response = json.loads(res.content)
Logging.get_logger().debug(f"DoubleElim.get_scores = {response}, status code = {res.status_code}")
return response, res.status_code

View file

@ -1,4 +1,4 @@
__version__ = "0.1.0-3"
__version__ = "0.1.1-0"
import compLib.LogstashLogging
import logging

View file

@ -12,7 +12,7 @@ else:
setuptools.setup(
name="complib",
version="0.1.0-3",
version="0.1.1-0",
author="F-WuTs",
author_email="--",
description="",