示例#1
0
 def run(self, controller, name):
     if self.search_str:
         reportusage.record_feature('query', controller)
     if self.queryPipeline is not None and \
         len(self.queryPipeline.modules) > 0:
         VisualQuery.run(self, controller, name)
     compiler = SearchCompiler(self.search_str, self.use_regex)
     self.search_stmt = compiler.searchStmt
示例#2
0
class CombinedSearch(VisualQuery):
    def __init__(self, search_str=None, pipeline=None, versions_to_check=None):
        VisualQuery.__init__(self, pipeline, versions_to_check)
        self.search_str = search_str

    def run(self, vistrail, name):
        VisualQuery.run(self, vistrail, name)
        self.search_stmt = SearchCompiler(self.search_str).searchStmt

    def match(self, vistrail, action):
        if self.queryPipeline is not None and \
                len(self.queryPipeline.modules) > 0:
            if action.timestep in self.versionDict:
                return self.search_stmt.match(vistrail, action)
            return False
        else:
            return self.search_stmt.match(vistrail, action)

    def matchModule(self, version_id, module):
        if self.queryPipeline is not None and \
                len(self.queryPipeline.modules) > 0:
            return VisualQuery.matchModule(self, version_id, module)
        return True
    
    def getResultEntity(self, vistrail, versions_to_check):
        from vistrails.core.collection.vistrail import VistrailEntity

        locators = []
        vistrail_entity = None
        for version in versions_to_check:
            if version in vistrail.actionMap:
                action = vistrail.actionMap[version]
                if self.match(vistrail, action):
                    # have a match, get vistrail entity
                    if vistrail_entity is None:
                        vistrail_entity = VistrailEntity()
                        # don't want to add all workflows, executions
                        vistrail_entity.set_vistrail(vistrail)
                    vistrail_entity.add_workflow_entity(version)
                    # FIXME this is not done at the low level but in
                    # Collection class, probably should be reworked
                    vistrail_entity.wf_entity_map[version].parent = \
                        vistrail_entity
        return vistrail_entity
示例#3
0
class CombinedSearch(VisualQuery):
    def __init__(self, search_str=None, pipeline=None, versions_to_check=None):
        VisualQuery.__init__(self, pipeline, versions_to_check)
        self.search_str = search_str

    def run(self, vistrail, name):
        VisualQuery.run(self, vistrail, name)
        self.search_stmt = SearchCompiler(self.search_str).searchStmt

    def match(self, vistrail, action):
        if self.queryPipeline is not None and \
                len(self.queryPipeline.modules) > 0:
            if action.timestep in self.versionDict:
                return self.search_stmt.match(vistrail, action)
            return False
        else:
            return self.search_stmt.match(vistrail, action)

    def matchModule(self, version_id, module):
        if self.queryPipeline is not None and \
                len(self.queryPipeline.modules) > 0:
            return VisualQuery.matchModule(self, version_id, module)
        return True

    def getResultEntity(self, vistrail, versions_to_check):
        from core.collection.vistrail import VistrailEntity

        locators = []
        vistrail_entity = None
        for version in versions_to_check:
            if version in vistrail.actionMap:
                action = vistrail.actionMap[version]
                if self.match(vistrail, action):
                    # have a match, get vistrail entity
                    if vistrail_entity is None:
                        vistrail_entity = VistrailEntity()
                        # don't want to add all workflows, executions
                        vistrail_entity.set_vistrail(vistrail)
                    vistrail_entity.add_workflow_entity(version)
                    # FIXME this is not done at the low level but in
                    # Collection class, probably should be reworked
                    vistrail_entity.wf_entity_map[version].parent = \
                        vistrail_entity
        return vistrail_entity
示例#4
0
 def run(self, vistrail, name):
     VisualQuery.run(self, vistrail, name)
     self.search_stmt = SearchCompiler(self.search_str).searchStmt
示例#5
0
 def run(self, vistrail, name):
     VisualQuery.run(self, vistrail, name)
     self.search_stmt = SearchCompiler(self.search_str).searchStmt
示例#6
0
 def run(self, vistrail, name):
     VisualQuery.run(self, vistrail, name)
     compiler = SearchCompiler(self.search_str, self.use_regex)
     self.search_stmt = compiler.searchStmt
示例#7
0
 def run(self, controller, name):
     if self.queryPipeline is not None and \
         len(self.queryPipeline.modules) > 0:
         VisualQuery.run(self, controller, name)
     compiler = SearchCompiler(self.search_str, self.use_regex)
     self.search_stmt = compiler.searchStmt