Commit 557abb55 authored by Garrett Regier's avatar Garrett Regier

Support Python plugins that define __all__

Instead of going through every local in the
plugin just check those in __all__, if defined.

https://bugzilla.gnome.org/show_bug.cgi?id=741802
parent 8b01d0c1
......@@ -131,7 +131,13 @@ class Hooks(object):
except KeyError:
pass
for key in module.__dict__:
try:
keys = module.__all__
except AttributeError:
keys = module.__dict__
for key in keys:
value = getattr(module, key)
try:
......
......@@ -6,6 +6,9 @@ import threading
from gi.repository import GObject, Introspection, Peas
__all__ = [ 'ExtensionPythonPlugin' ]
class ExtensionPythonPlugin(GObject.Object, Peas.Activatable,
Introspection.Base, Introspection.Callable,
Introspection.HasPrerequisite):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment