forked from Vaughan-Esports/OverlayWriter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget.py
73 lines (55 loc) · 1.54 KB
/
get.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
63
64
65
66
67
68
69
70
71
72
73
from files import *
from config import *
from rich import print as rprint
import click
@click.group(invoke_without_command=True)
@click.pass_context
def get(ctx):
"""- get the contents of file(s)"""
if ctx.invoked_subcommand is None:
ctx.invoke(match)
ctx.invoke(winner)
ctx.invoke(t1)
ctx.invoke(t1s)
ctx.invoke(t2)
ctx.invoke(t2s)
@get.command()
def t1():
"""- print team 1's name"""
rprint(f"{main_colour}Team {t1_colour}1 {main_colour}Name: {arg_colour}"
f"{read(team1F)}")
@get.command()
def t1s():
"""- print team 1's score"""
rprint(f"{main_colour}Team {t1_colour}1 {main_colour}Score: {arg_colour}"
f"{read(team1scoreF)}")
@get.command()
def t2():
"""- print team 2's name"""
rprint(f"{main_colour}Team {t2_colour}2 {main_colour}Name: {arg_colour}"
f"{read(team2F)}")
@get.command()
def t2s():
"""- print team 2's score"""
rprint(f"{main_colour}Team {t2_colour}2 {main_colour}Score: {arg_colour}"
f"{read(team2scoreF)}")
@get.command()
def match():
"""- print the match name"""
rprint(f"{main_colour}Match Name: [green]{read(matchN)}")
@get.command()
def winner():
"""- print the winner name"""
rprint(f"{main_colour}Winner: [green]{read(winnerN)}")
@get.command()
@click.pass_context
def teams(ctx):
"""- print both team's names"""
ctx.invoke(t1)
ctx.invoke(t2)
@get.command()
@click.pass_context
def scores(ctx):
"""- print both team's scores"""
ctx.invoke(t1s)
ctx.invoke(t2s)