Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When there is more than one copy of a plugin, use the most local one (fix #2362) #2364

Merged
merged 4 commits into from Jun 4, 2016

Conversation

@ralsina
Copy link
Member

@ralsina ralsina commented Jun 4, 2016

No description provided.

# Find repeated plugins and discard the less local copy
def plugin_position_in_places(plugin):
for i, place in enumerate(self._plugin_places):
if plugin[0].startswith(place):

This comment has been minimized.

@Kwpolska

Kwpolska Jun 4, 2016
Member

could use some explainer comments that tell future readers what plugin is here, it took me a while to parse all this


plugin_dict = defaultdict(list)
for data in self.plugin_manager._candidates:
plugin_dict[data[2].name].append(data)

This comment has been minimized.

@Kwpolska

Kwpolska Jun 4, 2016
Member

why [2], what are the previous positions?

This comment has been minimized.

@ralsina

ralsina Jun 4, 2016
Author Member

they are "path to the .plugin file, path to the module, metadata about the
plugin"

On Sat, Jun 4, 2016 at 1:37 PM Chris Warrick notifications@github.com
wrote:

In nikola/nikola.py
#2364 (comment):

@@ -930,6 +929,23 @@ def init_plugins(self, commands_only=False, load_all=False):
bad_candidates.add(p)
utils.LOGGER.debug('Not loading compiler extension {}', p[-1].name)
self.plugin_manager._candidates = list(set(self.plugin_manager._candidates) - bad_candidates)
+

  •    # Find repeated plugins and discard the less local copy
    
  •    def plugin_position_in_places(plugin):
    
  •        for i, place in enumerate(self._plugin_places)
    

:

  •            if plugin[0].startswith(place):
    
  •                return i
    
  •    plugin_dict = defaultdict(list)
    
  •    for data in self.plugin_manager._candidates:
    
  •        plugin_dict[data[2].name].append(data)
    

why [2], what are the previous positions?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/getnikola/nikola/pull/2364/files/10067d382d48c9c171fc6cece55dff9c203e917f#r65804619,
or mute the thread
https://github.com/notifications/unsubscribe/AAAGK8IiUkS8LYFmTiPZDyQOWCqeA4Vdks5qIanPgaJpZM4IuKiY
.

@@ -28,7 +28,6 @@

from __future__ import print_function, unicode_literals
import io
from collections import defaultdict

This comment has been minimized.

@Kwpolska

Kwpolska Jun 4, 2016
Member

Breaks everything!

This comment has been minimized.

@ralsina

ralsina Jun 4, 2016
Author Member

Looks like it. I'll take a look when I come back

El sáb., jun. 4, 2016 14:55, Chris Warrick notifications@github.com
escribió:

In nikola/nikola.py
#2364 (comment):

@@ -28,7 +28,6 @@

from future import print_function, unicode_literals
import io
-from collections import defaultdict

Breaks everything!


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/getnikola/nikola/pull/2364/files/e06dc84de7647df6afee8700b444f73fb0e2384e#r65805487,
or mute the thread
https://github.com/notifications/unsubscribe/AAAGKxY67v-zXJwitNSEQSPBzO4YPB4Cks5qIbwYgaJpZM4IuKiY
.

This comment has been minimized.

@Kwpolska

Kwpolska Jun 4, 2016
Member

I fixed it and I’m currently testing this. Will merge if all works okay (which it currently does)

Kwpolska added 2 commits Jun 4, 2016
@Kwpolska
Copy link
Member

@Kwpolska Kwpolska commented Jun 4, 2016

Works okay, merging if there are no errors.

@Kwpolska Kwpolska merged commit 62020cd into master Jun 4, 2016
3 of 4 checks passed
3 of 4 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@Kwpolska Kwpolska deleted the avoid-plugin-conflict branch Jun 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants