From 32ff7ed51648aef2ce9dbf9e13ac560887a46baa Mon Sep 17 00:00:00 2001 From: Petar Forai Date: Wed, 11 Feb 2015 23:44:39 +0100 Subject: [PATCH] Some more circular deps should be gone and fixed a typo. --- easybuild/tools/module_generator.py | 9 ++++----- easybuild/tools/modules.py | 5 ++--- easybuild/tools/options.py | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/easybuild/tools/module_generator.py b/easybuild/tools/module_generator.py index e97f36d73d..1701c2caff 100644 --- a/easybuild/tools/module_generator.py +++ b/easybuild/tools/module_generator.py @@ -40,7 +40,6 @@ from easybuild.framework.easyconfig.easyconfig import ActiveMNS from easybuild.tools import config -from easybuild.tools.config import build_option, get_module_syntax from easybuild.tools.filetools import mkdir from easybuild.tools.utilities import quote_str @@ -432,7 +431,7 @@ def add_tcl_footer(self, tcltxt): """ Append whatever Tcl code you want to your modulefile """ - #@todo to pass or not to pass? this should fail in the context of generating Lua modules + #@todo to pass or not to pass? this should fail in the context of generating Lua modules pass @@ -440,10 +439,9 @@ def set_alias(self, key, value): """ Generate set-alias statement in modulefile for the given key/value pair. """ - # quotes are needed, to ensure smooth working of EBDEVEL* modulefiles + # quotes are needed, to ensure smooth working of EBDEVEL* modulefiles return 'setalias(%s,"%s")\n' % (key, quote_str(value)) - def avail_module_generators(): """ Return all known module syntaxes. @@ -468,9 +466,10 @@ def module_generator(app, fake=False): module_generator_class = avail_module_generators().get(module_syntax) return module_generator_class(app, fake=fake) + def return_module_loadregex(modfilepath): """ - Return the right regex depending on the module file type (Lua vs Tcl) in order for + Return the correct regex depending on the module file type (Lua vs Tcl) in order for to be able to figure out dependencies. """ if (modfilepath.endswith('.lua')): diff --git a/easybuild/tools/modules.py b/easybuild/tools/modules.py index 75be8ca69f..78b5e5e2eb 100644 --- a/easybuild/tools/modules.py +++ b/easybuild/tools/modules.py @@ -1,4 +1,4 @@ -# # +# # Copyright 2009-2014 Ghent University # # This file is part of EasyBuild, @@ -51,7 +51,6 @@ from easybuild.tools.filetools import convert_name, mkdir, read_file, path_matches, which from easybuild.tools.module_naming_scheme import DEVEL_MODULE_SUFFIX from easybuild.tools.run import run_cmd -from easybuild.tools.module_generator import return_module_loadregex from easybuild.tools.toolchain import DUMMY_TOOLCHAIN_NAME, DUMMY_TOOLCHAIN_VERSION from vsc.utils.missing import nub @@ -573,7 +572,7 @@ def dependencies_for(self, mod_name, depth=sys.maxint): @param depth: recursion depth (default is sys.maxint, which should be equivalent to infinite recursion depth) """ modtxt = self.read_module_file(mod_name) - loadregex = return_module_loadregex(self.modulefile_path(modmod_name)) + loadregex = return_module_loadregex(self.modulefile_path(modmod_name)) mods = loadregex.findall(modtxt) if depth > 0: diff --git a/easybuild/tools/options.py b/easybuild/tools/options.py index f0c89fb5ab..7a771e24b0 100644 --- a/easybuild/tools/options.py +++ b/easybuild/tools/options.py @@ -398,7 +398,7 @@ def postprocess(self): if not HAVE_GITHUB_API: self.log.error("Required support for using GitHub API is not available (see warnings).") - if self.options.modules_syntax == 'Lua' and self.options.modules_tool !='Lmod': + if self.options.module_syntax == 'Lua' and self.options.modules_tool !='Lmod': self.log.error("Generating Lua module files requires Lmod as modules tool.") # make sure a GitHub token is available when it's required