Commit Graph

454 Commits

Author SHA1 Message Date
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
Thomas Adamcik
77cdb5b065 config: Add config based list_settings_callback 2013-04-02 19:33:26 +02:00
Thomas Adamcik
29a4ff040e config: Make list return tuples so we get imuttable data. 2013-04-02 19:19:24 +02:00
Thomas Adamcik
6f39bde566 config: Start passing dummy config explicitly to audio/backends/frontends. 2013-04-02 19:14:46 +02:00
Thomas Adamcik
8cb800765f Merge branch 'develop' into feature/config
Conflicts:
	mopidy/utils/config.py
2013-04-01 23:41:15 +02:00
Thomas Adamcik
c18df18395 config: Document what each config value supports. 2013-04-01 23:38:44 +02:00
Thomas Adamcik
e504ca0207 config: Fix typo. 2013-04-01 23:30:05 +02:00
Thomas Adamcik
98269f4ed1 config: Add optional setting to config values and improve tests. 2013-04-01 23:24:42 +02:00
Stein Magnus Jodal
f3004ed4d2 config: Fix flake8 warnings 2013-04-01 22:05:10 +02:00
Thomas Adamcik
50980723f8 Merge branch 'develop' into feature/config 2013-04-01 21:25:07 +02:00
Thomas Adamcik
3509ec4b37 config: Address review comments. 2013-04-01 21:21:59 +02:00
Thomas Adamcik
b4c553e201 config: Add LogLevelConfigSchema. 2013-04-01 20:33:22 +02:00
Thomas Adamcik
980792e527 config: Add ExtensionConfigSchema. 2013-04-01 20:23:34 +02:00
Stein Magnus Jodal
aa1f8199c2 Remove the FRONTENDS setting 2013-04-01 20:22:29 +02:00
Stein Magnus Jodal
74788a2ccb Remove the BACKENDS setting 2013-04-01 20:14:20 +02:00
Thomas Adamcik
0535084162 config: Add config schema and tests.
Config schemas are used to group config values and check that each of them is
deserialized corretly, that none are missing and that there are no unkown keys
present.
2013-04-01 20:14:04 +02:00
Thomas Adamcik
66c067aa96 config: Add Hostname and Port ConfigValues and tests. 2013-04-01 14:21:44 +02:00
Thomas Adamcik
6af8b4b090 config: Add LogLevel ConfigValue and tests. 2013-04-01 14:02:28 +02:00
Thomas Adamcik
d46f926f14 config: Add List ConfigValue and tests. 2013-04-01 13:46:13 +02:00
Thomas Adamcik
452cf839c4 config: Add Boolean ConfigValue and tests. 2013-04-01 13:38:59 +02:00
Thomas Adamcik
21d0a938f9 config: Add Integer ConfigValue and tests. 2013-04-01 13:31:15 +02:00
Thomas Adamcik
7cb68a41ac config: Improve validate error messages and fix handling of non-string choices. 2013-04-01 13:29:32 +02:00
Thomas Adamcik
119644c186 config: Add String config value and tests. 2013-04-01 13:20:33 +02:00
Thomas Adamcik
c22f0f5f9d config: Add ConfigValue base class and tests. 2013-04-01 13:07:05 +02:00
Thomas Adamcik
ba425d8ccb config: Start adding basic validators + tests for new config values. 2013-04-01 13:07:05 +02:00
Stein Magnus Jodal
e6460b6945 jsonrpc: Handle Pykka's CallableProxy objects as regular methods 2013-03-30 21:01:01 +01:00
Stein Magnus Jodal
c90322f1e2 Use thread traceback logger from Pykka 1.1 2013-03-24 00:23:50 +01:00
Stein Magnus Jodal
f4251e63fa Merge pull request #295 from adamcik/feature/streaming-backend
Add basic streaming backend support.
2013-01-02 13:25:03 -08:00
Stein Magnus Jodal
dfa0d648f9 scanner: Support symlinks 2013-01-02 21:39:14 +01:00
Thomas Adamcik
4f11ac77ae settings: Update settings validator to support empty iterables. 2013-01-01 17:30:24 +01:00
Thomas Adamcik
ce750ddbf9 Fix racecondition triggered KeyError in our DebugThread. 2012-12-27 03:28:44 +01:00
Stein Magnus Jodal
5d707e3918 settings: Fail if BACKENDS/FRONTENDS setting isn't iterable (fixes #278) 2012-12-23 15:42:49 +01:00
Stein Magnus Jodal
79cbdb4fbb mpd: Add MPD_SERVER_CONNECTION_TIMEOUT setting 2012-12-19 23:47:22 +01:00
Stein Magnus Jodal
0f603c3ede Use urllib.{quote,unquote} instead of {pathname2url,url2pathname} 2012-12-12 23:13:52 +01:00
Stein Magnus Jodal
905ceeb72a utils: find_files() returns bytestrings 2012-12-12 13:45:37 +01:00
Stein Magnus Jodal
b5d9dc10a7 utils: Handle paths with non-UTF-8 encodings
- path_to_uri() encodes unicode input as UTF-8 and leaves bytestring input
  unchanged before it is converted to file:// URIs.

