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


Python Dashboard.get_workflow_details方法代码示例

本文整理汇总了Python中Pegasus.service.dashboard.dashboard.Dashboard.get_workflow_details方法的典型用法代码示例。如果您正苦于以下问题:Python Dashboard.get_workflow_details方法的具体用法?Python Dashboard.get_workflow_details怎么用?Python Dashboard.get_workflow_details使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pegasus.service.dashboard.dashboard.Dashboard的用法示例。


在下文中一共展示了Dashboard.get_workflow_details方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: file_list

# 需要导入模块: from Pegasus.service.dashboard.dashboard import Dashboard [as 别名]
# 或者: from Pegasus.service.dashboard.dashboard.Dashboard import get_workflow_details [as 别名]
def file_list(username, root_wf_id, wf_id, path=""):
    try:
        dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id=wf_id)
        details = dashboard.get_workflow_details(wf_id)
        submit_dir = details.submit_dir

        if os.path.isdir(submit_dir):
            dest = os.path.join(submit_dir, path)

            if os.path.isfile(dest):
                return "", 204

            folders = {"dirs": [], "files": []}

            for entry in os.listdir(dest):
                if os.path.isdir(os.path.join(dest, entry)):
                    folders["dirs"].append(os.path.normpath(os.path.join(path, entry)))
                else:
                    folders["files"].append(os.path.normpath(os.path.join(path, entry)))

            return json.dumps(folders), 200, {"Content-Type": "application/json"}

        else:
            raise ServiceError(ErrorResponse("SUBMIT_DIR_NOT_FOUND", "%r is not a valid directory" % str(submit_dir)))

    except NoResultFound:
        return render_template("error/workflow/workflow_details_missing.html")

    return "Error", 500
开发者ID:duncan-brown,项目名称:pegasus,代码行数:31,代码来源:views.py

示例2: file_list

# 需要导入模块: from Pegasus.service.dashboard.dashboard import Dashboard [as 别名]
# 或者: from Pegasus.service.dashboard.dashboard.Dashboard import get_workflow_details [as 别名]
def file_list(username, root_wf_id, wf_id):
    try:
        dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id=wf_id)
        details = dashboard.get_workflow_details(wf_id)
        submit_dir = details.submit_dir

        if os.path.isdir(submit_dir):
            folders = {}

            for folder, sub_folders, files in os.walk(submit_dir):
                folder = '/' + folder.replace(submit_dir, '', 1).lstrip('/')
                folders[folder] = {'D': [], 'F': files}

                for sub_folder in sub_folders:
                    full_sub_folder = os.path.normpath(os.path.join(folder, sub_folder))
                    folders[folder]['D'].append(full_sub_folder)

            return json.dumps(folders), 200, {'Content-Type': 'application/json'}

        else:
            raise ServiceError(ErrorResponse('SUBMIT_DIR_NOT_FOUND', '%r is not a valid directory' % str(submit_dir)))

    except NoResultFound:
        return render_template('error/workflow/workflow_details_missing.html')

    return 'Error', 500
开发者ID:ehabsoa,项目名称:pegasus,代码行数:28,代码来源:views.py

示例3: file_browser

# 需要导入模块: from Pegasus.service.dashboard.dashboard import Dashboard [as 别名]
# 或者: from Pegasus.service.dashboard.dashboard.Dashboard import get_workflow_details [as 别名]
def file_browser(username, root_wf_id, wf_id):
    try:
        dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id=wf_id)
        details = dashboard.get_workflow_details(wf_id)
        submit_dir = details.submit_dir

        if os.path.isdir(submit_dir):
            init_file = request.args.get('init_file', None)
            return render_template(
                'file-browser.html',
                root_wf_id=root_wf_id,
                wf_id=wf_id,
                init_file=init_file
            )
        else:
            raise ServiceError(
                ErrorResponse(
                    'SUBMIT_DIR_NOT_FOUND',
                    '%r is not a valid directory' % str(submit_dir)
                )
            )

    except NoResultFound:
        return render_template('error/workflow/workflow_details_missing.html')

    return 'Error', 500
开发者ID:pegasus-isi,项目名称:pegasus,代码行数:28,代码来源:views.py

示例4: file_view

# 需要导入模块: from Pegasus.service.dashboard.dashboard import Dashboard [as 别名]
# 或者: from Pegasus.service.dashboard.dashboard.Dashboard import get_workflow_details [as 别名]
def file_view(username, root_wf_id, wf_id, path):
    try:
        dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id=wf_id)
        details = dashboard.get_workflow_details(wf_id)
        submit_dir = details.submit_dir

        file_path = os.path.join(submit_dir, path)
        if not os.path.isfile(file_path):
            return "File not found", 404

        return send_from_directory(submit_dir, path)
    except NoResultFound:
        return render_template("error/workflow/workflow_details_missing.html")

    return "Error", 500
开发者ID:duncan-brown,项目名称:pegasus,代码行数:17,代码来源:views.py

示例5: file_list

# 需要导入模块: from Pegasus.service.dashboard.dashboard import Dashboard [as 别名]
# 或者: from Pegasus.service.dashboard.dashboard.Dashboard import get_workflow_details [as 别名]
def file_list(username, root_wf_id, wf_id, path=''):
    try:
        dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id=wf_id)
        details = dashboard.get_workflow_details(wf_id)
        submit_dir = details.submit_dir

        if os.path.isdir(submit_dir):
            dest = os.path.join(submit_dir, path)

            if os.path.isfile(dest):
                return '', 204

            folders = {'dirs': [], 'files': []}

            for entry in os.listdir(dest):
                if os.path.isdir(os.path.join(dest, entry)):
                    folders['dirs'].append(
                        os.path.normpath(os.path.join(path, entry))
                    )
                else:
                    folders['files'].append(
                        os.path.normpath(os.path.join(path, entry))
                    )

            return json.dumps(folders), 200, {
                'Content-Type': 'application/json'
            }

        else:
            raise ServiceError(
                ErrorResponse(
                    'SUBMIT_DIR_NOT_FOUND',
                    '%r is not a valid directory' % str(submit_dir)
                )
            )

    except NoResultFound:
        return render_template('error/workflow/workflow_details_missing.html')

    return 'Error', 500
开发者ID:pegasus-isi,项目名称:pegasus,代码行数:42,代码来源:views.py


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