💄 Enhance UI with colorful text

This commit is contained in:
Brian Wiborg 2023-04-03 19:05:45 +02:00
parent 806e7a56a0
commit e505b0f21c
No known key found for this signature in database
GPG Key ID: BE53FA9286B719D6
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import typer import typer
from arrow import get as arrow_get from arrow import get as arrow_get
from rich import print
from voting import Quorum, QuorumKind, Result, Voting, Vote from voting import Quorum, QuorumKind, Result, Voting, Vote
from voting.storage import Storage from voting.storage import Storage

View File

@ -98,8 +98,12 @@ class Result:
out = [] out = []
if self.voting.quorum.kind != QuorumKind.NONE: if self.voting.quorum.kind != QuorumKind.NONE:
out.append(f"QUORUM: {self.voting.quorum.value}{'%' if self.voting.quorum.kind == QuorumKind.PERCENT else ''}") out.append(f"QUORUM: {self.voting.quorum.value}{'%' if self.voting.quorum.kind == QuorumKind.PERCENT else ''}")
out.append(f"GESAMT: {len(self.voting.votes)} => DAFUER: {votes[Vote.JA.name]} DAGEGEN: {votes[Vote.NEIN.name]} ENTHALTUNGEN: {votes[Vote.ENTHALTUNG.name]}") out.append(f"GESAMTZAHL DER STIMMEN: {len(self.voting.votes)}/{len(self.voting.voters)}")
out.append(f"ERGEBNIS: {self.outcome()}") out.append(f"=> DAFUER: {votes[Vote.JA.name]}")
out.append(f"=> DAGEGEN: {votes[Vote.NEIN.name]}")
out.append(f"=> ENTHALTUNGEN: {votes[Vote.ENTHALTUNG.name]}")
out.append(f"=> ANTRAG: {self.outcome()}")
out.append(f"NICHT TEILGENOMMEN: {', '.join([v for v in self.voting.voters if v not in self.voting.votes])}")
return '\n'.join(out) return '\n'.join(out)
@abc.abstractmethod @abc.abstractmethod