Commit Graph

7535 Commits

Author SHA1 Message Date
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
Laurent Monin
964d7a53ba Introduce _get_plugin_index_by_name(), trying to make the code more explicit 2019-04-18 11:14:46 +02:00
Laurent Monin
f6502cd8c1 handle_plugin_updates(): separate iteration and logic
- introduce _marked_for_update() generator
- rename a bunch of variables to make things easier to understand
2019-04-18 11:14:46 +02:00
Laurent Monin
71e4862428 Update trick is only for plugins installed through the Picard UI
And only for plugins in plugins_directory (USER_PLUGIN_DIR by default), it makes
no sense to even try it for other directories
2019-04-18 11:14:46 +02:00
Laurent Monin
ca0fbd9169 PluginManager.load_plugindir() -> load_plugins_from_directory() 2019-04-18 11:14:46 +02:00
Laurent Monin
c3cb4e1131 PluginManager.load_plugin() -> _load_plugin_from_directory() 2019-04-18 11:14:46 +02:00
Laurent Monin
db39d741cb _get_existing_paths(): use PluginManager.plugins_directory 2019-04-18 11:14:46 +02:00
Laurent Monin
370e65efb4 Introduce PluginManager.plugins_directory property, set to USER_PLUGIN_DIR 2019-04-18 11:14:46 +02:00
Laurent Monin
bc345329b5 Introduce bunch of is_*()/strip_*() helper functions to simplify code 2019-04-18 11:14:46 +02:00
Laurent Monin
762ac9659d Remove always true condition, plugin_name is tested 2 lines above 2019-04-18 11:14:46 +02:00
Laurent Monin
4ee063487b Move part of install_plugin() to new _install_plugin_dir() 2019-04-18 11:14:46 +02:00
Laurent Monin
367b6452b0 Move part of install_plugin() to new _install_plugin_file() 2019-04-18 11:14:46 +02:00
Laurent Monin
fc436bae59 Move part of install_plugin() to new _install_plugin_zip() 2019-04-18 11:14:46 +02:00
Laurent Monin
259fea0408 Pass plugin directory to _remove_plugin_files() 2019-04-18 11:14:46 +02:00
Laurent Monin
aacb85760e Move most of _remove_plugin() to new _remove_plugin_files() 2019-04-18 11:14:46 +02:00
Laurent Monin
3231c68949 '.update' -> _UPDATE_SUFFIX constant 2019-04-18 11:14:46 +02:00
Laurent Monin
5d5a241770 PluginManager._get_existing_paths(): pass extensions and dir path as params
- store extensions to match in module-level constant _FILEEXTS
- pass USER_PLUGIN_DIR instead of hardcoding it
2019-04-18 11:14:46 +02:00
Laurent Monin
689fcdcc48 Drop PluginManager._api_versions, use picard.api_versions_tuple instead
- modify PluginManager._compatible_api_versions()
- add matching tests
2019-04-18 11:14:46 +02:00
Laurent Monin
45a6b20b85 Introduce picard.api_versions_tuple
- list of versions as tuples
- constant calculated from picard.api_versions
- add tests
- skip tests if not enough elements (previous code didn't make sense anyway)
2019-04-18 11:14:45 +02:00
Philipp Wolfer
a1a79658bf Merge pull request #1185 from phw/use-appid-constant
Use PICARD_APP_ID constant instead of hardcoded strings
2019-04-09 19:00:17 +00:00
Philipp Wolfer
adec42868c Use PICARD_APP_ID also for CFBundleIdentifier 2019-04-09 11:38:21 +02:00
Philipp Wolfer
1800e3cce5 Use PICARD_APP_ID constant instead of hardcoded strings 2019-04-09 11:18:18 +02:00
Philipp Wolfer
7aa7629ae4 PICARD-1502: Call setDesktopFileName before creating QApplication 2019-04-08 15:31:00 +00:00
Laurent Monin
160c944174 Merge pull request #1183 from phw/PICARD-1502-setdesktopfilename
PICARD-1502:  Ensure proper app-id on Wayland
2019-04-08 16:32:47 +02:00
Laurent Monin
794b454f53 Merge pull request #1180 from zas/extensions
Rework ExtensionPoint
2019-04-08 16:32:30 +02:00
Laurent Monin
5c2739b923 ExtensionPoint.register(): module -> name, to be consistent with other methods 2019-04-08 09:21:51 +02:00
Philipp Wolfer
6f3e32f711 PICARD-1502: Use QApplication.setDesktopFileName to ensure proper app-id on Wayland 2019-04-08 08:38:43 +02:00
Laurent Monin
5eebc9093f Merge pull request #1182 from zas/PICARD-1503
PICARD-1503: fix CDROM device containing ampersand (&)
2019-04-07 22:15:55 +02:00
Laurent Monin
882a9ff418 PICARD-1503: fix CDROM device containing ampersand (&)
Patch by Philipp Hahn
2019-04-07 20:57:46 +02:00
Laurent Monin
434be1f155 Merge pull request #1181 from zas/isort_version
Add requirements-dev.txt, with working isort version and various tools
2019-04-07 16:41:05 +02:00
Laurent Monin
2a90443de4 Add --diff --quiet to isort pre-commit hook example 2019-04-07 15:45:51 +02:00
Laurent Monin
e6ae468077 Add a note about requirements-dev.txt to CONTRIBUTING.md and merge HACKING.txt 2019-04-07 15:25:02 +02:00
Laurent Monin
69b91ad5e7 Add requirements-dev.txt, with working isort version and various tools 2019-04-07 12:02:34 +02:00
Laurent Monin
59d0bdd3ca Only log plugins register
Others aren't displayed anyway, since log.debug doesn't work yet.
A commented print() is kept to help debugging
2019-04-06 22:42:34 +02:00
Laurent Monin
5a89099684 ExtensionPoint(): use defaultdict(list) to store items
- it reduces number of iterations needed in __iter__()
- it simplifies unregister_module()
2019-04-06 22:36:18 +02:00
Laurent Monin
f7318f886e Add a label to ExtensionPoint to ease debugging
Sample output:
D: 21:57:50,448 plugin.register:128: ExtensionPoint: album_metadata_processors register <- module='discnumber' item=<function remove_discnumbers at 0x7fcefbbeb1e0>
D: 21:57:50,449 plugin.register:128: ExtensionPoint: cluster_actions register <- module='fix_tracknums' item=<picard.plugins.fix_tracknums.FixTrackNumsUsingTitles object at 0x7fcefbbe94c8>
2019-04-06 22:08:41 +02:00
Philipp Wolfer
7cfdccf425 Merge pull request #1177 from phw/use-isort
Run isort over all files
2019-04-04 15:38:21 +00:00
Philipp Wolfer
bdeaa32967 CI: Run isort with --diff --quiet 2019-04-04 15:44:00 +02:00