Commit Graph

202 Commits

Author SHA1 Message Date
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
Thomas Adamcik
f49973304c main: Start unifying command handling
- Removes show_deps and show_config from commands module. These
  are now handled directly in the main() method pending subcommands.
- Unifies show_config with general main() config handling.
- Sets default verbosity level to zero.
- Reduce verbosity when --show-config or --show-deps is called.
- Update console logging to consider verbosity < 0 quiet/
2013-11-08 01:17:52 +01:00
Thomas Adamcik
51b778fcd6 main: Create helper for logging boostraping 2013-11-08 00:59:05 +01:00
Thomas Adamcik
bdba83b1be main: Move argparse building to a function. 2013-11-08 00:09:17 +01:00
Stein Magnus Jodal
ac8d4b7413 main: Reorder/rename functions 2013-09-17 00:15:33 +02:00
Stein Magnus Jodal
c4dc4985b5 main: Don't be verbose on CTRL+C before starting actors 2013-09-16 23:31:14 +02:00
Stein Magnus Jodal
f244d94b52 main: Split main() function in two
By separating the teardown procedures for errors that happens before and after
actors are started, we get a lot less output when failing on config errors.
This makes the config errors the last lines printed by the `mopidy` command,
making them easier to spot.

Related to #467
2013-09-16 23:22:11 +02:00
Stein Magnus Jodal
7cd7216b94 Create empty config file if none found (see #467)
We already had code in place for this, but it was run after the config
validation, so on a new installation Mopidy would fail because of missing
config values before the config file was created.
2013-09-16 22:27:54 +02:00
Stein Magnus Jodal
1a02b4d17f Remove support for running Python on the mopidy/ dir
It doesn't make sense to run Mopidy without extensions registered, thus you'll
need to use setuptools and to run `python setup.py develop` anyway. Doing so
makes running `mopidy` from anywhere in the development virtualenv work,
removing any need for running `python mopidy/`.
2013-09-16 22:13:36 +02:00
Stein Magnus Jodal
5e4f22bd17 commands: Use argparse to split config files into a list 2013-04-30 23:27:12 +02:00
Stein Magnus Jodal
df2abde258 commands: Move argument parser to commands module 2013-04-29 22:57:44 +02:00
Stein Magnus Jodal
a301906fe7 commands: Move --show-{config,deps} handlers to new module 2013-04-29 22:52:11 +02:00
Stein Magnus Jodal
a97aab7531 argparse: Convert mopidy command 2013-04-29 22:17:36 +02:00
Thomas Adamcik
3f895159b2 Merge pull request #435 from jodal/feature/drop-python-2.6
Drop Python 2.6 support
2013-04-29 12:44:05 -07:00
Stein Magnus Jodal
c6a905efd7 main: Remove resolved TODO 2013-04-29 21:35:35 +02:00
Stein Magnus Jodal
de84fdfef4 Remove hacks required by #302 to run on older Python 2.6.x 2013-04-29 19:52:29 +02:00
Stein Magnus Jodal
d57b699b12 main: Fix typo 2013-04-28 01:09:23 +02:00
Thomas Adacmik
4f93f93deb config: Create read-only config proxy 2013-04-28 01:09:22 +02:00
Stein Magnus Jodal
e97577d16d main: Remove /etc/mopidy/mopidy.conf from default config file list
Init scripts can use the --config option to specify that the file should be
included.
2013-04-27 23:47:48 +02:00
Thomas Adamcik
3409ca99d1 path: Ensure mopidy.__main__ uses bytes for paths 2013-04-25 21:24:02 +02:00
Thomas Adamcik
30babaa26a main: Always raise unchaught exceptions and only log once logging is setup 2013-04-18 23:59:36 +02:00