Commit Graph

445 Commits

Author SHA1 Message Date
Thomas Adamcik
4453df7594 network: Check for windows platform match 2014-01-24 19:18:30 +01:00
Thomas Adamcik
246e8e3ef8 Merge remote-tracking branch 'abarisain/window' into develop 2014-01-24 19:18:20 +01:00
Stein Magnus Jodal
7d2906d58d log: Make other logging work when logging/config_file is in use 2014-01-23 22:49:41 +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
Stein Magnus Jodal
bb66cd1065 log: Don't filter anything at all on the root logger itself 2014-01-23 22:34:23 +01:00
Arnaud Barisain-Monrose
fe3c27cf18 Add windows workaround for IPv6 sockets to also listen on IPv4 2014-01-19 23:05:00 +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
Stein Magnus Jodal
0fb7c79524 log: Use loggers named after __name__ 2014-01-01 13:31:20 +01:00
Stein Magnus Jodal
12d473ced6 zeroconf: Make public API with docs 2013-12-29 15:38:20 +01:00
Thomas Adamcik
603b57ef3c utils: Remove find_uris and update find_files
- find_uris is no more
- find_files now returns file paths relative to path being searched
- find_files now only works on directories
- find_files tests have been updated to reflect changes
- local scanner has gotten a minimal update to reflect this alteration
2013-11-27 22:50:35 +01:00
Thomas Adamcik
b22d7bee0b utils: Add mkdir and content options to get_or_create_file
This lets callers control is parent directories are created, and set the
default content of the file.
2013-11-22 07:17:02 +01:00
Stein Magnus Jodal
c781d75985 zeroconf: Avahi doesn't support announcing on the loopback interface 2013-11-19 20:52:53 +01:00
Thomas Adamcik
ea28e91f63 Merge branch 'develop' into feature/subcommands
Conflicts:
	mopidy/scanner.py
2013-11-16 03:08:38 +01:00
Thomas Adamcik
03c301705d commands: Move mopidy.utils.command to mopidy.commands
- Also adds documenation to Command class.
- Moves scan command to commands to match naming.
2013-11-16 03:02:45 +01:00
Thomas Adamcik
2f6ecd9171 commands: Move to using a help attribute instead of __doc__ 2013-11-16 02:26:47 +01:00
Stein Magnus Jodal
eee276d8c0 zeroconf: Wrap unpublish in try-except 2013-11-16 01:28:53 +01:00
Stein Magnus Jodal
34e327ed12 zeroconf: Wrap publish in try-except 2013-11-16 01:28:44 +01:00
Stein Magnus Jodal
5c33115eeb zeroconf: Don't set host when binding to all interfaces 2013-11-16 01:07:16 +01:00
Stein Magnus Jodal
f3b09e4ef2 zeroconf: Catch DBusException from AddService
Fixes #576
2013-11-16 01:06:57 +01:00
Stein Magnus Jodal
9814fe1ec9 zeroconf: Fix logger name 2013-11-16 00:20:26 +01:00
Thomas Adamcik
37ba3ca01d Merge branch 'develop' into feature/commands-helper-tmp
Conflicts:
	mopidy/utils/log.py
