This repository has been archived by the owner on Jun 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
set.py
62 lines (48 loc) · 1.51 KB
/
set.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from files import *
from config import *
from rich import print as rprint
import click
@click.group()
def set():
"""- write to file(s)"""
pass
@set.command()
@click.argument('name', nargs=-1)
def t1(name):
"""- change team 1's name"""
write(team1F, " ".join(name))
rprint(f"{main_colour}Team {t1_colour}1 {main_colour}Name: {arg_colour}"
f"{read(team1F)}")
@set.command()
@click.argument('score')
def t1s(score):
"""- change team 1's score"""
write(team1scoreF, score)
rprint(f"{main_colour}Team {t1_colour}1 {main_colour}Score: {arg_colour}"
f"{read(team1scoreF)}")
@set.command()
@click.argument('name', nargs=-1)
def t2(name):
"""- change team 2's name"""
write(team2F, " ".join(name))
rprint(f"{main_colour}Team {t2_colour}2 {main_colour}Name: {arg_colour}"
f"{read(team2F)}")
@set.command()
@click.argument('score')
def t2s(score):
"""- change team 2's score"""
write(team2scoreF, score)
rprint(f"{main_colour}Team {t2_colour}2{main_colour} Score: {arg_colour}"
f"{read(team2scoreF)}")
@set.command()
@click.argument('match_name', nargs=-1)
def match(match_name):
"""- change the match name"""
write(matchN, " ".join(match_name))
rprint(f"{main_colour}Match Name: {arg_colour}{read(matchN)}")
@set.command()
@click.argument('winner_name', nargs=-1)
def winner(winner_name):
"""- change the winner name"""
write(winnerN, " ".join(winner_name))
rprint(f"{main_colour}Winner: {arg_colour}{read(winnerN)}")