Skip to content

Commit

Permalink
Some more circular deps should be gone and fixed a typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
Petar Forai committed Feb 11, 2015
1 parent 567c43d commit 32ff7ed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
9 changes: 4 additions & 5 deletions easybuild/tools/module_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -432,18 +431,17 @@ 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


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.
Expand All @@ -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')):
Expand Down
5 changes: 2 additions & 3 deletions easybuild/tools/modules.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# #
#
# Copyright 2009-2014 Ghent University
#
# This file is part of EasyBuild,
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion easybuild/tools/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 32ff7ed

Please sign in to comment.