module files configuration : enable/disable logic is now positive

This commit is contained in:
alalazo 2016-03-24 09:31:28 +01:00
parent d93f2b335d
commit f095e619b9
2 changed files with 3 additions and 8 deletions

View file

@ -249,7 +249,7 @@
'default': {}, 'default': {},
'additionalProperties': False, 'additionalProperties': False,
'properties': { 'properties': {
'disable': { 'enable': {
'type': 'array', 'type': 'array',
'default': [], 'default': [],
'items': { 'items': {

View file

@ -57,13 +57,8 @@
# Registry of all types of modules. Entries created by EnvModule's metaclass # Registry of all types of modules. Entries created by EnvModule's metaclass
module_types = {} module_types = {}
CONFIGURATION = spack.config.get_config('modules')
def read_configuration_file():
f = spack.config.get_config('modules')
f.setdefault('disable', []) # Default : disable nothing
return f
CONFIGURATION = read_configuration_file()
def print_help(): def print_help():
"""For use by commands to tell user how to activate shell support.""" """For use by commands to tell user how to activate shell support."""
@ -123,7 +118,7 @@ class EnvModule(object):
class __metaclass__(type): class __metaclass__(type):
def __init__(cls, name, bases, dict): def __init__(cls, name, bases, dict):
type.__init__(cls, name, bases, dict) type.__init__(cls, name, bases, dict)
if cls.name != 'env_module' and cls.name not in CONFIGURATION['disable']: if cls.name != 'env_module' and cls.name in CONFIGURATION['enable']:
module_types[cls.name] = cls module_types[cls.name] = cls
def __init__(self, spec=None): def __init__(self, spec=None):