Files
ncs/script/local.py
boccioli_m 44b9bc2438 Closedown
2015-09-02 11:32:35 +02:00

41 lines
1.5 KiB
Python

###################################################################################################
# Deployment specific global definitions - executed after startup.py
###################################################################################################
#Uncomment this line to create the simulated devices needed to the tutorial scripts.
#run("tutorial/devices")
global print_log, sendFeedback, sys, inspect, os, traceback
import sys, inspect, os, traceback
class TestingTool:
deviceName = ''
testName = ''
testPath = ''
def __init__(self, testName, testPath, deviceName):
self.deviceName = deviceName
self.testName = testName
self.testPath = testPath
def log(self, text):
import time
time.ctime()
now = time.strftime('%Y.%m.%d %H:%M:%S')
print now + ' ' + self.deviceName + ' - ' + self.testName + ': ' + str(text)
#prepare and send feedback to calling tool
def sendFeedback(self, returnString, testPassed):
self.log('End of test. Result:')
self.log('Device: ' + self.deviceName)
self.log('Test name: ' + self.testName)
self.log('Test path: ' + self.testPath)
self.log('Test passed: ' + str(testPassed))
self.log('Return string: ' + returnString)
ret = [self.testPath, self.deviceName, returnString, testPassed]
set_return( ret)
def print_pio(self):
print 'piopio'