Startup
This commit is contained in:
85
script/pio.py
Normal file
85
script/pio.py
Normal file
@@ -0,0 +1,85 @@
|
||||
###################################################################################################
|
||||
# Deployment specific global definitions - executed after startup.py
|
||||
###################################################################################################
|
||||
|
||||
#Uncomment this line to create the simulated devices needed to the tutorial scripts.
|
||||
#run("tutorial/devices")
|
||||
|
||||
|
||||
# The code below is necessary to run the Testing List plug-in:
|
||||
global print_log, sendFeedback, sys, inspect, os, traceback
|
||||
import sys, inspect, os, traceback
|
||||
|
||||
class pio:
|
||||
"""
|
||||
Common tools for running the test
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
Init class with test data
|
||||
"""
|
||||
self.log('ecco pio')
|
||||
|
||||
|
||||
def getParam(self, paramName):
|
||||
"""
|
||||
get specific test parameter
|
||||
paramName = the name of the parameter for which the value must be read
|
||||
"""
|
||||
try:
|
||||
return self.testParams[paramName]["value"]
|
||||
except:
|
||||
self.log('Could not retrieve testing parameter ' + paramName + ' - Details: ' + traceback.format_exc())
|
||||
return None
|
||||
|
||||
|
||||
def getName(self):
|
||||
"""
|
||||
get test name
|
||||
"""
|
||||
return self.testName
|
||||
|
||||
|
||||
def getPlotName(self):
|
||||
"""
|
||||
get test plot name
|
||||
"""
|
||||
return self.deviceName + ' - ' + self.testName
|
||||
|
||||
|
||||
def getDeviceName(self):
|
||||
"""
|
||||
get device name
|
||||
"""
|
||||
return self.deviceName
|
||||
|
||||
|
||||
def getPath(self):
|
||||
"""
|
||||
get test path
|
||||
"""
|
||||
return self.testPath
|
||||
|
||||
|
||||
def log(self, text):
|
||||
"""
|
||||
Print/log information
|
||||
text = the string to be printed/logged
|
||||
"""
|
||||
import time
|
||||
time.ctime()
|
||||
now = time.strftime('%Y.%m.%d %H:%M:%S')
|
||||
logText = self.deviceName + ' - ' + self.testName + ': ' + str(text)
|
||||
print now + ' ' + logText
|
||||
try:
|
||||
log(logText)
|
||||
except:
|
||||
#cannot write log. maybe busy? Wait and retry
|
||||
time.sleep(1)
|
||||
try:
|
||||
log(logText)
|
||||
except:
|
||||
#cannot write log
|
||||
print now + ' ' + self.deviceName + ' - ' + self.testName + ': ' + 'cannot write Log in Data'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#TestingList for pshell: configuration properties
|
||||
#Mon Oct 09 13:45:53 CEST 2017
|
||||
#Mon Oct 09 14:09:12 CEST 2017
|
||||
customPanel=
|
||||
showEnabledTestsOnly=true
|
||||
listFilter=rps-try
|
||||
|
||||
Reference in New Issue
Block a user