示例#1
0
    def __init__(self):
        BaseController.__init__(self)
        self.context = SelectedAdapterContext()
        self.files_helper = FilesHelper()
        self.operation_services = OperationService()
        self.simulator_controller = SimulatorController()

        analyze_category, groups = self.algorithm_service.get_analyze_groups()
        adapters_list = []
        for adapter_group in groups:

            if len(adapter_group.children) > 1:
                ids = [str(child.id) for child in adapter_group.children]
                ids = ','.join(ids)
                adapter_link = '/flow/show_group_of_algorithms/' + str(
                    analyze_category.id) + "/" + ids
            else:
                adapter_link = self.get_url_adapter(
                    analyze_category.id, adapter_group.children[0].id)

            adapters_list.append({
                common.KEY_TITLE:
                adapter_group.name,
                'link':
                adapter_link,
                'description':
                adapter_group.description,
                'subsection':
                adapter_group.children[0].subsection_name
            })
        self.analyze_adapters = adapters_list
 def fill_default_attributes(self, template_dictionary, subsection='project'):
     """
     Overwrite base controller to add required parameters for adapter templates.
     """
     template_dictionary[common.KEY_SECTION] = 'project'
     template_dictionary[common.KEY_SUB_SECTION] = subsection
     template_dictionary[common.KEY_INCLUDE_RESOURCES] = 'project/included_resources'
     BaseController.fill_default_attributes(self, template_dictionary)
     return template_dictionary
 def fill_default_attributes(self, template_dictionary, subsection='project'):
     """
     Overwrite base controller to add required parameters for adapter templates.
     """
     template_dictionary[common.KEY_SECTION] = 'project'
     template_dictionary[common.KEY_SUB_SECTION] = subsection
     template_dictionary[common.KEY_INCLUDE_RESOURCES] = 'project/included_resources'
     BaseController.fill_default_attributes(self, template_dictionary)
     return template_dictionary
 def fill_default_attributes(self, template_dictionary):
     """
     Overwrite base controller to add required parameters for adapter templates.
     """
     template_dictionary[common.KEY_SECTION] = 'burst'
     template_dictionary[common.KEY_SUB_SECTION] = 'surfacemodel'
     template_dictionary[common.KEY_INCLUDE_RESOURCES] = 'spatial/included_resources'
     BaseController.fill_default_attributes(self, template_dictionary)
     return template_dictionary
 def fill_default_attributes(self, template_dictionary):
     """
     Overwrite base controller to add required parameters for adapter templates.
     """
     template_dictionary[common.KEY_SECTION] = 'burst'
     template_dictionary[common.KEY_SUB_SECTION] = 'surfacemodel'
     template_dictionary[common.KEY_INCLUDE_RESOURCES] = 'spatial/included_resources'
     BaseController.fill_default_attributes(self, template_dictionary)
     return template_dictionary
示例#6
0
 def __init__(self):
     BaseController.__init__(self)
     self.operation_service = OperationService()
     self.logger = get_logger(__name__)
     editable_entities = [dict(link='/spatial/stimulus/region/step_1_submit/1/1', title='Region Stimulus',
                               subsection='regionstim', description='Create a new Stimulus on Region level'),
                          dict(link='/spatial/stimulus/surface/step_1_submit/1/1', title='Surface Stimulus',
                               subsection='surfacestim', description='Create a new Stimulus on Surface level')]
     self.submenu_list = editable_entities
 def __init__(self):
     BaseController.__init__(self)
     self.flow_service = FlowService()
     self.logger = get_logger(__name__)
     editable_entities = [dict(link='/spatial/stimulus/region/step_1_submit/1/1', title='Region Stimulus',
                               subsection='regionstim', description='Create a new Stimulus on Region level'),
                          dict(link='/spatial/stimulus/surface/step_1_submit/1/1', title='Surface Stimulus',
                               subsection='surfacestim', description='Create a new Stimulus on Surface level')]
     self.submenu_list = editable_entities
 def fill_default_attributes(self, template_dictionary):
     """
     Overwrite base controller to add required parameters for adapter templates.
     """
     template_dictionary[common.KEY_SECTION] = 'connectivity'
     template_dictionary[common.KEY_SUB_SECTION] = 'local'
     template_dictionary[common.KEY_SUBMENU_LIST] = self.connectivity_submenu
     template_dictionary[common.KEY_INCLUDE_RESOURCES] = 'spatial/included_resources'
     BaseController.fill_default_attributes(self, template_dictionary)
     return template_dictionary
