Commit graph

6487 commits

Author SHA1 Message Date
xsteadfastx
1249911d98 Merge pull request #1324 from xsteadfastx/master
Updated permissions plugin to change directory permissions too.
2015-02-17 11:50:01 +01:00
Marvin Steadfast
b9174d176f The permissions plugin now uses startswith for finding ancestors in the library path. 2015-02-17 11:45:21 +01:00
Marvin Steadfast
dd0de2f04b Made the permissions plugin simpler. Got rid of some non-needed code and use the ancestors function instead of writing something new. 2015-02-17 11:41:15 +01:00
Marvin Steadfast
27f4732d3d Updated permissions plugin docs 2015-02-17 11:41:15 +01:00
Marvin Steadfast
8b08ec568c permissions plugin now uses a set instead of a OrderedDict to find duplicates in a list 2015-02-17 11:41:15 +01:00
Marvin Steadfast
21aedeb51a Updated permissions plugin to change directory permissions too. 2015-02-17 11:41:15 +01:00
Adrian Sampson
04333e3915 Merge branch 'master' of github.com:sampsyo/beets 2015-02-16 22:18:25 -05:00
Tom Jaspers
12ecb2ce35 Fix formatting to new PEP8 version (1.6.2)
PEP8 1.6.2 (2015-02-15):
- added check for breaking around a binary operator

This caused Travis to fail on "W503 line break before binary operator"
2015-02-16 18:21:56 +01:00
Bruno Cauet
39a6145d2d Plugin play uses default item sort in album mode
Offer library.get_default_{item,album}_sort for that purpose.
2015-02-16 12:26:23 +01:00
Bruno Cauet
c47221555f Add beets.util.interactive_open() find cmd + execute
interactive_open() takes a target and an optional command, if it does not
receive a command then it uses open_anything().

It parses command and lexes it with shlex.split(), revieling the client
from that task.

"config -e" command uses it, and gives a better error message in case of
problem. "play" plugin uses it as well, as side-effect being that the
command is now interactive, as requested in issue #1321.

