quizzy 0.5.0__py3-none-any.whl → 0.6.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- quizzy/app.py +5 -5
- {quizzy-0.5.0.dist-info → quizzy-0.6.0.dist-info}/METADATA +2 -2
- quizzy-0.6.0.dist-info/RECORD +10 -0
- quizzy-0.5.0.dist-info/RECORD +0 -10
- {quizzy-0.5.0.dist-info → quizzy-0.6.0.dist-info}/WHEEL +0 -0
- {quizzy-0.5.0.dist-info → quizzy-0.6.0.dist-info}/entry_points.txt +0 -0
- {quizzy-0.5.0.dist-info → quizzy-0.6.0.dist-info}/licenses/LICENSE +0 -0
quizzy/app.py
CHANGED
@@ -254,6 +254,7 @@ def get_arg_parser() -> argparse.ArgumentParser:
|
|
254
254
|
)
|
255
255
|
|
256
256
|
parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
|
257
|
+
parser.add_argument("--dump-state-on-exit", action="store_true", help="Dump game state on exit")
|
257
258
|
|
258
259
|
serve_group = parser.add_argument_group("Serve options")
|
259
260
|
serve_group.add_argument("--serve", action="store_true", help="Serve the app through the browser")
|
@@ -277,9 +278,7 @@ def serve_app(host: str, port: int) -> None:
|
|
277
278
|
server.Server(shlex.join(args), host=host, port=port).serve()
|
278
279
|
|
279
280
|
|
280
|
-
def run_app(
|
281
|
-
quiz_file: pathlib.Path,
|
282
|
-
) -> None:
|
281
|
+
def run_app(quiz_file: pathlib.Path, dump_state_on_exit: bool = False) -> None:
|
283
282
|
"""Run the app in the terminal.
|
284
283
|
|
285
284
|
:param quizfile: File to use for this quiz
|
@@ -293,7 +292,8 @@ def run_app(
|
|
293
292
|
try:
|
294
293
|
app.run()
|
295
294
|
finally:
|
296
|
-
|
295
|
+
if dump_state_on_exit:
|
296
|
+
models.dump_config_if_not_finished(config)
|
297
297
|
|
298
298
|
|
299
299
|
def main() -> NoReturn:
|
@@ -303,5 +303,5 @@ def main() -> NoReturn:
|
|
303
303
|
if namespace.serve:
|
304
304
|
serve_app(namespace.host, namespace.port)
|
305
305
|
else:
|
306
|
-
run_app(namespace.quizfile)
|
306
|
+
run_app(namespace.quizfile, namespace.dump_state_on_exit)
|
307
307
|
sys.exit(0)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: quizzy
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.6.0
|
4
4
|
Summary: A Python TUI quiz app
|
5
5
|
Author-email: Jonas Ehrlich <jonas.ehrlich@gmail.com>
|
6
6
|
License-Expression: MIT
|
@@ -16,7 +16,7 @@ Description-Content-Type: text/markdown
|
|
16
16
|
|
17
17
|
A quiz app using [textual](https://textual.textualize.io/).
|
18
18
|
|
19
|
-

|
20
20
|
|
21
21
|
## Configuration and Questions
|
22
22
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
quizzy/__init__.py,sha256=IILIKzO2OO60Rhsh3SqhdKHDf7XI_RLRwzztBGZZmHY,78
|
2
|
+
quizzy/__main__.py,sha256=GiZpRpqbaOVG0pDtJswF_VsLByVFP2VMhHgm0Lm0LWw,36
|
3
|
+
quizzy/app.py,sha256=gO5aGchsu9PLjepdrgcaglHbo2Wc_1B-AFOszpjU--A,11086
|
4
|
+
quizzy/models.py,sha256=CxWOvAi5TbZZK76-aKRIPZhrDbHNM4U3tcrZaQ7xCJs,3189
|
5
|
+
quizzy/quizzy.tcss,sha256=VcPEGQ1J7oGatPf3kB-Hzo9AHQdrI7cOV8hDT_l9-3A,1810
|
6
|
+
quizzy-0.6.0.dist-info/METADATA,sha256=ffwK69fcadxDA5KDfIcdO_OMfKedgPT9y6s6jZ5ASVU,1598
|
7
|
+
quizzy-0.6.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
8
|
+
quizzy-0.6.0.dist-info/entry_points.txt,sha256=2RiVMgcS4h7TM59u9dyBQFm53cG6Eyekmb8fqZ5rXHM,48
|
9
|
+
quizzy-0.6.0.dist-info/licenses/LICENSE,sha256=JWN3MACgsucm6y_rlL_2MUzst0-wNh-Wab3XkxtfVzM,1070
|
10
|
+
quizzy-0.6.0.dist-info/RECORD,,
|
quizzy-0.5.0.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
quizzy/__init__.py,sha256=IILIKzO2OO60Rhsh3SqhdKHDf7XI_RLRwzztBGZZmHY,78
|
2
|
-
quizzy/__main__.py,sha256=GiZpRpqbaOVG0pDtJswF_VsLByVFP2VMhHgm0Lm0LWw,36
|
3
|
-
quizzy/app.py,sha256=x2MYAF9vS_gTu369avqIkwH9n_uN2KrTzEhZO48j2wE,10893
|
4
|
-
quizzy/models.py,sha256=CxWOvAi5TbZZK76-aKRIPZhrDbHNM4U3tcrZaQ7xCJs,3189
|
5
|
-
quizzy/quizzy.tcss,sha256=VcPEGQ1J7oGatPf3kB-Hzo9AHQdrI7cOV8hDT_l9-3A,1810
|
6
|
-
quizzy-0.5.0.dist-info/METADATA,sha256=Tm5z_2q4WNNdQd4g3ciJshTe8XXW4gDaIFxtgW43NsY,1608
|
7
|
-
quizzy-0.5.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
8
|
-
quizzy-0.5.0.dist-info/entry_points.txt,sha256=2RiVMgcS4h7TM59u9dyBQFm53cG6Eyekmb8fqZ5rXHM,48
|
9
|
-
quizzy-0.5.0.dist-info/licenses/LICENSE,sha256=JWN3MACgsucm6y_rlL_2MUzst0-wNh-Wab3XkxtfVzM,1070
|
10
|
-
quizzy-0.5.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|