浏览代码

Revert to earlier behaviour when showing commands.

The command being run will be shown first, and then prefixed with the
running time after it has been completed.
Heikki Hokkanen 17 年前
父节点
当前提交
3710b9178e
共有 1 个文件被更改,包括 2 次插入8 次删除
  1. 2
    8
      gitstats

+ 2
- 8
gitstats 查看文件

@@ -23,16 +23,10 @@ if 'GNUPLOT' in os.environ:
23 23
 	gnuplot_cmd = os.environ['GNUPLOT']
24 24
 
25 25
 def getpipeoutput(cmds, quiet = False):
26
-	def beautify_name(cmds):
27
-		ret = cmds[0]
28
-		for x in cmds[1:]:
29
-			ret += ' | ' + x
30
-		return ret
31
-		
32 26
 	global exectime_external
33 27
 	start = time.time()
34 28
 	if not quiet:
35
-		print '>> ', beautify_name(cmds)
29
+		print '>> ' + ' | '.join(cmds),
36 30
 		sys.stdout.flush()
37 31
 	p0 = subprocess.Popen(cmds[0], stdout = subprocess.PIPE, shell = True)
38 32
 	p = p0
@@ -42,7 +36,7 @@ def getpipeoutput(cmds, quiet = False):
42 36
 	output = p.communicate()[0]
43 37
 	end = time.time()
44 38
 	if not quiet:
45
-		print '\r[%.5f] >> %s' % (end - start, beautify_name(cmds))
39
+		print '\r[%.5f] >> %s' % (end - start, ' | '.join(cmds))
46 40
 	exectime_external += (end - start)
47 41
 	return output.rstrip('\n')
48 42