Omaha #5568 : More lenient handling of ScreenList attribute for GFE smart tools.

Change-Id: Ib0d53bac7c01a8efdf588e168e90b6fcdc4e9983

Former-commit-id: 7d36b2608534b4daad27177c52ad279c1d3af444
This commit is contained in:
David Gillingham 2016-04-13 10:14:45 -05:00
parent e86b60dccb
commit af2424d37e

View file

@ -34,6 +34,8 @@
# RollbackMasterInterface.
# 07/23/15 4263 dgilling Support refactored Java
# SmartToolControllers.
# 04/13/16 5568 dgilling More lenient handling of
# ScreenList.
#
#
#
@ -76,7 +78,18 @@ class SmartToolInterface(RollbackMasterInterface.RollbackMasterInterface):
return getattr(sys.modules[name], "WeatherElementEdited", "None")
def getScreenList(self, name):
return getattr(sys.modules[name], "ScreenList", None)
screenList = getattr(sys.modules[name], "ScreenList", None)
if screenList is not None:
try:
iter(screenList)
except TypeError:
screenList = [str(screenList)]
else:
if isinstance(screenList, basestring):
screenList = [str(screenList)]
else:
screenList = [str(i) for i in screenList]
return screenList
def getVariableList(self, name):
return getattr(sys.modules[name], "VariableList", [])