💄 Enhance UI with colorful text
This commit is contained in:
parent
806e7a56a0
commit
e505b0f21c
2 changed files with 7 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue