Commit Graph

454 Commits

Author SHA1 Message Date
Stein Magnus Jodal
71ab9733c7 flake8: Fix new import order warnings 2015-04-12 23:03:46 +02:00
Stein Magnus Jodal
c367d350f7 Merge pull request #1117 from adamcik/feature/models-memory-reduction
Improve models memory usage
2015-04-08 23:29:08 +02:00
Thomas Adamcik
05244f7e60 models: Deprecate copy and add replace method
Changed as with the memoization copy was lying, so replace is a better name.
2015-04-08 01:41:50 +02:00
Stein Magnus Jodal
0b8e9426b5 xdg: Fix review comments 2015-04-08 00:29:55 +02:00
Stein Magnus Jodal
9becb26f60 path: Get XDG dirs without using glib
Related to #1068
2015-04-07 23:50:59 +02:00
Stein Magnus Jodal
7bda4f835f xdg: Add XDG dir utils 2015-04-07 23:50:59 +02:00
Stein Magnus Jodal
c4940cbea2 autopep8: Add space after class signature/docstring 2015-04-03 00:05:26 +02:00
Thomas Adamcik
28237df303 core: Fix deprecation message 2015-03-31 21:04:23 +02:00
Thomas Adamcik
887c0774fb review: Update wording deprecation messages 2015-03-30 23:56:59 +02:00
Thomas Adamcik
bd1e822fea utils: Create warn and ignore deprecation warning helpers
This moves all the deprecation warnings messages to a central place so that it
is easy to match against them without having to redefine the same regex all
over the place.

Each message has been given a message id which is more or less
module.func:extra-info. This is not intended to be parsed, just used in tests
when using the ignore helper.
2015-03-30 23:48:08 +02:00
Thomas Adamcik
3ceb16095d utils: Install TRACE log level add module import time. 2015-03-24 08:46:52 +01:00
Stein Magnus Jodal
e06c7708a7 utils: Add time_logger context manager 2015-03-24 01:04:26 +01:00
Stein Magnus Jodal
4972d1da57 Decode all strerror-based exception messages
I reviewed all instances of:

- EnvironmentError
- OSError
- IOError
- socket.error

In most cases, we already used encoding.locale_decode().

The case fixed in mopidy/utils/network.py fixes #971.

