Skip to content

Commit

Permalink
Merge pull request #4 from boegel/module_whatis
Browse files Browse the repository at this point in the history
use None as default value for whatis + minor style fixes
  • Loading branch information
geimer committed Nov 27, 2015
2 parents 1c3caa6 + 4f997d2 commit c51f466
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion easybuild/framework/easyconfig/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
'exts_list': [[], 'List with extensions added to the base installation', EXTENSIONS],

# MODULES easyconfig parameters
'whatis': [[], "List of brief (one line) package description entries", MODULES],
'whatis': [None, "List of brief (one line) package description entries", MODULES],
'modaliases': [{}, "Aliases to be defined in module file", MODULES],
'modextrapaths': [{}, "Extra paths to be prepended in module file", MODULES],
'modextravars': [{}, "Extra environment variables to be added to module file", MODULES],
Expand Down
10 changes: 6 additions & 4 deletions easybuild/tools/module_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ def get_description(self, conflict=True):
description = "%s - Homepage: %s" % (self.app.cfg['description'], self.app.cfg['homepage'])

whatis = self.app.cfg['whatis']
if not whatis:
if whatis is None:
# default: include single 'whatis' statement with description as contents
whatis = [description]

lines = [
Expand Down Expand Up @@ -194,7 +195,7 @@ def get_description(self, conflict=True):
'name': self.app.name,
'version': self.app.version,
'description': description,
'whatis_lines': "\n".join(("module-whatis {%s}" % line) for line in whatis),
'whatis_lines': '\n'.join(["module-whatis {%s}" % line for line in whatis]),
'installdir': self.app.installdir,
}

Expand Down Expand Up @@ -338,7 +339,8 @@ def get_description(self, conflict=True):
description = "%s - Homepage: %s" % (self.app.cfg['description'], self.app.cfg['homepage'])

whatis = self.app.cfg['whatis']
if not whatis:
if whatis is None:
# default: include single 'whatis' statement with description as contents
whatis = [description]

lines = [
Expand All @@ -360,7 +362,7 @@ def get_description(self, conflict=True):
'name': self.app.name,
'version': self.app.version,
'description': description,
'whatis_lines': "\n".join(("whatis([[%s]])" % line) for line in whatis),
'whatis_lines': '\n'.join(["whatis([[%s]])" % line for line in whatis]),
'installdir': self.app.installdir,
'homepage': self.app.cfg['homepage'],
}
Expand Down
2 changes: 1 addition & 1 deletion test/framework/module_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_descr(self):
self.assertEqual(desc, expected)

# Test description with list of 'whatis' strings
self.eb.cfg.update('whatis', ['foo', 'bar'])
self.eb.cfg['whatis'] = ['foo', 'bar']
if self.MODULE_GENERATOR_CLASS == ModuleGeneratorTcl:
expected = '\n'.join([
"#%Module",
Expand Down

0 comments on commit c51f466

Please sign in to comment.