borse 0.1.1__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- borse/__about__.py +1 -1
- borse/game.py +10 -2
- borse/progress.py +21 -0
- {borse-0.1.1.dist-info → borse-0.2.0.dist-info}/METADATA +3 -3
- {borse-0.1.1.dist-info → borse-0.2.0.dist-info}/RECORD +8 -8
- {borse-0.1.1.dist-info → borse-0.2.0.dist-info}/WHEEL +0 -0
- {borse-0.1.1.dist-info → borse-0.2.0.dist-info}/entry_points.txt +0 -0
- {borse-0.1.1.dist-info → borse-0.2.0.dist-info}/licenses/LICENSE +0 -0
borse/__about__.py
CHANGED
borse/game.py
CHANGED
|
@@ -119,20 +119,28 @@ class Game:
|
|
|
119
119
|
]
|
|
120
120
|
|
|
121
121
|
while True:
|
|
122
|
-
row = self.draw_title("BORSE -
|
|
122
|
+
row = self.draw_title("BORSE - Braille mORse SEmaphore, by vEnhance")
|
|
123
123
|
height, _ = self.stdscr.getmaxyx()
|
|
124
124
|
|
|
125
|
-
# Show today's progress
|
|
125
|
+
# Show today's progress and all-time total
|
|
126
126
|
today = self.progress.get_today()
|
|
127
|
+
alltime = self.progress.get_alltime_by_mode()
|
|
127
128
|
progress_text = (
|
|
128
129
|
f"Today: {today.total_words} words "
|
|
129
130
|
f"(B:{today.braille_words} M:{today.morse_words} "
|
|
130
131
|
f"S:{today.semaphore_words} A:{today.a1z26_words})"
|
|
131
132
|
)
|
|
133
|
+
alltime_text = (
|
|
134
|
+
f"All-time: {alltime.total_words} words "
|
|
135
|
+
f"(B:{alltime.braille_words} M:{alltime.morse_words} "
|
|
136
|
+
f"S:{alltime.semaphore_words} A:{alltime.a1z26_words})"
|
|
137
|
+
)
|
|
132
138
|
try:
|
|
133
139
|
if curses.has_colors():
|
|
134
140
|
self.stdscr.attron(curses.color_pair(3))
|
|
135
141
|
self.stdscr.addstr(row, 2, progress_text)
|
|
142
|
+
row += 1
|
|
143
|
+
self.stdscr.addstr(row, 2, alltime_text)
|
|
136
144
|
if curses.has_colors():
|
|
137
145
|
self.stdscr.attroff(curses.color_pair(3))
|
|
138
146
|
except curses.error:
|
borse/progress.py
CHANGED
|
@@ -90,6 +90,27 @@ class Progress:
|
|
|
90
90
|
self.daily[today] = DailyProgress()
|
|
91
91
|
return self.daily[today]
|
|
92
92
|
|
|
93
|
+
def get_alltime_total(self) -> int:
|
|
94
|
+
"""Get total words answered across all days.
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
Sum of all words across all days.
|
|
98
|
+
"""
|
|
99
|
+
return sum(day.total_words for day in self.daily.values())
|
|
100
|
+
|
|
101
|
+
def get_alltime_by_mode(self) -> DailyProgress:
|
|
102
|
+
"""Get all-time totals broken down by mode.
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
DailyProgress with summed values across all days.
|
|
106
|
+
"""
|
|
107
|
+
return DailyProgress(
|
|
108
|
+
morse_words=sum(day.morse_words for day in self.daily.values()),
|
|
109
|
+
braille_words=sum(day.braille_words for day in self.daily.values()),
|
|
110
|
+
semaphore_words=sum(day.semaphore_words for day in self.daily.values()),
|
|
111
|
+
a1z26_words=sum(day.a1z26_words for day in self.daily.values()),
|
|
112
|
+
)
|
|
113
|
+
|
|
93
114
|
def add_word(self, mode: str) -> None:
|
|
94
115
|
"""Add a completed word for today.
|
|
95
116
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: borse
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Practice braille, Morse, semaphore.
|
|
5
5
|
Project-URL: repository, https://github.com/vEnhance/borse
|
|
6
6
|
Author-email: Evan Chen <evan@evanchen.cc>
|
|
@@ -115,10 +115,10 @@ Set up by cloning the repository and running
|
|
|
115
115
|
|
|
116
116
|
```bash
|
|
117
117
|
uv sync
|
|
118
|
-
uv run prek install
|
|
118
|
+
uv run prek install # pre-commit hooks
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
To manually run the linter and tests
|
|
121
|
+
To manually run the linter and tests:
|
|
122
122
|
|
|
123
123
|
```bash
|
|
124
124
|
uv run prek --all-files # run linter
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
borse/WORDS.txt,sha256=eEjDg7tmTgtFzhQMQrSNx58UdPpPmnax7JZIHjRGA5g,40575
|
|
2
|
-
borse/__about__.py,sha256=
|
|
2
|
+
borse/__about__.py,sha256=g5qw0caFJh2-7xXbEXwcVoVjcpswDiDdFojVMcRa4As,67
|
|
3
3
|
borse/__init__.py,sha256=M5ARPgePzj8zEaqyk11jzt0RtDD5nbhA2KPS31vGJRk,109
|
|
4
4
|
borse/a1z26.py,sha256=BmkTTxeCu4fvjFRMDSZktJWu0E169H32uga1khkl7gY,964
|
|
5
5
|
borse/braille.py,sha256=h1q_r_4Am3_RswL3gqsa5Mm076RU0vSY7TSsQ72ExZQ,2642
|
|
6
6
|
borse/config.py,sha256=eUDNRkxTIQRRpCnm9P3tQgFKjS4f2MF5-lNZFtt78Jg,3695
|
|
7
|
-
borse/game.py,sha256=
|
|
7
|
+
borse/game.py,sha256=7gqwBYGJfQvsBv_0f2EpN-vqEn8-0_tlPochFnfy1IE,17699
|
|
8
8
|
borse/main.py,sha256=peNdARRdBjtCP0rg2_hjq1GRkESWQhfxxAuGMYxyCkw,535
|
|
9
9
|
borse/morse.py,sha256=nh7ptvXaoIHoUN_eval0-nZRd4oWyDNpDdnxsclx9F0,1818
|
|
10
|
-
borse/progress.py,sha256=
|
|
10
|
+
borse/progress.py,sha256=Ba293Z7pzl5g6L8y4gePMAaJM3rC7XkIpff8An_vVMs,5184
|
|
11
11
|
borse/semaphore.py,sha256=mdU1siRkW4eAAgtCuSdc7aMCr2-DbZOwgmzpGnism8I,3855
|
|
12
12
|
borse/words.py,sha256=3YifBii9OuMI2eHXAtvENxVM5n0T4eyZTU-NJ7EPmtQ,1023
|
|
13
|
-
borse-0.
|
|
14
|
-
borse-0.
|
|
15
|
-
borse-0.
|
|
16
|
-
borse-0.
|
|
17
|
-
borse-0.
|
|
13
|
+
borse-0.2.0.dist-info/METADATA,sha256=e2ag04jhjzdylDPsaeDlmJB9Zb_DoPbCv0SVa56BOlw,4199
|
|
14
|
+
borse-0.2.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
15
|
+
borse-0.2.0.dist-info/entry_points.txt,sha256=e3JYLL_H22Xgqe3_TyecetryyyE2kt07nBOGz4T41Ic,42
|
|
16
|
+
borse-0.2.0.dist-info/licenses/LICENSE,sha256=gq-dD45uKs1sNrFCbrHXC8PpsWoSauIPzU-NEQHmTEc,1066
|
|
17
|
+
borse-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|