Commit Graph

7535 Commits

Author SHA1 Message Date
Lukáš Lalinský
98498793a8 Load user collections after login 2014-04-25 21:21:25 +02:00
Lukáš Lalinský
9e35edca3a Initial version of OAuth authentication 2014-04-25 20:58:11 +02:00
Laurent Monin
645aa64c15 log.warning() will take care of format parameters, '%' -> ',' 2014-04-25 19:11:35 +02:00
Laurent Monin
26dca738f1 Add a note about optional priority parameter in NEWS.txt 2014-04-25 15:07:41 +02:00
Laurent Monin
48b9a5b32b Use constants instead of hard-coded string and number.
"picard.plugins." -> _PLUGIN_MODULE_PREFIX

It also fixes a potential issue forgotten in 5c25d56b7 preventive fix.
2014-04-25 12:50:35 +02:00
Sophist
f272a7c442 Merge pull request #4 from zas/PluginPriority
Improvements to plugin priority handling by @zas.
2014-04-25 11:40:09 +01:00
Laurent Monin
2c72bbab1c Log when a plugin conflicts with a previously loaded one.
Old one was silently replaced, this debug information will help to know
which one was replaced by which one.

Here is an example of log:
```
D: 12:29:36 Looking for plugins in directory '/home/zas/.config/MusicBrainz/Picard/plugins', 1 names found
D: 12:29:36 Module 'addrelease' conflict: unregistering previously loaded u'Add Cluster As Release' version 0.5 from '/home/zas/src/picard_zas/contrib/plugins/addrelease.py'
D: 12:29:36 Loading plugin u'Add Cluster As Release' version 0.5, compatible with API: 1.0
```
2014-04-25 12:33:18 +02:00
Laurent Monin
12bf7d7b75 Log number of plugin names found in each directory 2014-04-25 12:28:20 +02:00
Laurent Monin
6c27d39f44 Use path returned by imp.find_module() instead of module.__file__
It will display the source file path (.py) instead of the compiled file path (.pyc)
2014-04-25 12:06:30 +02:00
Laurent Monin
3b5fe5f6d0 No need to traceback on VersionError, just display an error
Traceback isn't useful in this case anyway.
2014-04-25 12:01:47 +02:00
Laurent Monin
8afce2a1d4 Use version_from_string() and sets intersection to check API vs plugin versions
Logging was improved, showing plugin version and compatible API versions in debug mode.
When a plugin cannot be loaded due to incompatible API version log as a warning (was info).
2014-04-25 12:01:47 +02:00
Laurent Monin
9f63a24cf8 Reformat api_versions list, one per line, and note about order
Order is important since we have now a test case to prevent a lower version to be added.
2014-04-25 12:01:47 +02:00
Laurent Monin
d7ba54dc51 Make version_to_string() and version_from_string() more tolerant
With those changes they can be used to parse plugin API versions too.

Test cases were modified accordingly.

Main changes:
```python
>>> version_from_string("1.0")
(1, 0, 0, 'final', 0)
>>> version_from_string("1.0.1")
(1, 0, 1, 'final', 0)
```
2014-04-25 12:01:47 +02:00
Laurent Monin
23ef8465f9 Try to run on previous Picard versions at normal priority.
Since there is no PluginPriority on previous Picard versions, this plugin will
raise an exception, better catch it and emit a warning.

Sophist said:
"It will work in most cases at normal priority, but any other plugins that run before it will get the old performers rather than the standardized performers.
2014-04-25 11:21:29 +02:00
Laurent Monin
8deddf772d Use PluginPriority.HIGH and rename weight to priority 2014-04-24 21:45:11 +02:00
Laurent Monin
b7468b82f0 Use PluginFunctions and PluginPriority to reduce code redundancy.
weight was renamed priority
Execution loops were replaced by PluginFunctions.run() call
2014-04-24 21:45:11 +02:00
Laurent Monin
2fc6da074b Add PluginPriority and PluginFunctions classes
PluginPriority defines few common values for plugin execution priority.

PluginFunctions wraps ExtensionPoint and use defaultdict() to handle priorities.
It also provide a register() and a run() methods.
2014-04-24 21:45:11 +02:00
Sophist
4724e73015 Set default weights to 100...
and plugin weight to 200.
2014-04-24 09:55:54 +01:00
Sophist
1a4d2b5ce7 Set default weights to 50 ...
... so we can have plugins with lower than default priority.
2014-04-24 09:55:53 +01:00
Laurent Monin
60fc6e4499 Add weight parameter to metadata_processors
Processors having more weight will be run first, default weight is 0.
2014-04-24 09:55:52 +01:00
Sophist
52e4766ec7 Add NEWS 2014-04-24 09:55:51 +01:00
Sophist
f1d3e2b46e Add Standardise Performers plugin 2014-04-24 09:55:02 +01:00
Sophist
fd72f10d59 Add track metadata plugin priority processing
All track metadata processors are equal but some are more equal than
others.