- uri_to_path() will now always return bytestrings, since we don't know if
  there is any non-UTF-8 encoded chars in the file path, and converting it to
  unicode would make such paths no longer match the dir or file it was
  referring to.

- split_path() will now assume it gets a bytestring in.
2012-12-12 13:45:37 +01:00
Stein Magnus Jodal
5422d85f5b utils: Include ws4py in --list-deps 2012-12-01 09:58:21 +01:00
Stein Magnus Jodal
9ec53bb3b7 utils: Include cherrypy in --list-deps 2012-12-01 09:56:28 +01:00
Stein Magnus Jodal
7d047acc2e Merge branch 'develop' into feature/http-frontend 2012-11-25 22:04:53 +01:00
Stein Magnus Jodal
f1dbdc9464 Merge pull request #257 from jodal/feature/json-rpc
Add generic JSON-RPC 2.0 object wrapper
2012-11-25 13:02:50 -08:00
Stein Magnus Jodal
160626b364 jsonrpc: Give explicit error if calling method without object path 2012-11-25 21:51:59 +01:00
Stein Magnus Jodal
8f604204da jsonrpc: Don't allow objects at the root 2012-11-25 21:42:28 +01:00
Stein Magnus Jodal
b33df8200a jsonrpc: Grammar 2012-11-25 21:25:00 +01:00
Stein Magnus Jodal
50814d3929 jsonrpc: Explain why a method wasn't found 2012-11-25 21:23:55 +01:00
Stein Magnus Jodal
609fdc46ca jsonrpc: Explain why call to private method failed 2012-11-25 21:13:55 +01:00
Stein Magnus Jodal
253695222b jsonrpc: Clearify usage docs 2012-11-25 20:58:34 +01:00
Stein Magnus Jodal
869fcd2d8e jsonrpc: Move future handling code to its own method 2012-11-25 20:42:48 +01:00
Stein Magnus Jodal
7f987cb1e2 jsonrpc: Lookup methods using the objects map directly 2012-11-25 20:36:04 +01:00
Stein Magnus Jodal
90663021a4 Merge branch 'feature/json-rpc' into feature/http-frontend 2012-11-25 08:39:20 +01:00
Stein Magnus Jodal
5a05b4af9d jsonrpc: Doc diff between wrapper and inspector 2012-11-25 08:20:39 +01:00
Stein Magnus Jodal
40f4a8181d jsonrpc: Wrapper takes a mapping between mounts and objects
This is analogous to how the inspector takes a mapping between mounts and
classes.
2012-11-25 08:03:26 +01:00
Stein Magnus Jodal
569ee6c5f3 jsonrpc: Add inspector that describes the available API 2012-11-24 00:57:08 +01:00
Stein Magnus Jodal
ec639d17ae docs: Unbreak build 2012-11-23 12:47:57 +01:00
Stein Magnus Jodal
29e2178a79 jsonrpc: Document encoders/decoders arguments 2012-11-22 15:31:03 +01:00
Stein Magnus Jodal
61d6de2378 jsonrpc: Support methods on the root object 2012-11-22 15:30:34 +01:00
Stein Magnus Jodal
6e2ffb0820 jsonrpc: Make dict returns from plain objects work 2012-11-22 12:11:22 +01:00
Stein Magnus Jodal
b038c4c2db Add generic JSON-RPC 2.0 object wrapper
This can wrap multiple objects, which can be both plain objects and Pykka
actors. To my knowledge, everything in the spec is supported.
2012-11-21 23:51:05 +01:00
Stein Magnus Jodal
d153fa6b59 Remove rogue commas making tuples of my strings 2012-11-21 10:42:33 +01:00
Stein Magnus Jodal
6cb2d6293d Improve fix for #256
- Forgot to decode result from glib.get_user_config_dir()
- glib.USER_DIRECTORY_MUSIC isn't always defined
2012-11-21 10:30:06 +01:00
Stein Magnus Jodal
26e6b2e730 Fix crash when XDG variables contain non-ASCII characters (fixes #256) 2012-11-21 10:20:08 +01:00
Stein Magnus Jodal
56c4892f46 Merge branch 'develop' into feature/http-frontend 2012-11-20 00:27:19 +01:00
Stein Magnus Jodal
6aa1ee7f5c network: The recieve buffer should be a bytestring 2012-11-19 22:18:51 +01:00
Stein Magnus Jodal
6f0919bda8 style: Fix flake8 warnings 2012-11-19 18:01:31 +01:00
Stein Magnus Jodal
7e3fba0155 Merge branch 'develop' into feature/http-frontend 2012-11-18 09:45:44 +01:00
Stein Magnus Jodal
b3fd9d8b40 deps: Pykka version check doesn't need to work with < 1.0 2012-11-15 08:48:43 +01:00
Stein Magnus Jodal
8a440fff3f network: Server send buffer should be bytes, not unicode (#241) 2012-11-14 18:12:52 +01:00
Stein Magnus Jodal
e1ef73f517 Merge branch 'develop' into feature/http-frontend 2012-11-14 09:35:19 +01:00
Stein Magnus Jodal
1b5b7abfdd Allow settings prefixed with 'CUSTOM_' (fixes #204) 2012-11-13 00:44:07 +01:00
Stein Magnus Jodal
6acaa490e9 Make all strings unicode by default (fixes #224) 2012-11-13 00:18:47 +01:00
Stein Magnus Jodal
509c7c82ea http: Only include cherrypy in debug log 2012-11-09 14:23:26 +01:00
Thomas Adamcik
b37e6a9ded Merge branch 'develop' into feature/dump-thread-tracebacks
Conflicts:
	mopidy/__main__.py
	mopidy/utils/process.py
2012-11-08 22:46:41 +01:00
Stein Magnus Jodal
49cf1ab8aa Require at least one frontend and one backend 2012-11-08 14:43:21 +01:00
Stein Magnus Jodal
197447c0cb Remove ancient despotify settings check 2012-11-08 14:42:06 +01:00
Stein Magnus Jodal
b110e6a478 Move file path is in base dir checker to mopidy.utils.path 2012-11-01 23:10:18 +01:00
Stein Magnus Jodal
0dd4aba143 Move slugify to mopidy.utils.formatting 2012-11-01 23:09:37 +01:00
Stein Magnus Jodal
0a8dc743a5 Fix logging on Python 2.6 (fixes #220) 2012-10-30 09:31:16 +01:00
Stein Magnus Jodal
e8af2276e2 Log warnings instead of just printing them 2012-10-29 12:54:21 +01:00
Stein Magnus Jodal
d685fe554c Simplify pykka imports 2012-10-26 22:57:41 +02:00
Stein Magnus Jodal
587dde287f Update to work with Pykka 1.0 2012-10-26 22:32:06 +02:00
Stein Magnus Jodal
65b550eb44 Ignore invalid pylint warnings (#211) 2012-10-17 01:42:58 +02:00
Stein Magnus Jodal
0c9452d9d3 Remove unused argument shadowing builtin (#211) 2012-10-17 01:31:41 +02:00
Stein Magnus Jodal
8042f9961a Mark strings with backslashes as raw strings (#211) 2012-10-17 01:07:00 +02:00
Stein Magnus Jodal
b8d637e1f5 Move DATA_PATH, SETTINGS_PATH, and SETTINGS_FILE to mopidy.utils.path 2012-10-17 00:21:24 +02:00
Stein Magnus Jodal
afdc665ac0 Use deps.{platform_info,python_info} in log 2012-10-16 22:26:28 +02:00
Stein Magnus Jodal
5fc77be76e Update path in comment 2012-10-16 22:25:37 +02:00
Stein Magnus Jodal
479ab249bb Move mopidy.utils.{log => formatting}.indent to break import cycle 2012-10-16 22:25:23 +02:00
Stein Magnus Jodal
986c0a9ad3 Move get_version() helper to mopidy.utils.versioning 2012-10-16 21:45:36 +02:00
Stein Magnus Jodal
5a0529b142 Empty utils/__init__.py 2012-10-16 21:36:51 +02:00
Stein Magnus Jodal
d9d6a3d5b6 Move exceptions to mopidy.exceptions 2012-10-16 16:08:46 +02:00
Stein Magnus Jodal
666800ec57 Fix most flake8 warnings (#211) 2012-10-16 14:00:34 +02:00
Stein Magnus Jodal
63cd153b1b Let NetworkServer pass protocol_kwargs on 2012-09-28 00:48:23 +02:00
Stein Magnus Jodal
66f476e85a Fix typo 2012-09-26 10:08:59 +02:00