From 6a0a5b54ec2525c05d43cb56346b5577f16287df Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Thu, 14 Jan 2010 13:42:15 +0000 Subject: Little fun feature for SCons users: set BF_LINE_OVERWRITE=True in your user-config.py or on command-line when BF_QUIET=True. This will reuse the same line of the previous compile message (Compiling ==>...). Warnings and other messages will still go on their own lines. Remember to set BF_LINE_OVERWRITE=False when you are redirecting the build output to a file --- tools/Blender.py | 8 ++++++++ tools/btools.py | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/Blender.py b/tools/Blender.py index 4dad70bbef5..c51c1367f33 100644 --- a/tools/Blender.py +++ b/tools/Blender.py @@ -268,6 +268,12 @@ def buildinfo(lenv, build_type): ##### ACTION STUFF ############# +def my_print_cmd_line(self, s, target, source, env): + sys.stdout.write(' ' * 70 + '\r') + sys.stdout.flush() + sys.stdout.write(s + "\r") + sys.stdout.flush() + def my_compile_print(target, source, env): a = '%s' % (source[0]) d, f = os.path.split(a) @@ -330,6 +336,8 @@ def set_quiet_output(env): env['BUILDERS']['StaticLibrary'] = static_lib env['BUILDERS']['Library'] = static_lib env['BUILDERS']['Program'] = program + if env['BF_LINE_OVERWRITE']: + SCons.Action._ActionAction.print_cmd_line = my_print_cmd_line class CompZipFile(zipfile.ZipFile): diff --git a/tools/btools.py b/tools/btools.py index b3a97f96417..7dde9a14f6c 100644 --- a/tools/btools.py +++ b/tools/btools.py @@ -66,7 +66,7 @@ def validate_arguments(args, bc): 'WITH_BF_OPENMP', 'WITH_GHOST_COCOA', 'USE_QTKIT', - 'BF_FANCY', 'BF_QUIET', + 'BF_FANCY', 'BF_QUIET', 'BF_LINE_OVERWRITE', 'BF_X264_CONFIG', 'BF_XVIDCORE_CONFIG', 'WITH_BF_LCMS', 'BF_LCMS_LIB', @@ -97,7 +97,7 @@ def validate_arguments(args, bc): arg_list = ['BF_DEBUG', 'BF_QUIET', 'BF_CROSS', 'BF_UPDATE', 'BF_INSTALLDIR', 'BF_TOOLSET', 'BF_BINNAME', - 'BF_BUILDDIR', 'BF_FANCY', 'BF_QUICK', 'BF_PROFILE', + 'BF_BUILDDIR', 'BF_FANCY', 'BF_QUICK', 'BF_PROFILE', 'BF_LINE_OVERWRITE', 'BF_BSC', 'BF_CONFIG', 'BF_PRIORITYLIST', 'BF_BUILDINFO','CC', 'CXX', 'BF_QUICKDEBUG', 'BF_LISTDEBUG', 'LCGDIR', 'BF_X264_CONFIG', 'BF_XVIDCORE_CONFIG', @@ -403,6 +403,7 @@ def read_opts(cfg, args): (BoolVariable('WITHOUT_BF_PYTHON_INSTALL', 'dont install Python modules if true', False)), (BoolVariable('BF_FANCY', 'Enable fancy output if true', True)), (BoolVariable('BF_QUIET', 'Enable silent output if true', True)), + (BoolVariable('BF_LINE_OVERWRITE', 'Enable overwriting of compile line in BF_QUIET mode if true', False)), (BoolVariable('WITH_BF_BINRELOC', 'Enable relocatable binary (linux only)', False)), (BoolVariable('WITH_BF_LZO', 'Enable fast LZO pointcache compression', True)), -- cgit v1.2.3