本文整理汇总了Python中tvb.core.services.flow_service.FlowService.get_operation_numbers方法的典型用法代码示例。如果您正苦于以下问题:Python FlowService.get_operation_numbers方法的具体用法?Python FlowService.get_operation_numbers怎么用?Python FlowService.get_operation_numbers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tvb.core.services.flow_service.FlowService
的用法示例。
在下文中一共展示了FlowService.get_operation_numbers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: BaseController
# 需要导入模块: from tvb.core.services.flow_service import FlowService [as 别名]
# 或者: from tvb.core.services.flow_service.FlowService import get_operation_numbers [as 别名]
#.........这里部分代码省略.........
result_template[common.KEY_SUB_SECTION] = 'stimulus'
else:
### Analyzers
result_template[common.KEY_SECTION] = algo_group.group_category.displayname.lower()
result_template[common.KEY_SUB_SECTION] = algo_group.subsection_name
result_template[common.KEY_SUBMENU_LIST] = self.analyze_adapters
def _fill_user_specific_attributes(self, template_dictionary):
"""
Attributes needed for base_user template.
"""
template_dictionary[common.KEY_INCLUDE_TOOLTIP] = False
template_dictionary[common.KEY_WRAP_CONTENT_IN_MAIN_DIV] = True
template_dictionary[common.KEY_CURRENT_TAB] = 'none'
return template_dictionary
def fill_default_attributes(self, template_dictionary, escape_db_operations=False):
"""
Fill into 'template_dictionary' data that we want to have ready in UI.
"""
template_dictionary = self._populate_user_and_project(template_dictionary, escape_db_operations)
template_dictionary = self._populate_message(template_dictionary)
template_dictionary = self._populate_menu(template_dictionary)
if common.KEY_ERRORS not in template_dictionary:
template_dictionary[common.KEY_ERRORS] = {}
if common.KEY_FORM_DATA not in template_dictionary:
template_dictionary[common.KEY_FORM_DATA] = {}
if common.KEY_SUB_SECTION not in template_dictionary and common.KEY_SECTION in template_dictionary:
template_dictionary[common.KEY_SUB_SECTION] = template_dictionary[common.KEY_SECTION]
if common.KEY_SUBMENU_LIST not in template_dictionary:
template_dictionary[common.KEY_SUBMENU_LIST] = None
template_dictionary[common.KEY_CURRENT_VERSION] = TvbProfile.current.version.BASE_VERSION
template_dictionary[common.KEY_CURRENT_JS_VERSION] = TvbProfile.current.version.BASE_VERSION.replace(".", "")
return template_dictionary
def fill_overlay_attributes(self, template_dictionary, title, description, content_template,
css_class, tabs_horizontal=None, overlay_indexes=None, tabs_vertical=None):
"""
This method prepares parameters for rendering overlay (overlay.html)
:param title: overlay title
:param description: overlay description
:param content_template: path&name of the template file which will fill overlay content (without .html)
:param css_class: CSS class to be applied on overlay
:param tabs_horizontal: list of strings containing names of the tabs spread horizontally
:param tabs_vertical: list of strings containing names of the tabs spread vertically
"""
if template_dictionary is None:
template_dictionary = dict()
template_dictionary[common.KEY_OVERLAY_TITLE] = title
template_dictionary[common.KEY_OVERLAY_DESCRIPTION] = description
template_dictionary[common.KEY_OVERLAY_CONTENT_TEMPLATE] = content_template
template_dictionary[common.KEY_OVERLAY_CLASS] = css_class
template_dictionary[common.KEY_OVERLAY_TABS_HORIZONTAL] = tabs_horizontal if tabs_horizontal is not None else []
template_dictionary[common.KEY_OVERLAY_TABS_VERTICAL] = tabs_vertical if tabs_vertical is not None else []
if overlay_indexes is not None:
template_dictionary[common.KEY_OVERLAY_INDEXES] = overlay_indexes
else:
template_dictionary[common.KEY_OVERLAY_INDEXES] = range(len(tabs_horizontal)) \
if tabs_horizontal is not None else []
template_dictionary[common.KEY_OVERLAY_PAGINATION] = False
return template_dictionary
@cherrypy.expose
@using_template('overlay_blocker')
def showBlockerOverlay(self, **data):
"""
Returns the content of the blocking overlay (covers entire page and do not allow any action)
"""
return self.fill_default_attributes(dict(data))
def update_operations_count(self):
"""
If a project is selected, update Operation Numbers in call-out.
"""
project = common.get_current_project()
if project is not None:
fns, sta, err, canceled, pending = self.flow_service.get_operation_numbers(project.id)
project.operations_finished = fns
project.operations_started = sta
project.operations_error = err
project.operations_canceled = canceled
project.operations_pending = pending
common.add2session(common.KEY_PROJECT, project)