Commit Graph

222 Commits

Author SHA1 Message Date
Thomas Adamcik
c199fb1c81 lint: Workaround and fix to account for new version of flake8 2016-07-25 21:16:30 +02:00
Stein Magnus Jodal
3a7e7cdde0 process: Rename exit_handler() to sigterm_handler() 2016-02-10 21:34:37 +01:00
Stein Magnus Jodal
d9f53d5da3 gst1: Move all gi imports to a helper module 2016-02-01 23:09:28 +01:00
Stein Magnus Jodal
eb4c742015 gst1: Run gst.init() if needed everywhere using Gst 2016-01-31 21:07:16 +01:00
Stein Magnus Jodal
592f5dec53 gst1: Remove deprecated GObject.threads_init()
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."
2016-01-31 21:07:16 +01:00
Stein Magnus Jodal
fc54a17b44 gst1: require_version('Gst', '1.0') before use 2016-01-31 21:07:16 +01:00
Stein Magnus Jodal
1d269af210 gst1: Call Gst.init() and remove sys.argv hack
GStreamer no longer use sys.argv directly. If you want GStreamer to
handle command line arguments, you must pass them explicitly to
Gst.init().
2016-01-31 21:07:14 +01:00
Stein Magnus Jodal
8c82f4773f gst1: Update imports to use PyGI 2016-01-31 21:07:14 +01:00
Stein Magnus Jodal
d74f47ad58 main: Remove warnings if old settings dirs and files exists 2015-08-23 17:33:51 +02:00
Stein Magnus Jodal
b63642d873 Use core/*_dir when creating dirs we need
Partly fixes #1259
2015-08-23 00:37:38 +02:00
Stein Karlsen
0d3563441f Fixed changed data-structure passed when creating config file, issue 1228 2015-07-25 03:43:35 +02:00
Thomas Adamcik
2d952570d0 main: Catch extension.setup exceptions 2015-05-12 23:55:09 +02:00
Thomas Adamcik
ce3c16de6e startup: Fix mistake in command extension bootstrap cleanup 2015-05-12 22:02:19 +02:00
Thomas Adamcik
dbc3100e9c main: Update to use extension_data structure
Updated config and __main__ code to use the new wrapper format and pre-fetched
values.
2015-05-11 22:47:13 +02:00
Thomas Adamcik
8b6553ec16 ext: Update validate_extension to validate_extension_data
Adds more checks to catch extension errors and importantly tests for exercise
these code paths.
2015-05-11 22:30:50 +02:00
Thomas Adamcik
5550785146 ext: Wrap extension state in a ExtensionData tuple
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.
2015-05-11 00:33:41 +02:00
Stein Magnus Jodal
d8bcd7f273 Rename mopidy.utils to mopidy.internal 2015-05-07 23:15:56 +02:00
Stein Magnus Jodal
20b457cc4a Move gobject check from __init__ to __main__
Related to #1068
2015-04-07 01:06:43 +02:00
Stein Magnus Jodal
57cdab586a Fix flake8 warnings 2014-12-07 20:39:39 +01:00
Stein Magnus Jodal
496142c201 py3: Use absolute imports by default 2014-12-07 20:17:10 +01:00
Stein Magnus Jodal
eb97b55d88 Keep gobject check together with the other checks 2014-09-09 08:35:21 +02:00
Stein Magnus Jodal
db4868207c Print friendly error message if gobject isn't found
Fixes #836
2014-09-08 21:15:14 +02:00
Stein Magnus Jodal
db0d726f3f config: Fix decoding of exception message depending on locale 2014-05-20 20:15:44 +02:00
Stein Magnus Jodal
b754885064 Fix all import order warnings 2014-05-07 20:08:43 +02:00
Thomas Adamcik
684bfcf301 config/ext: Automatically disable extensions with bad config
Ensures config errors on extensions don't block mopidy startup. Also improves
error messages for config problems.
2014-02-16 18:29:57 +01:00
Thomas Adamcik
246e8e3ef8 Merge remote-tracking branch 'abarisain/window' into develop 2014-01-24 19:18:20 +01:00
Stein Magnus Jodal
06640f1f0c log: Use custom filter to implement verbosity levels
...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
2014-01-23 22:49:41 +01:00
Arnaud Barisain-Monrose
9b1b6943a8 Fix flake8's whitespace error 2014-01-19 23:57:58 +01:00
Arnaud Barisain-Monrose
81825dfa0d Do not listen for SIGUSR1 since Windows does not have it 2014-01-19 23:04:43 +01:00
Stein Magnus Jodal
550f7a971b log: Add verbosity_level 2 and 3
Reduces the amount of dependency logging on level 1, and increases the amount
on level 2 and 3. Fixes #593.
2014-01-12 01:46:49 +01:00
Thomas Adamcik
042868e602 Merge branch 'develop' into feature/extension-registry
Conflicts:
	mopidy/backends/local/json/actor.py
	mopidy/backends/local/json/library.py
2014-01-08 23:50:03 +01:00
Stein Magnus Jodal
0fb7c79524 log: Use loggers named after __name__ 2014-01-01 13:31:20 +01:00
Thomas Adamcik
60112d7c6f Merge branch 'develop' into feature/extension-registry 2013-12-30 00:37:17 +01:00
Stein Magnus Jodal
413d539a7b py3: Use print() function 2013-12-28 19:23:04 +01:00
Thomas Adamcik
8a94d81c42 ext: Move away from global registry to ease testing.
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.
2013-12-23 21:46:24 +01:00
Thomas Adamcik
decce4ccf6 ext: Add basic global registry and switch to Extension.setup() 2013-12-22 15:11:15 +01:00
Thomas Adamcik
0d7fea0a43 ext: Convert commands to use new registry system.
Creates a placeholder registry using the existing hooks, and updates the
commands to use these. The actual registry still needs to be created.
2013-12-22 15:11:15 +01:00
Thomas Adamcik
76ca38dd63 main: Only log creation of config when file does not exist. 2013-11-26 23:22:15 +01:00
Thomas Adamcik
2d13734dfc logging: Remove use of root logger 2013-11-26 16:42:04 +01:00
Thomas Adamcik
7dbabd1960 config: Initialize config with defaults
Try and create args.config_file[-1] with the default config commented out.
We assume that the directory the config file is in exists.
2013-11-22 07:17:02 +01:00
Stein Magnus Jodal
9ca222ed39 dbus: Skip mainloop setup if dbus isn't installed 2013-11-20 23:14:08 +01:00
Stein Magnus Jodal
33d82b0229 dbus: Set GObject event loop as default DBus loop
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.

Fixes mopidy/mopidy-mpris#2
2013-11-20 22:20:54 +01:00
Thomas Adamcik
63899059be main: Convert main program flow to command helpers
- 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.
2013-11-14 23:33:29 +01:00
Thomas Adamcik
4e6ebbe955 local/docs: Update based on review comments
- 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.
2013-11-09 18:20:22 +01:00
Thomas Adamcik
2581062ae0 ext/backends: Add extensions to sub commands run 2013-11-08 23:18:26 +01:00
Thomas Adamcik
ef10c2e178 main: Wire in actual execution of sub-commands. 2013-11-08 22:04:26 +01:00
Thomas Adamcik
7144876dc5 main: Move default subparsers into commands module
Also switches to using dest for storing the chosen sub-parser.
2013-11-08 22:01:18 +01:00
Thomas Adamcik
25fedc7700 loggin: Add DelayedHandler to root logger.
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.
2013-11-08 19:53:00 +01:00
Thomas Adamcik
4f03677675 main: Improve main bootstrapping sequence
- Parses args in two pases to allow for setup of logging well before doing
  extension sub-commands.
2013-11-08 19:53:00 +01:00
Thomas Adamcik
9539c2ac35 main: Switch to subcommands
- show-deps replaced with 'mopidy deps'
- show-config replaced with 'mopidy config'
- Just running mopidy now displays help, run 'mopidy run' to start server.
2013-11-08 19:53:00 +01:00