api position objects now implements __str__ and __repr__
This commit is contained in:
parent
08675bdc5c
commit
a7d1fca14a
4 changed files with 10 additions and 4 deletions
|
@ -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-0 -t deb setup.py
|
||||
-v 0.1.0-3 -t deb setup.py
|
||||
|
||||
# --deb-changelog changelog \
|
||||
# --deb-upstream-changelog changelog \
|
||||
|
|
|
@ -65,6 +65,12 @@ class Position:
|
|||
self.y = y
|
||||
self.degrees = degrees
|
||||
|
||||
def __repr__(self):
|
||||
return f"Position(x={self.x}, y={self.y}, degrees={self.degrees})"
|
||||
|
||||
def __str__(self):
|
||||
return f"Position(x={round(self.x, 5)}, y={round(self.y, 5)}, degrees={round(self.degrees, 5)})"
|
||||
|
||||
|
||||
class DoubleElim:
|
||||
"""Class used for communicating with double elimination api
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
__version__ = "0.1.0-0"
|
||||
__version__ = "0.1.0-3"
|
||||
|
||||
import compLib.LogstashLogging
|
||||
import logging
|
||||
|
@ -8,7 +8,7 @@ try:
|
|||
__versions = apt.Cache()["python3-complib"].versions
|
||||
if len(__versions) != 1:
|
||||
print(f"Starting compLib! \033[91mVersion: {__version__} is outdated\033[0m\n"
|
||||
f"\033[92m[!] run the command 'apt update && apt install python3-complib' to install the newest version\033[0m")
|
||||
f"\033[92m[!] run the command 'sudo apt update && sudo apt install python3-complib' to install the newest version\033[0m")
|
||||
else:
|
||||
print(f"Starting compLib! \033[92mVersion: {__version__} is up to date\033[0m")
|
||||
except Exception as e:
|
||||
|
|
2
setup.py
2
setup.py
|
@ -12,7 +12,7 @@ else:
|
|||
|
||||
setuptools.setup(
|
||||
name="complib",
|
||||
version="0.1.0-0",
|
||||
version="0.1.0-3",
|
||||
author="F-WuTs",
|
||||
author_email="--",
|
||||
description="",
|
||||
|
|
Reference in a new issue