Commit graph

24 commits

Author SHA1 Message Date
David Logie
85ffe444dc mpdupdate: Improve error message
When beets can't connect to mpd, display the underlying error instead of
dying with an ugly exception.
2015-06-05 11:45:38 +01:00
Adrian Sampson
07516b2bca Redact some passwords in plugins 2015-03-27 22:42:28 -04:00
Bruno Cauet
4bfa439ee1 database_change: send model that changed 2015-03-16 14:32:37 +01:00
Bruno Cauet
a5026100a3 All plugins use unicode_literals
Given that part of them has no test I may have broke them
2015-01-20 16:22:27 +01:00
Bruno Cauet
90b388b775 Use __future__ imports but unicode_literals everywhere
Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.

Goal is smoothing the transition to python 3.
2015-01-19 12:25:16 +01:00
Bruno Cauet
ca91bc8920 mpdupdate: fix indent 2015-01-13 18:53:30 +01:00
Bruno Cauet
de86b9b570 Clean MPDupdate plugin
- no global variable
- use logging instead of prints
- unicode logging
2015-01-13 12:30:40 +01:00
Frederik “Freso” S. Olesen
4b1f0cbf48 Happy 2015. ;)
See 7a410f636b

Command used:

    git grep -l 'Copyright 201'|xargs sed -i -E 's/Copyright 201./Copyright 2015/'`
2015-01-08 21:37:09 +01:00
Fabrice Laporte
3ead936fe5 flake8 cleaning beetsplug/*
Remaining warnings are related to visual indentation.
2014-04-13 23:24:57 +02:00
Adrian Sampson
d30db10d10 mpdupdate: remove debug clause
Thanks to @phmongeau for pointing out this embarrassing mistake.
2014-01-08 22:43:10 -08:00
Adrian Sampson
0167f67a96 simplify MPD configuration 2013-11-25 22:45:42 -08:00
Peter Schnebel
ac0f62eaf1 proposal for one global 'mpd' config section 2013-10-31 21:03:11 +01:00
Johann Klähn
5414dc80d2 allow and expand home directory in mpdupdate socket
This allows you to use a socket in your home directory (e.g.
`~/.mpd/socket`) without having to specify the full path including the
username (which can change from machine to machine).
2013-09-23 21:47:26 +02:00
John Hawthorn
1bf8ae0a01 mpdupdate: Allow UNIX domain socket for MPD server
If the host configuration begins with a '/', it is assumed to reference
a UNIX domain socket. This is similar to libmpdclient's behaviour.
2013-06-05 13:20:27 -07:00
Dang Mai
d4004f10fa Update comments to reflect config migration 2013-01-31 18:17:00 -05:00
Dang Mai
ef8ef4c747 Update MPD whenever database changes 2013-01-31 18:16:21 -05:00
Adrian Sampson
7a410f636b happy new year
For future reference, this command did the trick:
ack -l 'Copyright 201' | xargs perl -pi -E 's/Copyright 201./Copyright 2013/'
2013-01-11 10:43:41 -08:00
Adrian Sampson
6d68a4855e per-plugin configuration defaults in __init__()
This uses the new BeetsPlugin.config convenience view heavily. Things are
slowly getting less verbose.
2012-12-18 22:35:44 -08:00
Adrian Sampson
3ef9e006f4 finish confit-ifying all the plugins 2012-12-13 17:14:19 -08:00
Philippe Mongeau
9824cee7fb add the 'path' argument to mpdupdate plugin 2012-05-17 12:31:19 -04:00
Adrian Sampson
429af42e14 use print_function __future__ import
All code should now use Python 3-style "print"s.
2012-05-13 21:08:27 -07:00
Adrian Sampson
b68e87b92c The Great Trailing Whitespace Purge of 2012
What can I say? I used to use TextMate!
2012-05-13 20:22:17 -07:00
Adrian Sampson
a28f930c52 transaction objects to control DB access
In an attempt to finally address the longstanding SQLite locking issues, I'm
introducing a way to explicitly, lexically scope transactions. The Transaction
class is a context manager that always fully fetches after SELECTs and
automatically commits on exit. No direct access to the library is allowed, so
all changes will eventually be committed and all queries will be completed. This
will also provide a debugging mechanism to show where concurrent transactions
are beginning and ending.

To support composition (transaction reentrancy), an internal, per-Library stack
of transactions is maintained. Commits only happen when the outermost
transaction exits. This means that, while it's possible to introduce atomicity
bugs by invoking Library methods outside of a transaction, you can conveniently
call them *without* a currently-active transaction to get a single atomic
action.

Note that this "transaction stack" concepts assumes a single Library object per
thread. Because we need to duplicate Library objects for concurrent access due
to sqlite3 limitation already, this is fine for now. Later, the interface should
provide one transaction stack per thread for shared Library objects.
2012-05-06 23:24:05 -07:00
Adrian Sampson
ed89394368 mpdupdate plugin (and config system for plugins) 2010-09-21 10:40:39 -07:00