drothlis/stb-tester — pull request #217 by drothlis (2014-09-01 09:19:12+00:00)
Title: Convert `stbt` module into Python package

This allows us to split up the functionality like `import stbt.control`, `import stbt.config`.
It keeps the python files a bit easier to manage (stbt.py is at 3k+ lines).
It allows us to more explicitly define the interfaces between different parts of the code.
And I think it will allow us to package certains parts independently (for example packaging stbt/control.py with fake-lircd when we don't want the rest of stbt and all of its dependencies).

Still to do (but this doesn't necessarily need doing before merging now):

- [ ] Split out `stbt.imgproc` helpers.
- [ ] Split out `stbt.ocr` module (need a name for it that won't conflict with the `stbt.ocr()` function -- maybe `_ocr`).
- [ ] Split out GStreamer internals / helpers.
- [ ] Move `GObject.threads_init()` and `Gst.init()` into `stbt.init_run` so that `import stbt.config` doesn't do GStreamer initialisation unnecessarily.
- [ ] Maybe move the rest of the code into `stbt/core.py` and keep `stbt/__init__.py` as a simple list of imports and `__all__` declaration.

But I'd like to merge what I have as soon as it's acceptable, because rebasing this work is a pain. There's about a person-day's work here, not including the work @wmanley already did in #201.

This supersedes #201.