comparison python/setup_repo.py @ 462:48deb57f52d1

python/setup_repo.py
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 10 Aug 2013 18:20:53 -0700
parents fba923298346
children 66c2a17d8424
comparison
equal deleted inserted replaced
461:fba923298346 462:48deb57f52d1
29 def call(command, *args, **kwargs): 29 def call(command, *args, **kwargs):
30 30
31 if isinstance(command, string): 31 if isinstance(command, string):
32 command_str = command 32 command_str = command
33 else: 33 else:
34 command_str = ' '.join(command) 34 if len(command) == 1:
35 command_str = command[0]
36 else:
37 command_str = '%s %s' % (command[0],
38 ' '.join(["'%s'" % i
39 for i in command[1:])))
35 print 'Running:\n%s' % (command_str) 40 print 'Running:\n%s' % (command_str)
36 if globals()['dry_run']: 41 if globals()['dry_run']:
37 return 42 return
38 return subprocess.check_output(*args, **kwargs) 43 return subprocess.check_output(*args, **kwargs)
39 44