本文整理汇总了Python中API.getApplExit方法的典型用法代码示例。如果您正苦于以下问题:Python API.getApplExit方法的具体用法?Python API.getApplExit怎么用?Python API.getApplExit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类API
的用法示例。
在下文中一共展示了API.getApplExit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: index
# 需要导入模块: import API [as 别名]
# 或者: from API import getApplExit [as 别名]
def index(self,user=None,task=None,eff=None, **rest):
if user : string = user
elif task: string=task
else: string=eff
action = string.split('::')[0]
query_time = string.split('::')[1]
dataset = string.split('::')[2]
if action == 'task':
tasklist=API.getTaskNameList(dataset,query_time)
html = """<html><body>"""
html += "<table>\n"
html += "<tr>"
html += "<th>List of Task</th>"
html += "</tr>\n"
for t_name, nn in tasklist:
html += "<tr>"
html += "<td>%s</td>" % ( t_name )
html += "</tr>\n"
html += "</table>\n"
html += """</body></html>"""
elif action == 'user':
userlist=API.getUserNameList(dataset,query_time)
html = """<html><body>"""
html += "<table>\n"
html += "<tr>"
html += "<th>List of Users</th><th>Number of Tasks </th>"
html += "</tr>\n"
for num,user in userlist:
html += "<tr>"
html += "<td>%s</td><td>%s</td>" % ( user,num )
html += "</tr>\n"
html += "</table>\n"
html += """</body></html>"""
elif action == 'eff':
if query_time == 'None':
html = "<html><body><h2>No codes available</h2>\n "
html += "</body></html>"
return html
else:
onlyWrap = API.getWrapExit(dataset,query_time)
onlyExec = API.getApplExit(dataset,query_time)
data_wrap = {}
data_exec = {}
for i,code in onlyWrap:
data_wrap[str(code)]=i
#data_wrap['code']=i
for i,code in onlyExec:
data_exec[str(code)]=i
errHtml = "<html><body><h2>No Graph Tools installed!!!</h2>\n "
errHtml += "</body></html>"
try:
from graphtool.graphs.common_graphs import PieGraph
except ImportError:
return errHtml
pngfile_wrap = os.path.join(self.workingDir, "wrappCode.png" )
pngfileUrl_wrap = "%s?filepath=%s" % (self.imageServer, pngfile_wrap)
pngfile_exec = os.path.join(self.workingDir, "applicationCode.png" )
pngfileUrl_exec = "%s?filepath=%s" % (self.imageServer, pngfile_exec)
metadata_wrap = {"title" : "Wrapper Error Codes"}
metadata_exec = {"title" : "Executable Error Codes"}
pie = PieGraph()
coords_wrap = pie.run( data_wrap, pngfile_wrap, metadata_wrap )
pie1 = PieGraph()
coords_exec = pie1.run( data_exec, pngfile_exec, metadata_exec )
html = '<html><body>'
html += '<td align="left"><img src=\"%s\"></td>'% pngfileUrl_exec
html += '<td align="left"><img src=\"%s\"></td>'% pngfileUrl_wrap
html += """</body></html>"""
return html