forked from Vaughan-Esports/OverlayWriter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswap.py
33 lines (27 loc) · 776 Bytes
/
swap.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
from files import *
from config import *
from rich import print as rprint
import click
@click.group(invoke_without_command=True)
@click.pass_context
def swap(ctx):
"""- swap the text in file(s)"""
if ctx.invoked_subcommand is None:
ctx.invoke(teams)
ctx.invoke(scores)
@swap.command()
def teams():
"""- swap team names"""
team1_name = read(team1F)
team2_name = read(team2F)
write(team1F, team2_name)
write(team2F, team1_name)
rprint(f"{main_colour}Swapped team names.")
@swap.command()
def scores():
"""- swap team scores"""
team1_score = read(team1scoreF)
team2_score = read(team2scoreF)
write(team1scoreF, team2_score)
write(team2scoreF, team1_score)
rprint(f"{main_colour}Swapped team scores.")