代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/python-clufter 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 7f4125ceefaf1dd1fb66bf96509c4b0acf2d5e94 Mon Sep 17 00:00:00 2001
From: Jan Pokorný <jpokorny@redhat.com>
Date: Jan 18 2020 00:29:38 +0000
Subject: plugin_registry: fix a problem with "native plugins" missing in lookup
For some reason, this does only appear to be a problem under Python 3
(cannot find a trace[*] of this problem under older Python 2 build logs)
and it is caused with these "native plugins" missing from "wildcard"
(non-specific) "init_lookup" invocation of the plugin registry at hand.
[*] e.g.
> test01 (ccs2coroxml.Main) ... WARNING:clufter.filter:Resolve at `ccs-artefacts' filter: `SimpleFormat' (#1) format fail
> WARNING:clufter.filter:Resolve at `cmd-annotate' filter: `Nothing' (#0) format fail
> WARNING:clufter.filter:Resolve at `xml2simpleconfig' filter: `XML' (#0) format fail
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
---
diff --git a/plugin_registry.py b/plugin_registry.py
index 5851127..4c60acd 100644
--- a/plugin_registry.py
+++ b/plugin_registry.py
@@ -1,5 +1,5 @@
# -*- coding: UTF-8 -*-
-# Copyright 2019 Red Hat, Inc.
+# Copyright 2020 Red Hat, Inc.
# Part of clufter project
# Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt)
"""Easy (at least for usage) plugin framework"""
@@ -104,7 +104,7 @@ class PluginRegistry(type):
assert '-' not in name, "name cannot contain a dash"
dname = cli_decor(name)
attrs = attrs or {}
- # seems more reasonable than plying even higher meta magic game
+ # seems more reasonable than playing even higher meta magic game
assert not(attrs) or '__classcell__' not in attrs, \
("{0} plugin: refrain from '__class__'/'super' (Py3.8+ limit)"
).format(name)
@@ -287,9 +287,10 @@ class PluginManager(object):
@classmethod
def lookup(cls, plugins, registry=None, **kwargs):
- ret, to_discover = {}, set()
+ ret, to_discover, wildcard = {}, set(), True
registry = cls._default_registry if registry is None else registry
for plugin in args2sgpl(plugins):
+ wildcard = False
# XXX we could introspect sys.modules here as well
try:
ret[plugin] = registry.plugins[plugin]
@@ -300,9 +301,12 @@ class PluginManager(object):
to_discover.difference_update(ret)
native_plugins = registry.native_plugins
- ret.update(filterdict_remove(to_discover,
- _fn_=lambda x: native_plugins[x],
- *native_plugins.keys()))
+ if wildcard:
+ ret.update(native_plugins)
+ else:
+ ret.update(filterdict_remove(to_discover,
+ _fn_=lambda x: native_plugins[x],
+ *native_plugins.keys()))
to_discover = apply_intercalate(tuple(to_discover))
if to_discover:
log.debug("Couldn't look up everything: {0}".format(', '.join(
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。