2013-11-14 23:36:27 +01:00
Thomas Adamcik
c0f1a1352b commands: Replace set_defaults with set method
For our use case we only need to be able to override a value, not set defaults
so this simplifies everything.
2013-11-14 23:31:20 +01:00
Thomas Adamcik
39f7fd5955 commands: Extend use of exit helper to parser errors
This moves all the bad arugment handling into our class and makes sure to mark
all the helpers as internal.
2013-11-14 23:31:20 +01:00
Thomas Adamcik
d82f48a42f commands: Internalise handling of help action
This means help will always be handled by the root command. Additionally this
adds an exit helper.
2013-11-14 23:31:20 +01:00
Thomas Adamcik
0b1b249ae8 commands: Remove trailing newline for command errors 2013-11-14 23:31:20 +01:00
Thomas Adamcik
1394f3929b commands: Add run method to Commands 2013-11-14 23:31:20 +01:00
Thomas Adamcik
f5a5f9e9b1 commands: Add str method CommandError 2013-11-14 23:31:20 +01:00
Thomas Adamcik
b5360a1360 commands: Add usage to CommandError 2013-11-14 23:31:20 +01:00
Thomas Adamcik
001c8e0bdc commands: Add set_defaults() to the parser
- Removes mock based test that checks delegation, just check commands result
- Allow setting of defaults that propegate down the chain
- Move internal parser args to a _parse helper.
2013-11-14 23:31:20 +01:00
Thomas Adamcik
6bddcb7875 commands: Add help_formatter() with tests. 2013-11-14 23:31:20 +01:00
Thomas Adamcik
88bc046605 commands: Make sure parser errors get translated to correct error type. 2013-11-14 23:31:20 +01:00
Thomas Adamcik
fa7eee3bdf commands: Add basic format usage helper 2013-11-14 23:31:20 +01:00
Thomas Adamcik
754865d8b6 commands: Set child names upon adding them 2013-11-14 23:31:20 +01:00
Thomas Adamcik
7c82485a07 commands: Start adding commands util helper.
This class is intended to be used to contruct a tree of sub-commands. In this
intial version it mainly focuses on exposing `add_argument` to allow for nested
parsers. Next step is to start adding better `--help` that shows the entire tree
and hooking it up to select what code path to really run.
2013-11-14 23:31:20 +01:00
Stein Magnus Jodal
d723db8f41 Merge pull request #573 from adamcik/feature/avahi
Cleaned up version of #558 - Add avahi publishing of MPD and HTTP server endpoints.
2013-11-11 13:35:43 -08:00
Thomas Adamcik
f03c049485 avahi: More review comments and some other fixes.
- Switched to newstyle class
- Switched to safe values in kwargs
2013-11-11 22:04:13 +01:00
Thomas Adamcik
e9c2816354 avahi: Add hostname and port template values to names 2013-11-11 21:39:14 +01:00
Thomas Adamcik
fb31193ed0 avahi: Fixes from review comments 2013-11-11 21:26:11 +01:00
Thomas Adamcik
6c6932c374 avahi: Only convert single string at a time in helper 2013-11-11 21:16:05 +01:00
Thomas Adamcik
50cfe42ce0 avahi: Improve error handling for dbus errors.
- Handle dbus not being installed.
- Handle not finding the system bus.
- Handle not finding the avahi service.
- Return if publish succeeded.
2013-11-11 21:15:47 +01:00
Thomas Adamcik
cf5589b4eb avahi: Style and code cleanups in zeroconf module.
- Prepare for handling missing dbus directly in module.
- Constants should always be all caps.
- Extracted helpers from class to convey intent via their naming.
- Moved imports out of class, imports should always be on the top.
- Made sure calling publish mutiple times does not re-convert text.
- Made sure calling unpublish without publish does not break.
2013-11-11 21:15:35 +01:00
Stein Magnus Jodal
484efab28e utils: Remove Python 2.6 workaround 2013-11-10 21:37:53 +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
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
David Eisner
697bff81cd Advertise HTTP with Avahi 2013-11-05 16:25:21 +00:00
David Eisner
c4281339b6 Avahi hostname choice extracted for reuse 2013-11-05 11:07:35 +00:00
David Eisner
e9173ae81f Avahi constants named 2013-11-05 11:06:51 +00:00
David Eisner
6c75b0d96f Avahi wrapper moved to utils 2013-11-05 10:37:54 +00:00
Stein Magnus Jodal
04d9fa667b deps: Don't strip last dir from dependency path 2013-11-02 19:25:06 +01:00
Stein Magnus Jodal
404fb00235 Remove pylint remnants 2013-08-08 21:12:42 +02:00
Thomas Adamcik
18ed7c6279 local: Convert mopidy-local extension to local: uris.
- Use local:playlist:<name>, local:track:<path> and local:search uris
- Adds LocalPlaybackProvider which translates to file uris.
- Switches to storing actual uris in playlists - so local: urls and not
  file:// or plain paths.
- Moved file:// to streaming plugin
- Cleaned up tests and imports for these changes.
2013-07-30 00:40:12 +02:00
Thomas Adamcik
6818e20218 utils: Convert path_to_uri to single argument 2013-07-30 00:23:23 +02:00
Thomas Adamcik
af707dfdbb utils: Switch to urlparse for file-uri/path handling 2013-07-30 00:23:23 +02:00
Thomas Adamcik
351589c6c8 path: Add find_uris version of find_files 2013-05-20 22:42:31 +02:00
Stein Magnus Jodal
f7234a6128 commands: Fix verbose mode
argparse and optparse differs in how action='count', default=1 is interpreted.
2013-05-04 15:55:25 +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
a7b6ff7b18 path: Disallow unknown substitutions in expand_path 2013-04-25 22:39:07 +02:00
Thomas Adamcik
160a70e6df path: Only accept bytes as paths 2013-04-25 21:08:33 +02:00
Stein Magnus Jodal
004fe6dbf8 path: Handle XDG paths as bytes, not unicode 2013-04-23 23:18:16 +02:00
Stein Magnus Jodal
48dfcf6fd1 deps: Survive exceptions from pkg_resources 2013-04-18 18:05:55 +02:00
Stein Magnus Jodal
d88da482d4 deps: Don't show 'from ' at the end of the platform line 2013-04-18 12:11:04 +02:00
Thomas Adamcik
18ebb56b3e config: Add logging/config_file 2013-04-17 23:47:18 +02:00
Stein Magnus Jodal
a702deedae deps: 'none' should only be displayed if no other elements 2013-04-17 09:14:38 +02:00
Thomas Adamcik
c84cb95c3f Merge pull request #418 from jodal/feature/show-deps
Update --show-deps to list deps of extensions
2013-04-16 14:33:11 -07:00
Stein Magnus Jodal
466cf3ba33 deps: Rename --list-deps to --show-deps 2013-04-16 23:07:38 +02:00
Stein Magnus Jodal
164eaffea7 deps: Group GStreamer elements by found/not found 2013-04-16 23:05:15 +02:00
Stein Magnus Jodal
8798368763 deps: Move GStreamer to the bottom 2013-04-16 22:48:30 +02:00
Stein Magnus Jodal
07e6d11850 deps: Remove old manual deps checkers 2013-04-16 22:48:30 +02:00
Stein Magnus Jodal
609b6ace85 deps: Look up deps in pkg_resources 2013-04-16 22:48:29 +02:00
Stein Magnus Jodal
5de80228ea deps: Output one dep per line 2013-04-16 22:48:29 +02:00
Stein Magnus Jodal
21d17db7e2 formatting: Make indent() more useful 2013-04-16 22:39:08 +02:00
Thomas Adamcik
78d3888dd1 config: Remove ConfigErrors expception 2013-04-15 23:09:19 +02:00
Stein Magnus Jodal
a9a789aa8a conf: Rename logging.levels to loglevels
Part of #280
2013-04-15 20:40:01 +02:00
Stein Magnus Jodal
809b165966 exc: Remove unused SettingsError 2013-04-14 11:06:45 +02:00
Stein Magnus Jodal
f38b806133 utils: Remove unused importing utils 2013-04-14 10:54:26 +02:00
Thomas Adamcik
1ebc265235 Merge branch 'develop' into feature/reshuffle-config
Conflicts:
	mopidy/backends/local/__init__.py
	mopidy/backends/spotify/__init__.py
	mopidy/backends/stream/__init__.py
	mopidy/config.py
	mopidy/frontends/http/__init__.py
	mopidy/frontends/mpd/__init__.py
	mopidy/frontends/mpris/__init__.py
	mopidy/frontends/scrobbler/__init__.py
	mopidy/utils/config.py
	tests/config/types_test.py
