def load_modules(self):
        """ Import CLI commands modules. """
        module_folder = os.path.join(os.path.dirname(__file__),
                                     '..', 'modules')
        module_dirs = {
            'gandi.cli': module_folder
        }

        if 'GANDICLI_PATH' in os.environ:
            for _path in os.environ.get('GANDICLI_PATH').split(':'):
                # remove trailing separator if any
                path = _path.rstrip(os.sep)
                module_dirs[os.path.basename(path)] = os.path.join(path,
                                                                   'modules')

        for module_basename, dir in list(module_dirs.items()):
            for filename in sorted(os.listdir(dir)):
                if filename.endswith('.py') and '__init__' not in filename:
                    submod = filename[:-3]
                    module_name = module_basename + '.modules.' + submod
                    __import__(module_name, fromlist=[module_name])

        # save internal map of loaded module classes
        for subclass in GandiModule.__subclasses__():
            self._modules[subclass.__name__.lower()] = subclass
Import CLI commands modules.