Commit Graph

6222 Commits

Author SHA1 Message Date
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
Laurent Monin
2fad9fb87b PluginManager.install_plugin: simplify code using try/except/else 2019-04-18 11:14:47 +02:00
Laurent Monin
ae779631c1 Actually import DummyPlugin to ensure it was properly loaded 2019-04-18 11:14:47 +02:00
Laurent Monin
dd42b5e3bd Add tests for zipped plugin installed from picard plugins ws 2019-04-18 11:14:47 +02:00
Laurent Monin
f9cc6c1d81 packaged_module support is not really implemented 2019-04-18 11:14:47 +02:00
Laurent Monin
3634cbb99b TestPicardPluginsInstall: get rid of useless loop 2019-04-18 11:14:47 +02:00
Laurent Monin
e78e06efba _install_plugin_*(): Improve debug output 2019-04-18 11:14:47 +02:00
Laurent Monin
f6f7b58c38 Add tests for PluginManager.install_plugin() 2019-04-18 11:14:47 +02:00
Laurent Monin
8c3ac81a1c PluginManager.install_plugin(): drop unused overwrite_confirm kwarg 2019-04-18 11:14:47 +02:00
Laurent Monin
6162f93363 PluginManager.__init__(): add kwarg plugins_directory, defaulting to USER_PLUGIN_DIR 2019-04-18 11:14:47 +02:00
Laurent Monin
76487b0b0b Add tests for _plugin_name_from_path() 2019-04-18 11:14:47 +02:00
Laurent Monin
b746139303 Cache full module name using a local variable 2019-04-18 11:14:46 +02:00
Laurent Monin
194935a6ff Invert test and branches, to be consistent with code above 2019-04-18 11:14:46 +02:00
Laurent Monin
ab794fe387 importer->zip_importer, since it's specifically about importing zipped modules 2019-04-18 11:14:46 +02:00