Skip to content

shell: Polish repl code

Valentin Valls requested to merge clean-up-repl into master

This clean up and move stuffs in order to simplify or to make stuff explicit.

  • Fix typing
    • No more mypy type error for bliss.shell.cli
    • Create a BlissAppSession to store more than what prompt toolkit stores
      • This could be reworked in the future
  • Remove monkey patches
    • The completer is now setup inside BlissRepl
    • The statusbars are still using monkey patching but setup at run time by BlissRepl
  • Reorganize some code from bliss.shell.cli
    • Split a bit more what is about app and lib
    • ... by creating a single class or function into a single module
    • Split repl.py into bliss_repl.py, bliss_app_session.py, bliss_output.py
    • Move session_files_templates.py into bliss.shell.main
    • Create config.py to remove anything from __init__
      • This module will probably grow up in the future to feature persistence
  • Make sure the app session is properly propagated
    • Drop output from the greenlet context and only use app_session
  • The remaining code from bliss.shell.cli.repl.py is about the setup and bootstrap of BlissRepl
    • This could be reworked in the future to split a bit more what is about app and lib
Edited by Valentin Valls

Merge request reports