def generateDefaultLoader(outputDir):

    definitionsToLoad = []

    defToLoadDef = generateBootstrapper()
    ContextModule.pickleDefinition(
        os.path.join(outputDir, 'loadLibraryDefinition.pomset'), defToLoadDef)
    context = ContextModule.wrapPomsetInContext(defToLoadDef)
    definitionsToLoad.append(context)
    
    wcDefinition = DefinitionTestModule.createWordCountDefinition()
    wcDefinitionPath = wcDefinition.id() + '.pomset'
    wcDefinition.url(wcDefinitionPath)
    ContextModule.pickleDefinition(
        os.path.join(outputDir, wcDefinitionPath), wcDefinition)
    context = ContextModule.wrapPomsetInContext(wcDefinition)
    definitionsToLoad.append(context)
    
    wcrDefinition = DefinitionTestModule.createWordCountReduceDefinition()
    wcrDefinitionPath = wcrDefinition.id() + '.pomset'
    wcrDefinition.url(wcrDefinitionPath)
    ContextModule.pickleDefinition(
        os.path.join(outputDir, wcrDefinitionPath), wcrDefinition)
    context = ContextModule.wrapPomsetInContext(wcrDefinition)
    definitionsToLoad.append(context)


    loadValuesDefinition = \
        DefinitionTestModule.createLoadListValuesFromFilesDefinition()
    loadValuesDefinitionPath = loadValuesDefinition.id() + '.pomset'
    loadValuesDefinition.url(loadValuesDefinitionPath)
    ContextModule.pickleDefinition(
        os.path.join(outputDir, loadValuesDefinitionPath), loadValuesDefinition)
    context = ContextModule.wrapPomsetInContext(loadValuesDefinition)
    definitionsToLoad.append(context)

    library = LibraryModule.Library()
    map(library.addPomsetContext, definitionsToLoad)

    defToLoadDefs = library.generateBootstrapLoaderPomset()
    ContextModule.pickleDefinition(
        os.path.join(outputDir, 'loadLibraryDefinitions.pomset'), defToLoadDefs)
    
    return
Exemple #2
0
 def getPythonEvalDefinition(self):
     pythonEvalDefinition = \
         TestUtilsModule.createLoadListValuesFromFilesDefinition()
     return pythonEvalDefinition