@synchronized<EOL>def progress(msg, *args):
<EOL>if not (sys.stdout.isatty() and sys.stderr.isatty()):<EOL><INDENT>return<EOL><DEDENT>text = (msg % args)<EOL>if progress.prev_message:<EOL><INDENT>sys.stderr.write('<STR_LIT:U+0020>' * len(progress.prev_message) + '<STR_LIT:\r>')<EOL><DEDENT>sys.stderr.write(text + '<STR_LIT:\r>')<EOL>progress.prev_message = text<EOL>
Show current progress message to stderr.
       This function will remember the previous message so that next time,
       it will clear the previous message before showing next one.