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


Python ProjectService.get_operations_in_group方法代码示例

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


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

示例1: stop_burst_operation

# 需要导入模块: from tvb.core.services.project_service import ProjectService [as 别名]
# 或者: from tvb.core.services.project_service.ProjectService import get_operations_in_group [as 别名]
    def stop_burst_operation(self, operation_id, is_group, remove_after_stop=False):
        """
        For a given operation id that is part of a burst just stop the given burst.
        :returns True when stopped operation was successfully.
        """
        operation_id = int(operation_id)
        if int(is_group) == 0:
            operation = self.flow_service.load_operation(operation_id)
        else:
            op_group = ProjectService.get_operation_group_by_id(operation_id)
            first_op = ProjectService.get_operations_in_group(op_group)[0]
            operation = self.flow_service.load_operation(int(first_op.id))

        try:
            burst_service = BurstService()
            result = burst_service.stop_burst(operation.burst)
            if remove_after_stop:
                current_burst = common.get_from_session(common.KEY_BURST_CONFIG)
                if current_burst and current_burst.id == operation.burst.id:
                    common.remove_from_session(common.KEY_BURST_CONFIG)
                result = burst_service.cancel_or_remove_burst(operation.burst.id) or result

            return result
        except Exception, ex:
            self.logger.exception(ex)
            return False
开发者ID:transpersonify,项目名称:tvb-framework,代码行数:28,代码来源:flow_controller.py

示例2: reload_burst_operation

# 需要导入模块: from tvb.core.services.project_service import ProjectService [as 别名]
# 或者: from tvb.core.services.project_service.ProjectService import get_operations_in_group [as 别名]
 def reload_burst_operation(self, operation_id, is_group, **_):
     """
     Find out from which burst was this operation launched. Set that burst as the selected one and 
     redirect to the burst page.
     """
     is_group = int(is_group)
     if not is_group:
         operation = self.flow_service.load_operation(int(operation_id))
     else:
         op_group = ProjectService.get_operation_group_by_id(operation_id)
         first_op = ProjectService.get_operations_in_group(op_group)[0]
         operation = self.flow_service.load_operation(int(first_op.id))
     operation.burst.prepare_after_load()
     common.add2session(common.KEY_BURST_CONFIG, operation.burst)
     raise cherrypy.HTTPRedirect("/burst/")
开发者ID:transpersonify,项目名称:tvb-framework,代码行数:17,代码来源:flow_controller.py

示例3: stop_operation

# 需要导入模块: from tvb.core.services.project_service import ProjectService [as 别名]
# 或者: from tvb.core.services.project_service.ProjectService import get_operations_in_group [as 别名]
 def stop_operation(self, operation_id, is_group, remove_after_stop=False):
     """
     Stop the operation given by operation_id. If is_group is true stop all the
     operations from that group.
     """
     operation_service = OperationService()
     result = False
     if int(is_group) == 0:
         result = operation_service.stop_operation(operation_id)
         if remove_after_stop:
             ProjectService().remove_operation(operation_id)
     else:
         op_group = ProjectService.get_operation_group_by_id(operation_id)
         operations_in_group = ProjectService.get_operations_in_group(op_group)
         for operation in operations_in_group:
             tmp_res = operation_service.stop_operation(operation.id)
             if remove_after_stop:
                 ProjectService().remove_operation(operation.id)
             result = result or tmp_res
     return result
开发者ID:transpersonify,项目名称:tvb-framework,代码行数:22,代码来源:flow_controller.py


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