Commit Graph

7535 Commits

Author SHA1 Message Date
Laurent Monin
99f99b7434 Minor code tidy up 2019-05-28 21:08:20 +02:00
Laurent Monin
1b08c55de5 Add TagGenreFilter.filter() method
Suggested by phw
2019-05-28 20:51:51 +02:00
Laurent Monin
1aee66ccff Pass filters directly instead of passing config.setting
Suggested by phw
2019-05-28 20:34:01 +02:00
Laurent Monin
cb6c2b8825 Strip whitespaces around expressions (after +/-), and tests 2019-05-28 15:25:50 +02:00
Laurent Monin
b3a25c17b0 Improve genre filter playground, clear colors on empty lines 2019-05-28 13:43:01 +02:00
Laurent Monin
26d9eb6ed1 Make tool tips translatable 2019-05-28 13:12:12 +02:00
Laurent Monin
db39685a35 Remove FIXME comment, it was done in previous commits 2019-05-28 12:35:20 +02:00
Laurent Monin
896569d9d8 Since comparison is case-insensitive, no need to convert to lowercase 2019-05-28 12:34:36 +02:00
Laurent Monin
f1bf736ec6 Add "one per line" and a note about the test zone not being saved 2019-05-28 12:33:20 +02:00
Laurent Monin
c50331abb7 Ignore case when matching strict, wildcard and regex genre filters 2019-05-28 12:30:55 +02:00
Laurent Monin
1bcad37f86 Handle upgrade, and provide a working UI for setting genres_filter
- bump Picard version to 2.2.0dev3 and add a hook to convert ignore_genres to genres_filter
- modify Genres UI
- add a playground to test genre_filter
- improve error handling
2019-05-27 14:53:34 +02:00
Laurent Monin
e02dc620a1 Replace ignore_genres with genres_filter
Syntax guide:

Whitespaces at start/end of line are stripped
Lines not starting with + or - are ignored

Strict matching:
-jazz

Wildcard matching:
-jazz*

Regex matching:
-/j.zz.*$/

