quizzy 0.5.0__py3-none-any.whl → 0.6.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.
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
- models.dump_config_if_not_finished(config)
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.5.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
- ![Question board](assets/question-board.png)
19
+ ![Question board](assets/game.gif)
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,,
@@ -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