Sort loaded plugins.

This commit is contained in:
Bastian Kleineidam 2012-10-11 14:45:06 +02:00
parent 5fa8792007
commit a7036beef7

View file

@ -24,7 +24,7 @@ def get_importable_modules(folder):
@return module filenames @return module filenames
@rtype: iterator of string @rtype: iterator of string
""" """
for fname in os.listdir(folder): for fname in sorted(os.listdir(folder)):
if fname.endswith('.py') and not fname.startswith('_'): if fname.endswith('.py') and not fname.startswith('_'):
yield os.path.join(folder, fname) yield os.path.join(folder, fname)
@ -62,7 +62,7 @@ def get_module_plugins(module, classobj):
names = module.__all__ names = module.__all__
except AttributeError: except AttributeError:
names = [x for x in vars(module) if not x.startswith('_')] names = [x for x in vars(module) if not x.startswith('_')]
for name in names: for name in sorted(names):
try: try:
obj = getattr(module, name) obj = getattr(module, name)
except AttributeError: except AttributeError: