Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
added clear scores and teams with default flags
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonnly committed Nov 22, 2020
1 parent 075708a commit 7dc22c9
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 5 deletions.
22 changes: 22 additions & 0 deletions clear.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,25 @@ def match():
"""- clear match name"""
write(matchN, "")
rprint(f"{main_colour}Cleared match name.")


@clear.command()
@click.option('-d', '--default', is_flag=True)
@click.pass_context
def scores(ctx, default):
"""- clear both team scores"""
if default:
write(team1scoreF, "0")
write(team2scoreF, "0")
rprint(f"{main_colour}Set team {t1_colour}1 {main_colour}and {t2_colour}2 {main_colour}scores to {arg_colour}0")
else:
ctx.invoke(t1s)
ctx.invoke(t2s)


@clear.command()
@click.pass_context
def teams(ctx):
"""- clear both team names"""
ctx.invoke(t1)
ctx.invoke(t2)
1 change: 1 addition & 0 deletions textFiles/match.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Testing Match
2 changes: 1 addition & 1 deletion textFiles/team1.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hello world team
Team 1
2 changes: 1 addition & 1 deletion textFiles/team1score.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2
0
1 change: 1 addition & 0 deletions textFiles/team2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Team 2
1 change: 1 addition & 0 deletions textFiles/team2score.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
6 changes: 3 additions & 3 deletions writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def t2s(score):


@set.command()
@click.argument('match')
def m(match):
@click.argument('match_name', nargs=-1)
def match(match_name):
"""- change the match name"""
write(matchN, " ".join(match))
write(matchN, " ".join(match_name))
rprint(f"{main_colour}Match Name: {arg_colour}{read(matchN)}")

0 comments on commit 7dc22c9

Please sign in to comment.