コード例 #1
0
ファイル: combined.py プロジェクト: vistrails-ufrj/VisTrails
 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
ファイル: combined.py プロジェクト: cjh1/VisTrails
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
ファイル: combined.py プロジェクト: painter1/vistrails
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
ファイル: combined.py プロジェクト: cjh1/VisTrails
 def run(self, vistrail, name):
     VisualQuery.run(self, vistrail, name)
     self.search_stmt = SearchCompiler(self.search_str).searchStmt
コード例 #5
0
ファイル: combined.py プロジェクト: painter1/vistrails
 def run(self, vistrail, name):
     VisualQuery.run(self, vistrail, name)
     self.search_stmt = SearchCompiler(self.search_str).searchStmt
コード例 #6
0
ファイル: combined.py プロジェクト: licode/VisTrails
 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
ファイル: combined.py プロジェクト: sguzwf/VisTrails
 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