Whitelisting:
-*
+jazz
2019-05-26 19:24:14 +02:00
Laurent Monin
985f19fb97 Refactor tag/genre ignore code, and add matching tests 2019-05-26 12:53:09 +02:00
Laurent Monin
54e562c8a6 Merge pull request #1192 from zas/bump_api
PICARD-1513: Bump version to 2.2.0dev2 and api version to 2.3
2019-05-12 21:53:08 +02:00
Laurent Monin
a8282c5193 Bump version to 2.2.0dev2 and api version to 2.3 2019-05-10 14:40:30 +02:00
Laurent Monin
81bc369753 Merge pull request #1190 from Harakku/file_hooks
PICARD-143, PICARD-1510: Add hooks for file addition to and file removal from a track
2019-05-10 14:35:43 +02:00
Joel Lintunen
05e23d92b9 Merge branch 'master' into file_hooks 2019-05-10 02:59:32 +03:00
Laurent Monin
03232af8b8 Merge pull request #1191 from Harakku/album_hooks
PICARD-1512: Add a hook for album removal
2019-05-09 13:06:48 +02:00
Laurent Monin
62e8270cfc Merge pull request #1186 from zas/save_hook
PICARD-1130: Add a post save hook
2019-05-09 13:05:48 +02:00
Laurent Monin
7240889c78 Merge pull request #1188 from zas/lrucache_refactor
LRUCache: inherit from MutableMapping + tests
2019-05-09 13:04:47 +02:00
Joel Lintunen
22c8f2a19d Add hooks for file addition to and removal from an album 2019-05-08 02:22:18 +03:00
Joel Lintunen
235f525a67 Add a hook for album removal 2019-05-07 19:10:03 +03:00
Laurent Monin
e263c80117 Merge pull request #1179 from zas/plugin_refactor_2
Plugin refactor: explode in smaller bits
2019-04-30 09:03:40 +02:00
Laurent Monin
be6ec66ff7 Merge pull request #1189 from zas/script2filename_refactor
Ensure script_to_filename() doesn't modify passed metadata
2019-04-29 11:22:15 +02:00
Laurent Monin
4d53bf5532 Merge pull request #1187 from zas/script_improv
Improve wrong number of arguments script error message
2019-04-28 19:32:37 +02:00
Laurent Monin
2848b76f1c Improve script tests: use assertRaisesRegex() and remove useless self.fail()
Suggested by Mineo
2019-04-25 14:14:45 +02:00
Laurent Monin
79f9365e7b PICARD-1130: Add a post save hook
- register_file_post_save_processor()
- run_file_post_save_processors() is called in File._save_and_rename() just before returning
2019-04-25 14:00:30 +02:00
Laurent Monin
c3634420dc Ensure script_to_filename() doesn't modify passed metadata
- it's hard to be sure the caller did a copy or not before
- there's no point in modifying the passed metadata
- no need to copy over images to temporary Metadata object
2019-04-19 19:09:16 +02:00
Laurent Monin
13934fccde LRUCache: inherit from MutableMapping + tests 2019-04-19 18:40:28 +02:00
Laurent Monin
437c55ea2e Make wrong number of arguments script error message more explicit, along tests 2019-04-19 10:05:21 +02:00
Laurent Monin
25f6a60fe5 Use argcount since it's equal to len(args) 2019-04-19 09:22:53 +02:00
Laurent Monin
7274e1f5d3 Log exception even though we pass 2019-04-18 18:31:17 +02:00
Laurent Monin
c4ff226bd5 Move a big part of plugin.py to new pluginmanager.py 2019-04-18 11:30:08 +02:00
Laurent Monin
e5d1279183 Add tests for PluginManager.load_plugins_from_directory() 2019-04-18 11:14:48 +02:00
Laurent Monin
2d8a1f8136 Unload plugin before each test 2019-04-18 11:14:48 +02:00
Laurent Monin
6bacf2deb4 _get_test_plugins(): Ignore __pycache__ 2019-04-18 11:14:48 +02:00
Laurent Monin
7fceae05f7 Minor warnings fixes 2019-04-18 11:14:48 +02:00
Laurent Monin
1b1800ae75 Clean up plugin test files
- remove extra space in files
- add a MANIFEST.json to dummyplugin.picard.zip (and remove metadata from python file)
2019-04-18 11:14:48 +02:00
Laurent Monin
73b0954ef6 _install_plugin_zip(): use of os.link() and let NamedTemporaryFile() deletes the temp file
- os.link() is supported on windows since 3.2
2019-04-18 11:14:48 +02:00
Laurent Monin
53f4467855 Clean up error message 2019-04-18 11:14:47 +02:00
Laurent Monin
e5d4ba5cac imp.get_suffixes() is deprecated since 3.3, use importlib.machinery.all_suffixes()
https://docs.python.org/3/library/imp.html#imp.get_suffixes
https://docs.python.org/3/library/importlib.html#importlib.machinery.all_suffixes
2019-04-18 11:14:47 +02:00
Laurent Monin
99e5d16208 Use tuples instead of lists for constants 2019-04-18 11:14:47 +02:00
Laurent Monin
2f9e4b763d Move _extension_points out constants declaration block, it isn't one 2019-04-18 11:14:47 +02:00
Laurent Monin
42dc7cbde8 _suffixes -> _SUFFIXES 2019-04-18 11:14:47 +02:00
Laurent Monin
c1a017d110 _package_entries -> _PACKAGE_ENTRIES 2019-04-18 11:14:47 +02:00
Laurent Monin
51e85f6883 PluginManager.install_plugin(): assert path or plugin_name, and test it 2019-04-18 11:14:47 +02:00
Laurent Monin
d8eecb76ae Fix and simplify error message 2019-04-18 11:14:47 +02:00
Laurent Monin
359ac24d9b Fix error message: path isn't always defined, use plugin_name, use log.error 2019-04-18 11:14:47 +02:00
Laurent Monin
c6710e906f Log exception message 2019-04-18 11:14:47 +02:00
Laurent Monin
76bcc8d007 PluginManager.install_plugin(): OSError/IOError are likely raised by _install_plugin_*()
- Catch sooner, and return
2019-04-18 11:14:47 +02:00