comparison python/install_config.py @ 619:fd50f457185c

STUB: python/install_config.py
author Jeff Hammel <k0scist@gmail.com>
date Tue, 04 Feb 2014 14:27:17 -0800
parents 4b79ee6c8539
children 753a5358535f
comparison
equal deleted inserted replaced
618:5ab1df94cc8d 619:fd50f457185c
35 35
36 36
37 def execute(*commands, **kwargs): 37 def execute(*commands, **kwargs):
38 """execute a series of commands""" 38 """execute a series of commands"""
39 for command in commands: 39 for command in commands:
40 print (subprocess.list2cmdline(' '.join(command))) 40 print (subprocess.list2cmdline(command))
41 code = subprocess.call(command, **kwargs) 41 code = subprocess.call(command, **kwargs)
42 if code: 42 if code:
43 raise subprocess.CalledProcessError(code, command) 43 raise subprocess.CalledProcessError(code, command)
44 44
45 45
69 def check(cls): 69 def check(cls):
70 """checks if the step may be run""" 70 """checks if the step may be run"""
71 @classmethod 71 @classmethod
72 def name(cls): 72 def name(cls):
73 return cls.__name__ 73 return cls.__name__
74 __str__ = name 74 __str__ = name # XXX does not work! :(
75 def __call__(self): 75 def __call__(self):
76 execute(*self.commands) 76 execute(*self.commands)
77 77
78 78
79 class Command(object): 79 class Command(object):