@@ -816,20 +816,19 @@ def get_description(self, conflict=True):
816
816
"""
817
817
Generate a description.
818
818
"""
819
- txt = ' \n ' . join ( [
819
+ lines = [
820
820
"proc ModulesHelp { } {" ,
821
821
" puts stderr {%s" % re .sub (r'([{}\[\]])' , r'\\\1' , self ._generate_help_text ()),
822
822
" }" ,
823
823
'}' ,
824
824
'' ,
825
- ])
826
-
827
- lines = [
828
- '%(whatis_lines)s' ,
829
- '' ,
830
- "set root %(installdir)s" ,
831
825
]
832
826
827
+ lines .extend ([
828
+ "module-whatis {%s}" % re .sub (r'([{}\[\]])' , r'\\\1' , line )
829
+ for line in self ._generate_whatis_lines ()
830
+ ])
831
+
833
832
if self .app .cfg ['moduleloadnoconflict' ]:
834
833
cond_unload = self .conditional_statement (self .is_loaded ('%(name)s' ), "module unload %(name)s" )
835
834
lines .extend ([
@@ -845,18 +844,9 @@ def get_description(self, conflict=True):
845
844
# - 'conflict Compiler/GCC/4.8.2/OpenMPI' for 'Compiler/GCC/4.8.2/OpenMPI/1.6.4'
846
845
lines .extend (['' , "conflict %s" % os .path .dirname (self .app .short_mod_name )])
847
846
848
- whatis_lines = [
849
- "module-whatis {%s}" % re .sub (r'([{}\[\]])' , r'\\\1' , line )
850
- for line in self ._generate_whatis_lines ()
851
- ]
852
- txt += '\n ' .join (['' ] + lines + ['' ]) % {
853
- 'name' : self .app .name ,
854
- 'version' : self .app .version ,
855
- 'whatis_lines' : '\n ' .join (whatis_lines ),
856
- 'installdir' : self .app .installdir ,
857
- }
847
+ lines .extend (['' , "set root %(installdir)s" ])
858
848
859
- return txt
849
+ return ' \n ' . join ([ '' ] + lines + [ '' ])
860
850
861
851
def getenv_cmd (self , envvar , default = None ):
862
852
"""
@@ -1261,29 +1251,24 @@ def get_description(self, conflict=True):
1261
1251
"""
1262
1252
Generate a description.
1263
1253
"""
1264
- txt = ' \n ' . join ( [
1254
+ lines = [
1265
1255
'help(%s%s' % (self .START_STR , self .check_str (self ._generate_help_text ())),
1266
1256
'%s)' % self .END_STR ,
1267
1257
'' ,
1268
- ])
1269
-
1270
- lines = [
1271
- "%(whatis_lines)s" ,
1272
- '' ,
1273
- 'local root = "%(installdir)s"' ,
1274
1258
]
1275
1259
1260
+ for line in self ._generate_whatis_lines ():
1261
+ lines .append ("whatis(%s%s%s)" % (self .START_STR , self .check_str (line ), self .END_STR ))
1262
+
1263
+ lines .extend (['' , 'local root = "%(installdir)s"' ])
1264
+
1276
1265
if self .app .cfg ['moduleloadnoconflict' ]:
1277
1266
self .log .info ("Nothing to do to ensure no conflicts can occur on load when using Lua modules files/Lmod" )
1278
1267
1279
1268
elif conflict :
1280
1269
# conflict on 'name' part of module name (excluding version part at the end)
1281
1270
lines .extend (['' , 'conflict("%s")' % os .path .dirname (self .app .short_mod_name )])
1282
1271
1283
- whatis_lines = []
1284
- for line in self ._generate_whatis_lines ():
1285
- whatis_lines .append ("whatis(%s%s%s)" % (self .START_STR , self .check_str (line ), self .END_STR ))
1286
-
1287
1272
if build_option ('module_extensions' ):
1288
1273
extensions_list = self ._generate_extensions_list ()
1289
1274
@@ -1294,15 +1279,7 @@ def get_description(self, conflict=True):
1294
1279
# https://github.com/TACC/Lmod/issues/428
1295
1280
lines .extend (['' , self .conditional_statement (self .check_version ("8" , "2" , "8" ), extensions_stmt )])
1296
1281
1297
- txt += '\n ' .join (['' ] + lines + ['' ]) % {
1298
- 'name' : self .app .name ,
1299
- 'version' : self .app .version ,
1300
- 'whatis_lines' : '\n ' .join (whatis_lines ),
1301
- 'installdir' : self .app .installdir ,
1302
- 'homepage' : self .app .cfg ['homepage' ],
1303
- }
1304
-
1305
- return txt
1282
+ return '\n ' .join (['' ] + lines + ['' ])
1306
1283
1307
1284
def getenv_cmd (self , envvar , default = None ):
1308
1285
"""
0 commit comments