The case fixed in mopidy/utils/path.py might be triggered during a
local library scan.
2015-03-17 22:02:34 +01:00
Stein Magnus Jodal
aed91008a3 deps: Add executable path to 'mopidy deps' output 2015-03-14 23:07:59 +01:00
Stein Magnus Jodal
3a61445519 models: Change Track.last_modified from seconds to ms 2015-03-14 00:06:23 +01:00
Stein Magnus Jodal
1119555809 core: Remove deprecated property warnings
Their use of inspect (I think) made parallel test execution slower than
serial test execution.
2015-03-05 12:27:20 +01:00
Thomas Adamcik
5c833e106b logging: Add support for per logger colors (fixes: #808) 2015-02-25 22:16:30 +01:00
Stein Magnus Jodal
ece54b68d1 log: Support -vvvv to not filter logs at all 2015-02-12 19:29:14 +01:00
Stein Magnus Jodal
79dbc652e0 log: Define TRACE log level with name and color 2015-02-12 18:12:56 +01:00
Stein Magnus Jodal
8f8fa4d414 core: Emit deprecation warnings
The warnings appear as warning level log messages if running Python on
the mopidy/ directory like this:

    python -W all mopidy -v

or:

    python -W all mopidy -o loglevels/py.warnings=warning

We don't suppress warnings when Pykka is the caller in general, but just
when Pykka is looking at all properties to create its actor proxies.

When a deprecated property is used from another Pykka actor, only the
stack for the current actor thread is available for inspection, so the
warning cannot show where the actual call site in the other actor thread
is. Though, if the warnings are made exceptions with:

    python -W error mopidy

then the stack traces will include the frames from all involved actor
threads, showing where the original call site is.
2015-02-11 00:29:52 +01:00
Stein Magnus Jodal
6ec35b2d02 Merge branch 'release/v0.19.x' into develop 2014-12-23 22:23:32 +01:00
Stein Magnus Jodal
aa3b8ab5f8 path: Support unicode content when creating file 2014-12-23 22:21:10 +01:00
Thomas Adamcik
2c3217685b utils: Switch to exceptions.FindError for errors. 2014-12-14 14:08:45 +01:00
Stein Magnus Jodal
4f428b8601 py3: Move compat module out of utils 2014-12-07 21:36:15 +01:00
Stein Magnus Jodal
01c7f12976 py3: Import moved modules via compat 2014-12-07 20:19:01 +01:00
Stein Magnus Jodal
1d26c2d63c py3: Use .item() and .values()
As .iteritem() and .itervalues() doesn't exist in Python 3.
2014-12-07 20:19:01 +01:00
Stein Magnus Jodal
58527406c1 py3: Use compat.text_type instead of unicode 2014-12-07 20:17:10 +01:00
Stein Magnus Jodal
b9a5192d5f py3: Add Python 2/3 compat module
Keep all the hacks in a single place. This looks like all we need, so no need
to depend on six.
2014-12-07 20:17:10 +01:00
Stein Magnus Jodal
496142c201 py3: Use absolute imports by default 2014-12-07 20:17:10 +01:00
Thomas Adamcik
369edab76d utils/path: Make it more clear that we are not following symlinks 2014-10-17 20:08:12 +02:00
Thomas Adamcik
43d8062094 util/path: s/os.error/OSError/ 2014-10-17 16:46:33 +02:00
Thomas Adamcik
063c757570 utils/path: Add support for handling sym/hardlink loops 2014-10-15 23:46:08 +02:00
Thomas Adamcik
54a89038d3 utils/path: Don't skip hidden files and folders in generic find code
Updates the local scan code to do this instead.
2014-10-15 23:45:49 +02:00
Thomas Adamcik
ebb62885cd util/path: Add basic support for following symlinks 2014-10-15 23:44:48 +02:00
Thomas Adamcik
de5fe5ebab tests: Add test for current find symlink handling 2014-10-15 23:43:13 +02:00
Thomas Adamcik
de4bdbec03 tests: Minor cleanup of the existing find tests 2014-10-15 23:42:15 +02:00
Thomas Adamcik
2447e2fa40 util/path: Expose errors to callers of find helper 2014-10-15 23:42:12 +02:00
Stein Magnus Jodal
cd3d44ff6d py3: Use '0o' octal literal 2014-09-16 09:48:38 +02:00
Stein Magnus Jodal
c2810d0423 py3: Fix thread import 2014-09-16 09:46:16 +02:00
Trygve Aaberge
265951bf00 network: disable_recv before telling actor to close connection
As of d62ad96, when the connection can't receive more data from the
client, it tells the actor to stop the connection and calls
disable_recv(). The actor operates in it's own thread and when it stops
the connection, disable_recv is being called again from a different
thread. Since the actor is told to stop the connection before
disable_recv is called, the two calls to disable_recv may happen
simultaneously.

This causes a race condition issue where both threads can reach past the
check that recv_id is not None before either of them set it to None. If
one of them set it to None before the other one tries to use it, an
error is raised.

This commit calls disable_recv before telling the actor to stop the
connection. Since disable_recv is a blocking call, this ensures that
recv_id is being set to None before the actor thread begins to stop the
connection.

Fixes #781
2014-08-14 01:58:48 +02:00
Trygve Aaberge
bac3bfb7a2 log: Don't disable loggers when loading fileConfig
The default when loading config for logging from a file is to disable
existing loggers. Since some loggers are created before logging is set
up, these loggers were disabled if logging/config_file is set.

(cherry picked from commit cb0387c46d)

Conflicts:
	docs/changelog.rst
2014-08-11 13:00:01 +02:00
Stein Magnus Jodal
c48103f1d2 deps: Remove GStreamer mixers from element list 2014-07-24 14:17:06 +02:00
Stein Magnus Jodal
6ab2ef85d4 deps: Add flump3dec (and mpg123audiodec) to Gst element list 2014-07-24 14:16:16 +02:00
Stein Magnus Jodal
0463b14a6a Revert "Remove 'mad' from 'mopidy deps' listing"
This reverts commit cb6e19c039.

The "mad" element is the only way to decode MP3 with GStreamer 0.10 on OS X.
2014-07-24 14:11:17 +02:00
Stein Magnus Jodal
292cf8f32d Fix Mopidy version when run from another Git repo (related to #706) 2014-07-22 16:26:39 +02:00
Stein Magnus Jodal
47b44791a6 log: Colorize logs, unless logging/color is false
Fixes #772
2014-07-14 01:40:48 +02:00
Stein Magnus Jodal
7a08cb69c1 log: Reorder module 2014-07-13 23:43:28 +02:00
Stein Magnus Jodal
cb6e19c039 Remove 'mad' from 'mopidy deps' listing
The 'lame' element does the same job, and is preferable since mad is GPL
licensed.
2014-06-30 13:01:29 +02:00
Stein Magnus Jodal
b754885064 Fix all import order warnings 2014-05-07 20:08:43 +02:00
Trygve Aaberge
d62ad966af network: Respond to messages before closing connections
This makes a connection tell the actor to stop the connection, instead
of stopping it itself. This is preferable, because other messages sent
to the actor that is not processed yet, may now send data to the client.

E.g. it makes this work:
$ echo status | nc localhost 6600
2014-04-25 06:11:01 +02:00