示例#9
0
 def fill_default_attributes(self, template_dictionary, subsection='stimulus'):
     """
     Overwrite base controller to add required parameters for adapter templates.
     """
     template_dictionary[common.KEY_SECTION] = 'stimulus'
     template_dictionary[common.KEY_SUB_SECTION] = subsection
     template_dictionary[common.KEY_SUBMENU_LIST] = self.submenu_list
     template_dictionary[common.KEY_INCLUDE_RESOURCES] = 'spatial/included_resources'
     BaseController.fill_default_attributes(self, template_dictionary)
     return template_dictionary
    def fill_default_attributes(self, template_dictionary, subsection='burst'):

        template_dictionary[common.KEY_PARAMETERS_CONFIG] = False
        template_dictionary[common.KEY_SECTION] = 'burst'
        template_dictionary[common.KEY_SUBMENU_LIST] = self.burst_submenu

        if common.KEY_SUB_SECTION not in template_dictionary:
            template_dictionary[common.KEY_SUB_SECTION] = subsection

        BaseController.fill_default_attributes(self, template_dictionary)
        return template_dictionary
示例#11
0
    def fill_default_attributes(self, template_dictionary, subsection='burst'):

        template_dictionary[common.KEY_PARAMETERS_CONFIG] = False
        template_dictionary[common.KEY_SECTION] = 'burst'
        template_dictionary[common.KEY_SUBMENU_LIST] = self.burst_submenu

        if common.KEY_SUB_SECTION not in template_dictionary:
            template_dictionary[common.KEY_SUB_SECTION] = subsection

        BaseController.fill_default_attributes(self, template_dictionary)
        return template_dictionary
 def fill_default_attributes(self, template_dictionary):
     """
     Fill into 'template_dictionary' data that we want to have ready in UI.
     """
     template_dictionary = self._populate_version(template_dictionary)
     BaseController.fill_default_attributes(self, template_dictionary)
     template_dictionary[common.KEY_INCLUDE_TOOLTIP] = True
     template_dictionary[common.KEY_WRAP_CONTENT_IN_MAIN_DIV] = False
     template_dictionary[common.KEY_CURRENT_TAB] = 'nav-user'
     template_dictionary[KEY_STORAGE_IN_UPDATE] = (TvbProfile.current.version.DATA_CHECKED_TO_VERSION <
                                                   TvbProfile.current.version.DATA_VERSION)
     return template_dictionary
示例#13
0
 def fill_default_attributes(self, template_dictionary):
     """
     Fill into 'template_dictionary' data that we want to have ready in UI.
     """
     template_dictionary = self._populate_version(template_dictionary)
     BaseController.fill_default_attributes(self, template_dictionary)
     template_dictionary[common.KEY_INCLUDE_TOOLTIP] = True
     template_dictionary[common.KEY_WRAP_CONTENT_IN_MAIN_DIV] = False
     template_dictionary[common.KEY_CURRENT_TAB] = 'nav-user'
     template_dictionary[KEY_STORAGE_IN_UPDATE] = (TvbProfile.current.version.DATA_CHECKED_TO_VERSION <
                                                   TvbProfile.current.version.DATA_VERSION)
     return template_dictionary
    def fill_default_attributes(self, template_dictionary, title='-'):
        """
        Overwrite base controller to add required parameters for adapter templates.
        """
        if common.KEY_TITLE not in template_dictionary:
            template_dictionary[common.KEY_TITLE] = title

        if common.KEY_PARENT_DIV not in template_dictionary:
            template_dictionary[common.KEY_PARENT_DIV] = ''
        if common.KEY_PARAMETERS_CONFIG not in template_dictionary:
            template_dictionary[common.KEY_PARAMETERS_CONFIG] = False

        template_dictionary[common.KEY_INCLUDE_RESOURCES] = 'flow/included_resources'
        BaseController.fill_default_attributes(self, template_dictionary)
        return template_dictionary
示例#15
0
    def fill_default_attributes(self, template_dictionary, title='-'):
        """
        Overwrite base controller to add required parameters for adapter templates.
        """
        if common.KEY_TITLE not in template_dictionary:
            template_dictionary[common.KEY_TITLE] = title

        if common.KEY_PARENT_DIV not in template_dictionary:
            template_dictionary[common.KEY_PARENT_DIV] = ''
        if common.KEY_PARAMETERS_CONFIG not in template_dictionary:
            template_dictionary[common.KEY_PARAMETERS_CONFIG] = False

        template_dictionary[common.KEY_INCLUDE_RESOURCES] = 'flow/included_resources'
        BaseController.fill_default_attributes(self, template_dictionary)
        return template_dictionary