Fix issue #1321.
2015-02-16 12:26:17 +01:00
Bruno Cauet
489b6b2e7e Move many tests from test_library to test_util
Sice they only test functions from beets/util/__init__.py there's not
reason for them to reside in test/test_library.py.
2015-02-16 11:53:01 +01:00
Bruno Cauet
5d9128aff3 util.interactive_open() return open/xdg-open/start
Depending on the platform return the correct automatic execution
command.
2015-02-16 11:35:13 +01:00
Bruno Cauet
1d8160f9ff Play plugin: use OO, don't pass log around 2015-02-16 10:50:41 +01:00
Tom Jaspers
d70a82449e Fields: show computed and flexible fields
- Computed fields from the _getters
- Flexible fields for which a type is defined
  (in _types or in a plugins' item_types/album_types)

Fix #1030
2015-02-16 10:34:35 +01:00
Malte Ried
b3fc489305 Fixed the flake8 check... 2015-02-15 19:50:11 +01:00
Malte Ried
eafdd9e379 Extraction of cover art of albums with non ascii characters lead to a crash. 2015-02-15 19:39:39 +01:00
Adrian Sampson
494990a7a2 Merge pull request #1322 from tomjaspers/import-metadata-source
Set importer metadata source as field
2015-02-15 09:45:12 -08:00
Tom Jaspers
1555d3fe17 Importer metadata source is saved as flex attr
Saving a file "as is" keeps the data_source attribute unset
2015-02-15 17:46:00 +01:00
Bruno Cauet
13e47472ac Play plugin: byte newlines in files written
Avoid unicode errors when writing '\n' around file paths.
2015-02-15 15:49:46 +01:00
Adrian Sampson
296c2fc3de Merge pull request #1325 from brunal/master
Delete 'format' variables that shadow the built-in
2015-02-13 17:50:46 -08:00
Adrian Sampson
8f7f7b92b8 play: unicode_literals fix 2015-02-13 17:40:32 -08:00
Adrian Sampson
b80713ce5b Lambda-free reference to instance method
Amends 9cdd541943, the fix for #1326.
2015-02-13 17:37:55 -08:00
Tom Jaspers
9cdd541943 Error handling for 'filesize' field
- Logs a warning and returns 0 if getsize fails
- Add tests for this

Fix #1326
2015-02-13 12:24:21 +01:00
Bruno Cauet
e1e46df1b3 Fix path truncation test: really use bytes
Test is to use bytes but because of __future__.unicode_literals it used
unicode.
2015-02-12 11:56:54 +01:00
Bruno Cauet
d267741ff3 Delete 'format' variables that shadow the built-in
Also cleanup the 'the' plugin a bit: delete unused variables.

Relates to #1300.
2015-02-11 16:26:16 +01:00
Tom Jaspers
c286ea38de Importer metadata source is set as a field: docs
docs + changelog

See #1311
2015-02-11 10:29:13 +01:00
Tom Jaspers
20ae26dd77 Importer metadata source is set as a field: tests
See #1311
2015-02-11 10:14:56 +01:00
Bruno Cauet
06cc5346f2 Make less assumptions on plugin log levels 2015-02-11 09:11:34 +01:00
Bruno Cauet
5a1f499c64 Discogs plugin: fix event listener params
Also delete related deprecated comment.
2015-02-11 09:11:20 +01:00
Tom Jaspers
228e5c0432 Importer metadata source is set as a field
TrackInfo and AlbumInfo were already keeping track of this,
so just had to add it as an actual field to Item and Album

See #1311
2015-02-10 18:17:37 +01:00
Bruno Cauet
a014750e2d Update docs: mention multi-level logging
If you think what I wrote suck, it's because it does.
2015-02-10 17:29:02 +01:00
Bruno Cauet
f1e13cf886 Offer verbose and very verbose modes
'verbose' is now an int and not a boolean. '-v' is level 1, '-vv' level
2. In the configuration it can be set with 'verbose: 1' or 'verbose: 2'.

Improve #1244: auditing current log levels of plugins remains.
2015-02-10 17:13:15 +01:00
Bruno Cauet
327b62b610 Improve logging management for plugins: fixes
Delete the remaining usages of BeetsPlugin.listen().

Since BeetsPlugin.listeners are wrapped by a loglevel-setting function,
we cannot easily check their unicity anymore.
BeetsPlugin._raw_listeners set holds the raw listeners.

Legacy plugins that did not handle enough arguments in their listenings
functions may break: dedicated code is now deleted for it would not work
with the decorated listeners.

Tests got fixed. Some modifications were done empirically: if it passes
then it's okay.
2015-02-10 16:55:06 +01:00
Bruno Cauet
4578c4f0e1 Improve logging management for plugins
Listeners get logging level modulations, like import_stages already did.

Add extensive tests:
- explicit plugin commands are logged like core beets (INFO or DEBUG)
- import stages are more silent
- event listeners are like import stages

Delete @BeetsPlugin.listen decorator since listeners need plugin instance
context to set its logging level.

Improve #1244. Next is multiple verbosity levels.
2015-02-10 15:30:15 +01:00
Arturo R
60b1819db0 Stop applying mp3gain directly to files. Fixes #1316
Update docs to remove non-existent `apply` option.
2015-02-09 12:51:27 -08:00
Bruno Cauet
54abd1a510 Merge branch 'invalidqueryerror' 2015-02-09 21:29:01 +01:00
Bruno Cauet
7476d6be46 InvalidQuery*Error extend ParsingError
And InvalidQueryArgumentTypeError does not extend TypeError anymore.
2015-02-09 19:25:23 +01:00
Bruno Cauet
c6455c269f Merge branch 'master' into thumbnails
Conflicts:
	docs/changelog.rst
2015-02-09 16:08:29 +01:00
Bruno Cauet
f443e0bfc5 InvalidQueryArgumentTypeError does not extend InvalidQueryError
Places where InvalidQueryArgumentTypeError may be raised (i.e. all
current ones) may not know the query therefore it cannot be an
InvalidQueryError. The InvalidQueryArgumentTypeError is caught in
beets.library.Library._fetch() and an InvalidQueryError is then raised.

Improve #1290.
2015-02-09 15:44:49 +01:00
Bruno Cauet
54887e7655 Widen usage of InvalidQueryError
Replace previous InvalidQueryError with InvalidQueryArgumentTypeError
which extends the former as TypeError. However they lack context: the
query that caused the error.

Raise an InvalidQueryError when a shell-like expression cannot be parsed
by shlex.

Improve #1290.
2015-02-09 15:28:06 +01:00
Tom Jaspers
6572e1bf5a Fetchart: add empty album check to iTunes art
Was causing some tests to fail in test_art.py:CombinedTest
2015-02-09 14:59:56 +01:00
Tom Jaspers
bbc6d0906b Merge pull request #1312 from tomjaspers/album-path-queries
Album path queries get constructed properly

Fix #1307
2015-02-08 16:43:55 +01:00
Tom Jaspers
0a81aae142 PathQueryTest: rename assert_matched for items 2015-02-08 16:34:28 +01:00
Adrian Sampson
66b7e4cd39 Merge branch 'master' of github.com:sampsyo/beets 2015-02-07 12:52:20 -08:00
Adrian Sampson
e7f8a627e9 Style fixes for pep8 1.6 2015-02-07 12:51:54 -08:00
David Logie
9b9c033df6 importfeeds: Fix Unicode error when writing files. 2015-02-07 15:13:01 +00:00
Tom Jaspers
3ec44aab3e Update _types field instead of assigning it
Assigning it would override our pre-defined types
(such as `path` in Album._types)
2015-02-06 10:42:46 +01:00
Tom Jaspers
049aa2f297 Album path queries get constructed automatically
Ensures that relative path queries also work for -a mode
2015-02-06 10:38:41 +01:00
Tom Jaspers
f4d971d3a8 PathQueryTest now also tests Album queries 2015-02-06 10:36:23 +01:00
Tom Jaspers
80c96d98de Oops, flake8 formatting 2015-02-05 10:54:42 +01:00