This commit allows a track metadata plugin to register with high
priority, and to run before plugins which are not high priority. This is
needed for the Standardize Performers plugin.
2014-04-24 09:55:01 +01:00
Laurent Monin
fb7e730932 Merge pull request #296 from Sophist-UK/sophist_switch_albumartist_website_to_xmlnode
Switch albumartist_website to XmlNode
2014-04-24 10:30:20 +02:00
Laurent Monin
a54645f0ec Merge pull request #302 from Sophist-UK/sophist_enhance_#285
Use multi-value %_performance_attributes% ...
2014-04-24 10:09:44 +02:00
Sophist
b90f87ce12 Fix layouts again (zas comment) 2014-04-23 20:34:16 +01:00
Laurent Monin
5123151e9d Merge pull request #303 from Sophist-UK/sophist_persist_log_status_dialog_size_position
Persist log view position and size.
2014-04-23 12:04:34 +02:00
Sophist
efdb780652 Persist log view position and size. 2014-04-22 22:14:28 +01:00
Sophist
6818e3451c Handle multiple websites 2014-04-22 18:20:34 +01:00
Laurent Monin
32eb021e24 Merge pull request #301 from Sophist-UK/sophist_fix_tag_brackets
Simplify display_tag_name
2014-04-22 13:05:41 +02:00
Sophist
16a47dae23 Fix layout (zas comments)
Note: Whilst the previous indentation of "and" was incorrect as per
PEP-8, I think it was actually more readable.
2014-04-22 11:55:11 +01:00
Laurent Monin
ef9a3309d3 Merge pull request #3 from zas/test_display_tag_name
Add a test for util.tags.display_tag_name()
2014-04-22 10:36:56 +02:00
Laurent Monin
14c09a8d1e Add a test for util.tags.display_tag_name() 2014-04-22 10:31:19 +02:00
Sophist
4dd8ade4b5 Use multi-value %_performance_attributes% ...
... instead of %_performance_live%, etc.

Modifies #285.
2014-04-21 21:55:44 +01:00
Sophist
9cbe03f6c0 Simplify display_tag_name 2014-04-21 16:54:07 +01:00
Sophist
6aea5be41b Increment version no. 2014-04-21 12:10:41 +01:00
Sophist
fe88b779e1 Switch albumartist_website to XmlNode
Resolves PICARD-593.

Fixes issue with #275 when run from Picard executable under Windows.
2014-04-21 12:10:39 +01:00
Laurent Monin
daa6b39f44 Merge pull request #285 from Sophist-UK/sophist_add_work_relationship_variables
Add %_performance_live%, %_performance_cover% etc. for work relationships.
2014-04-21 09:40:20 +02:00
Sophist
21463889f7 Remove ~workrelationship stuff. 2014-04-21 08:00:17 +01:00
Laurent Monin
56af0c5977 Merge pull request #297 from Sophist-UK/sophist_fix_metadata_display_sort_order
Fix metadatabox sort order
2014-04-20 20:01:25 +02:00
Sophist
6302f26e7c Fix metadatabox sort order
Sort by displayed value not internal value.
2014-04-20 16:25:17 +01:00
Sophist
b042e5e514 Handle i18n differently ...
... so that work relationship text can be translated as a phrase and not
as individual words.
2014-04-20 07:50:05 +01:00
Sophist
09bb0a3c75 Switch variable names and add ~workrelationship
which mimics the work relationship statement on the MB web site e.g.
`{live} {medley:medley including a} {partial} {instrumental} {cover}
recording of`
2014-04-20 07:50:04 +01:00
Sophist
c61330dce3 Add NEWS 2014-04-20 07:49:39 +01:00
Sophist
edd22a8a96 Add %_live%, %_cover% etc. for work relationships. 2014-04-20 07:49:11 +01:00
Laurent Monin
e6b510a288 Indentation fix.
3dd891f285 (commitcomment-6063394)
2014-04-20 00:47:11 +02:00
Laurent Monin
7427ebf34c Update picard.pot 2014-04-19 10:13:11 +02:00
Laurent Monin
3dd891f285 PEP8 fixes.
Mostly code formatting, shortening lines, white-space fixes.
2014-04-19 10:02:49 +02:00
Laurent Monin
105068d2b3 Fix few missing blank lines (PEP8). 2014-04-19 09:26:29 +02:00
Laurent Monin
2ee38b52bb PEP8 fixes. 2014-04-19 09:18:50 +02:00