示例#16
0
def init_cherrypy(arguments=None):
    #### Mount static folders from modules marked for introspection
    arguments = arguments or []
    CONFIGUER = TvbProfile.current.web.CHERRYPY_CONFIGURATION
    for module in arguments:
        module_inst = importlib.import_module(str(module))
        module_path = os.path.dirname(os.path.abspath(module_inst.__file__))
        CONFIGUER["/static_" + str(module)] = {'tools.staticdir.on': True,
                                               'tools.staticdir.dir': '.',
                                               'tools.staticdir.root': module_path}

    #### Mount controllers, and specify the root URL for them.
    cherrypy.tree.mount(BaseController(), "/", config=CONFIGUER)
    cherrypy.tree.mount(UserController(), "/user/", config=CONFIGUER)
    cherrypy.tree.mount(ProjectController(), "/project/", config=CONFIGUER)
    cherrypy.tree.mount(FigureController(), "/project/figure/", config=CONFIGUER)
    cherrypy.tree.mount(FlowController(), "/flow/", config=CONFIGUER)
    cherrypy.tree.mount(SettingsController(), "/settings/", config=CONFIGUER)
    cherrypy.tree.mount(HelpController(), "/help/", config=CONFIGUER)
    cherrypy.tree.mount(SimulatorController(), "/burst/", config=CONFIGUER)
    cherrypy.tree.mount(ParameterExplorationController(), "/burst/explore/", config=CONFIGUER)
    cherrypy.tree.mount(DynamicModelController(), "/burst/dynamic/", config=CONFIGUER)
    cherrypy.tree.mount(SpatioTemporalController(), "/spatial/", config=CONFIGUER)
    cherrypy.tree.mount(RegionsModelParametersController(), "/burst/modelparameters/regions/", config=CONFIGUER)
    cherrypy.tree.mount(SurfaceModelParametersController(), "/spatial/modelparameters/surface/", config=CONFIGUER)
    cherrypy.tree.mount(RegionStimulusController(), "/spatial/stimulus/region/", config=CONFIGUER)
    cherrypy.tree.mount(SurfaceStimulusController(), "/spatial/stimulus/surface/", config=CONFIGUER)
    cherrypy.tree.mount(LocalConnectivityController(), "/spatial/localconnectivity/", config=CONFIGUER)
    cherrypy.tree.mount(NoiseConfigurationController(), "/burst/noise/", config=CONFIGUER)
    cherrypy.tree.mount(HPCController(), "/hpc/", config=CONFIGUER)

    cherrypy.config.update(CONFIGUER)

    # ----------------- Register additional request handlers -----------------
    # This tool checks for MAX upload size
    cherrypy.tools.upload = Tool('on_start_resource', RequestHandler.check_upload_size)
    # This tools clean up files on disk (mainly after export)
    cherrypy.tools.cleanup = Tool('on_end_request', RequestHandler.clean_files_on_disk)
    # ----------------- End register additional request handlers ----------------

    # Register housekeeping job
    if TvbProfile.current.hpc.IS_HPC_RUN and TvbProfile.current.hpc.CAN_RUN_HPC:
        cherrypy.engine.housekeeper = cherrypy.process.plugins.BackgroundTask(
            TvbProfile.current.hpc.BACKGROUND_JOB_INTERVAL, HPCOperationService.check_operations_job)
        cherrypy.engine.housekeeper.start()

    # HTTP Server is fired now ######
    cherrypy.engine.start()
 def __init__(self):
     BaseController.__init__(self)
     self.project_service = ProjectService()
示例#18
0
 def __init__(self):
     BaseController.__init__(self)
     self.version_info = None
示例#19
0
 def __init__(self):
     BaseController.__init__(self)
     self.context = SelectedAdapterContext()
     self.files_helper = FilesHelper()
 def __init__(self):
     BaseController.__init__(self)
     self.config = HelpConfig()
 def __init__(self):
     BaseController.__init__(self)
     self.project_service = ProjectService()
 def __init__(self):
     BaseController.__init__(self)
示例#23
0
 def __init__(self):
     BaseController.__init__(self)
     self.context = SelectedAdapterContext()
     self.files_helper = FilesHelper()
     self.operation_services = OperationService()
示例#24
0
 def __init__(self):
     BaseController.__init__(self)
     self.config = HelpConfig()
 def __init__(self):
     BaseController.__init__(self)
     self.context = SelectedAdapterContext()
     self.files_helper = FilesHelper()
示例#26
0
 def __init__(self):
     BaseController.__init__(self)
 def __init__(self):
     BaseController.__init__(self)
     self.version_info = None