Skip to content

Commit

Permalink
add set_shell_function to module_generator
Browse files Browse the repository at this point in the history
  • Loading branch information
mboisson committed Aug 23, 2023
1 parent 59d2f54 commit 13850b2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions easybuild/tools/module_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,12 @@ def set_alias(self, key, value):
"""
raise NotImplementedError

def set_shell_function(self, key, bashStr, cshStr):
"""
Generate set_shell_function statement in modulefile for the given key/value pair.
"""
raise NotImplementedError

def set_as_default(self, module_dir_path, module_version, mod_symlink_paths=None):
"""
Set generated module as default module
Expand Down Expand Up @@ -1005,6 +1011,12 @@ def set_alias(self, key, value):
# quotes are needed, to ensure smooth working of EBDEVEL* modulefiles
return 'set-alias\t%s\t\t%s\n' % (key, quote_str(value, tcl=True))

def set_shell_function(self, key, bashStr, cshStr):
"""
Generate set_shell_function statement in modulefile for the given key/value pair.
"""
raise NotImplementedError

def set_as_default(self, module_dir_path, module_version, mod_symlink_paths=None):
"""
Create a .version file inside the package module folder in order to set the default version for TMod
Expand Down Expand Up @@ -1480,6 +1492,13 @@ def set_alias(self, key, value):
# quotes are needed, to ensure smooth working of EBDEVEL* modulefiles
return 'set_alias("%s", %s)\n' % (key, quote_str(value))

def set_shell_function(self, key, bashStr, cshStr):
"""
Generate set_shell_function statement in modulefile for the given key/value pair.
"""
# quotes are needed, to ensure smooth working of EBDEVEL* modulefiles
return 'set_shell_function("%s", %s, %s)\n' % (key, quote_str(bashStr), quote_str(cshStr))

def set_as_default(self, module_dir_path, module_version, mod_symlink_paths=None):
"""
Create a symlink named 'default' inside the package's module folder in order to set the default module version
Expand Down

0 comments on commit 13850b2

Please sign in to comment.