Commit graph

29 commits

Author SHA1 Message Date
Johnny Robeson
6eb1de5405 fix linelengths from displayable_path 2016-06-10 04:08:59 -04:00
Johnny Robeson
daac41668e use util.displayable_path in more tests 2016-06-10 03:54:39 -04:00
Johnny Robeson
330306bbe2 remove bytes casts from object/method resolution code 2016-05-30 23:21:24 -04:00
Adrian Sampson
71b9fd785c Revert "Do __name__ comparison with bytes and not unicode"
This reverts commit 9c41c39913.
That commit used byte strings for the `if __name__ == '__main__'` pattern,
which was necessary when we were doing unicode_literals. But it is wrong on
Python 3, and now that we're liberated from unicode_literals, we need to go
back to native strings for this comparison.
2016-05-29 19:19:59 -07:00
Adrian Sampson
e54c7eec3d Standardize __future__ imports without parentheses
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Peter Kessen
be8feedfe6 Removed unicode_literals from test_plugins 2016-02-24 07:49:18 +01:00
Diego Moreda
b49426046a Fix unrestored AutotagStub on two TestCases
* Call AutotagStub.restore() during the tearDown of
test_mbsubmit.MBSubmitPluginTest and test_plugins.PromptChoicesTest,
which could potentially lead to other tests calling mocked versions
of autotag.mb.match_album, .match_track, .album_for_id and .track_for_id
instead of the real functions.
2016-01-22 21:33:33 +01:00
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Diego Moreda
b7747013d3 Prompt event unit tests
* Add "before_choose_candidate" unit tests (PromptChoicesTest), containing
tests for checking the addition of choices to ui.input_options (album and
singletons), conflict resolution, and callback handling (regular and with
return value).
2015-12-16 19:23:27 +01:00
Peter Kessen
3eb8008b11 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
Bruno Cauet
7f34c101d7 Plugin events: restore backwards compatibility
An event listener that expects too few arguments won't crash, arguments
will be cut off instead. This restores a backwards-compatibility hack
that was removed in commit 327b62b6.
2015-03-19 13:37:53 +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
Malte Ried
e681449785 Added documentation
FileFilterPlugin uses the new return value feature
Some tweaks to get the code more readable
2015-02-01 17:01:06 +01:00
Malte Ried
a608a5fc36 Plugins are able to return a list of import tasks to create instead of the original import task using the import_task_created event. Needed for #1167 2015-01-31 12:41:01 +01:00
Bruno Cauet
c2f8cb9983 Merge branch 'master' into future
Conflicts:
	test/test_plugins.py
2015-01-21 10:04:33 +01:00
Adrian Sampson
07f99e6ab7 Fix up tests for import_task_created (#1186) 2015-01-20 14:51:26 -08:00
Bruno Cauet
9c41c39913 Do __name__ comparison with bytes and not unicode 2015-01-20 12:03:57 +01:00
Bruno Cauet
2dab8e5fd6 Import unicode_literals in beets package 2015-01-19 21:41:33 +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
2902cda036 tests: use absolute imports everywhere 2015-01-19 12:25:15 +01:00
Malte Ried
ad65242ebd Merge branch 'master' into import-filefilter
Conflicts:
	beets/importer.py
	beets/plugins.py
	beetsplug/ihate.py
2015-01-14 10:46:03 +01:00
Bruno Cauet
2e57d8660e Ensure there's no duplicate plugin listeners
A same function cannot be registered twice on a given event.
This will permit improvements of some plugins (e.g. smartplaylist)
2015-01-13 11:29:42 +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
Malte Ried
d71a8227e2 Added documentation and tests 2015-01-04 19:02:22 +01:00
Fabrice Laporte
b89c8e78e3 remove test_util.py 2014-12-17 22:16:23 +01:00
pscn
291675330d Allow plugins to define the same flexible fields if they are of the same
type #1059
2014-11-04 21:20:35 +01:00
Thomas Scholtes
0bf7c06f7d Media file tags can be customized with the `write` event 2014-09-17 12:05:17 +02:00
Thomas Scholtes
aa24fa7c1b Fix tests on python2.6 2014-09-14 12:34:46 +02:00
Thomas Scholtes
475d4899ee Add tests for plugins providing flexible field types 2014-09-14 12:34:45 +02:00