a-hurst / klibs

A simple Python framework for writing cognitive psychology experiments
7 stars 1 forks source link

Clean up CLI interface code #16

Closed a-hurst closed 2 years ago

a-hurst commented 2 years ago

PR Description

This PR cleans up the KLibs CLI code and fixes a few bugs, but also makes the klibs CLI interface much faster to use by ensuring SDL2 and other external dependencies don't need to be loaded unless actually running an experiment. This means that klibs -h shows the help text near-instantly instead of having noticeable lag, and functions like klibs export and klibs db-rebuild are notably more responsive.

Apart from ensuring the main CLI only loads slower dependencies during actual runtime, the other main architectural change here is that the CLI code for handling and prompting users about a missing database has been moved to cli.py, meaning that all user-facing CLI functionality are now contained in cli.py and __main__.py.

Merge Checklist