2013-04-13 01:25:38 +02:00
Stein Magnus Jodal
6076a0f117 Fix flake8 warnings 2013-04-13 00:28:45 +02:00
Thomas Adamcik
d90a977a3b config: Move everything to mopidy.config sub-modules 2013-04-11 22:24:27 +02:00
Stein Magnus Jodal
5174540096 log: Remove system info available in --list-deps 2013-04-11 13:27:08 +02:00
Stein Magnus Jodal
02f9db4518 path: Let get_or_create_file() create missing dirs 2013-04-09 12:40:28 +02:00
Stein Magnus Jodal
53827aa022 path: Close create file right away 2013-04-09 12:39:29 +02:00
Stein Magnus Jodal
ef57c90526 path: Use our expand_path instead of os.path.expanduser 2013-04-09 00:09:33 +02:00
Stein Magnus Jodal
41d7ae9a2c Replace 'folder' with 'dir' 2013-04-08 21:13:59 +02:00
Stein Magnus Jodal
335c4d9fd8 main/path: Inline constants used once 2013-04-08 20:42:33 +02:00
Stein Magnus Jodal
638ea8cd27 Merge branch 'develop' into feature/use-new-config 2013-04-08 09:59:36 +02:00
Thomas Adamcik
28d3b265c2 Merge branch 'develop' into feature/config-path
Conflicts:
	mopidy/backends/spotify/__init__.py
2013-04-07 22:02:32 +00:00
Stein Magnus Jodal
63b7260c01 settings: Remove settings utils 2013-04-07 00:41:09 +02:00
Stein Magnus Jodal
2276130758 main: Use new config system 2013-04-07 00:34:24 +02:00
Thomas Adamcik
5a79b65d47 settings: Remove did you mean. 2013-04-05 23:33:27 +02:00
Thomas Adamcik
bd3d8f6932 config: Steal did you mean code from settings. 2013-04-05 23:33:27 +02:00
Thomas Adamcik
90efbb6be7 config: Add a Path config value and an ExpandedPath wrapper.
Allows us to easily use expanded paths, without losing the original value for
display and storage. In theory we could be using same trick for passwords.
2013-04-05 22:49:33 +02:00
Thomas Adamcik
dcb28259f4 config: Switch logging to new config system 2013-04-03 01:01:07 +02:00
Thomas Adamcik
73fb143f45 config: String escape strings 2013-04-03 01:00:34 +02:00
Stein Magnus Jodal
f9fb30c76c main/settings: Remove --interactive support 2013-04-03 00:16:37 +02:00
Thomas Adamcik
5214100854 config: Expand files before printing sources. 2013-04-02 23:58:13 +02:00
Thomas Adamcik
07fa9548e6 config: Fix backticks in docstring. 2013-04-02 23:35:07 +02:00
Thomas Adamcik
0d30db7e5f config: More review fixes and fixed help test. 2013-04-02 23:32:36 +02:00
Thomas Adamcik
e226ddd652 config/ext: Remove ext. prefix from configs. 2013-04-02 22:12:00 +02:00
Thomas Adamcik
3b8fe2fd9f config: Remove old list settings and mask secret code. 2013-04-02 19:37:51 +02:00