コード例 #1
0
def createPlugins(dictionary):

#Now create the projects.
    
    projectList = []

    projectNames = findProjectDirectories(dictionary['directoryPath'])

    for projectName in projectNames:
        # check project name in current path already
        if (string.count(dictionary['directoryPath'],  str("/"+projectName)) > 0) :
           path =  os.path.realpath(dictionary['directoryPath']) + "/"
        # check if adding projectName
        else:
           path = os.path.realpath(dictionary['directoryPath']) + "/"+ str(projectName) + "/"
        print "Creating data for " + projectName
        project = PluginProject(projectName, path)
        #project.assignMetas()
        project.searchProjects()
        projectList.append(project)
        projectList.sort()



    # Now create the html pages for the projects.
    print "Now creating HTML documents in directory: " + os.path.realpath(dictionary['pluginsSubDirPath'])

    htmlDocuments = createPluginHTMLDocuments("Plugins Webpage", dictionary['projectNumber'], dictionary['documentBlurb'],  projectList, dictionary['pluginsSubDirPath'],  dictionary['stylesheetList'],  dictionary['extWeb'],  dictionary['email'], dictionary['script'],  dictionary['pictureDirectory'],  dictionary['indexFileName'],  "Google", "")
    htmlDocuments.createHTMLPages()
    # These two aren't necc. for this file, as the images are already in the right place.    
    htmlDocuments.copyPictures(dictionary['imagePath'])
    htmlDocuments.copyStylesheets()
コード例 #2
0
 def findPluginProject(self):
     
     subDirectoryList =  string.split(string.split(self.filename, self.baseDirectory)[1], "/")
     projectList = findProjectDirectories(self.baseDirectory)
     
     for directory in subDirectoryList:
         for project in projectList:
             if directory == project:
                 return project
     return ""
コード例 #3
0
    def test_findProjectDirectories(self):

        directoryPath = os.path.realpath('../../../')
        projectList = createDocs.findProjectDirectories(directoryPath)

        # Make it applicable for UW with and without Experimental toolbox.
        if projectList.count('Experimental') > 0 :
            testList = ['StGermain', 'StgDomain', 'StgFEM', 'PICellerator', 'Underworld', 'gLucifer', 'Experimental']
        else:
            testList = ['StGermain', 'StgDomain', 'StgFEM', 'PICellerator', 'Underworld', 'gLucifer']
         #Test to make sure list contains everything up to UW. This test is going to fail for non-UW projects
        self.assertEqual(sorted(projectList), sorted(testList))

        print "Tested findProjectDirectories"