@@ -100,12 +100,7 @@ def terminal_supports_colors(stream):
100
100
DEFAULT_SYS_CFGFILES = [f for d in XDG_CONFIG_DIRS for f in sorted (glob .glob (os .path .join (d , 'easybuild.d' , '*.cfg' )))]
101
101
DEFAULT_USER_CFGFILE = os .path .join (XDG_CONFIG_HOME , 'easybuild' , 'config.cfg' )
102
102
103
- try :
104
- from vsc .utils .fancylogger import Colorize
105
- (COLOR_AUTO , COLOR_ALWAYS , COLOR_NEVER ) = Colorize
106
- except ImportError :
107
- (COLOR_AUTO , COLOR_ALWAYS , COLOR_NEVER ) = ('auto' , 'always' , 'never' )
108
- COLOR_OPTIONS = [COLOR_AUTO , COLOR_ALWAYS , COLOR_NEVER ]
103
+ (COLOR_AUTO , COLOR_ALWAYS , COLOR_NEVER ) = fancylogger .Colorize
109
104
110
105
111
106
_log = fancylogger .getLogger ('options' , fname = False )
@@ -176,7 +171,7 @@ def use_color(colorize, stream=sys.stdout):
176
171
elif colorize == COLOR_ALWAYS :
177
172
return True
178
173
else :
179
- assert colorize == COLOR_NEVER , "Argument `colorize` must be one of: %s" % ', ' .join (COLOR_OPTIONS )
174
+ assert colorize == COLOR_NEVER , "Argument `colorize` must be one of: %s" % ', ' .join (fancylogger . Colorize )
180
175
return False
181
176
182
177
@@ -298,7 +293,7 @@ def override_options(self):
298
293
None , 'store_true' , False ),
299
294
'cleanup-builddir' : ("Cleanup build dir after successful installation." , None , 'store_true' , True ),
300
295
'cleanup-tmpdir' : ("Cleanup tmp dir after successful run." , None , 'store_true' , True ),
301
- 'color' : ("Colorize output" , 'choice' , 'store' , COLOR_AUTO , COLOR_OPTIONS , {'metavar' :'WHEN' }),
296
+ 'color' : ("Colorize output" , 'choice' , 'store' , COLOR_AUTO , fancylogger . Colorize , {'metavar' :'WHEN' }),
302
297
'debug-lmod' : ("Run Lmod modules tool commands in debug module" , None , 'store_true' , False ),
303
298
'default-opt-level' : ("Specify default optimisation level" , 'choice' , 'store' , DEFAULT_OPT_LEVEL ,
304
299
Compiler .COMPILER_OPT_FLAGS ),
0 commit comments