Ref https://wiki.gnome.org/Projects/PyGObject/Threading
"The requirement to call GObject.threads_init() has been removed from
PyGObject 3.10.2 when using Python native threads with GI (via the
threading module) as well as with GI repositories which manage their own
threads that may call back into Python (like GStreamer callbacks). The
GObject.threads_init() function will still exist for the entire 3.x
series for compatibility reasons but emits a deprecation warning."
This allows us to do more of the data loading that might fail safely in the
mopidy.ext module instead of having things spread all over the place.
Note that only minimal changes have been made to __main__ to make things work.
Further refactoring should follow.
...instead of hooking handlers onto multiple loggers with disabled propagation
from those loggers to parent loggers, breaking alternative log methods, like
custom setups through the the logging/config_file config value.
Fixes#661
Extension's setup method are now passed the active registry allowing them to
"steal" a list of the registry items they care about. In the case of commands
the registry is passed via args.registry.
This must be done early in the process life cycle to have any effect. In the
MPRIS frontend code is too late. Right before the GObject loop is created in
RootCommand.run() is also too late.
Fixesmopidy/mopidy-mpris#2
- Moves all startup code from start() into mopidy.commands
- Moves deps and config to mopidy.commands
- Plugs in use of commands parsing provided by new helpers
- Allows commands to override base verbosity level
- Removes defunct bootstrap logging helper.
- Bunch of typos and wording improvements from review.
- Fixed mopidy.backends.local.scan botched merge.
- Document and enforce that sub-command name needs to be bytes.
The delayed handler:
- Accepts and buffers logs until they are released.
- Upon release the logs are re-posted to the root logger.
- After release log records are ignored.
This allows us to avoid the silly tricks we've been doing with parsing args and
config early for the sake of bootstraping logging. Now we can just start
logging and once the logging has been setup the messages are released and
handled according to the correct settings.
- show-deps replaced with 'mopidy deps'
- show-config replaced with 'mopidy config'
- Just running mopidy now displays help, run 'mopidy run' to start server.