first install myplc-native
[tests.git] / system / utils.py
1 # $Id$
2 import time
3 import os
4 import pprint
5
6 # how could this accept a list again ?
7 def header(message):
8     now=time.strftime("%H:%M:%S", time.localtime())
9     print "*",now,'--',message
10
11 def show_spec(message,spec,depth=2):
12     now=time.strftime("%H:%M:%S", time.localtime())
13     print ">",now,"--",message
14     pprint.PrettyPrinter(indent=6,depth=depth).pprint(spec)
15
16 def system(command):
17     now=time.strftime("%H:%M:%S", time.localtime())
18     print "+",now
19     return os.system("set -x; " + command)
20