当前位置: 首页>>代码示例>>Python>>正文


Python API.getApplExit方法代码示例

本文整理汇总了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    
开发者ID:bbockelm,项目名称:CRAB,代码行数:77,代码来源:TaskMon.py


注:本文中的API.getApplExit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。