def test_createCodex(self):
        #This test will be longish. Have to create a full codex.
        # Will fail for non-UW versions.
        directoryPath = os.path.realpath('../../../') 
        basicDict = createDocs.createListDictionary(self.values[0], self.values[1], self.values[2],self.values[3],directoryPath,self.values[5],self.values[6],self.values[7],self.values[8])
        #redirecting output of function so it doesn't display to stout
        saveout = sys.stdout  
        fsock = open('test_createCodex.log', 'w') 
        sys.stdout = fsock  
        #create Codex
        createDocument.checkOutputPath(self.values[5])
        createDocs.findVersion(basicDict)
        createDocs.createCodex(basicDict)
        sys.stdout = saveout    
        fsock.close() 
        #should go back to stout now ...
        #check for existence of html files that should have been created.
        self.assertTrue(os.path.isfile(os.path.join(basicDict['codexSubDirPath'], 'index.html')))
        self.assertTrue(os.path.isfile(os.path.join(basicDict['codexSubDirPath'], 'StGermain.html')))
        self.assertTrue(os.path.isfile(os.path.join(basicDict['codexSubDirPath'], 'StgDomain.html')))
        self.assertTrue(os.path.isfile(os.path.join(basicDict['codexSubDirPath'], 'StgFEM.html')))
        self.assertTrue(os.path.isfile(os.path.join(basicDict['codexSubDirPath'], 'PICellerator.html')))
        self.assertTrue(os.path.isfile(os.path.join(basicDict['codexSubDirPath'], 'Underworld.html')))
        self.assertTrue(os.path.isfile(os.path.join(basicDict['codexSubDirPath'], 'gLucifer.html')))

        print "Tested createCodex"
Exemple #2
0
def copyPics(pathFrom, pathTo):
    print "Copying content of directory of pictures :" + os.path.realpath(
        pathFrom) + "/* to directory: " + os.path.realpath(pathTo)
    createDocument.checkOutputPath(pathTo)
    # Copy everything there to the moment
    os.system('cp ' + os.path.realpath(pathFrom) + "/* " +
              os.path.realpath(pathTo))
 def createHTMLPages(self) :
     #check output path
     createDocument.checkOutputPath(self.path)
     #create project pages
     for count in range(len(self.projectList)):
         self.createHTMLPage(count)
         
     #create Index page    
     self.createIndexPage()
Exemple #4
0
    def createHTMLPages(self):
        #check output path
        createDocument.checkOutputPath(self.path)
        #create project pages
        for count in range(len(self.projectList)):
            self.createHTMLPage(count)

        #create Index page
        self.createIndexPage()
 def copyPictures(self,  picPath):
     print self.path
     if not(picPath == ""):
         print "Copying directory of pictures :" + os.path.realpath(picPath) + "/* to directory: " + os.path.join(self.path,  self.pictureSubDirectoryName) 
         # Copy everything there to the moment
         # check destination directory exists. If not, create 
         pictureSubdirectoryPath = os.path.join(self.path,  self.pictureSubDirectoryName)
         createDocument.checkOutputPath(pictureSubdirectoryPath)
         os.system('cp '+ os.path.realpath(picPath) + "/* "+ pictureSubdirectoryPath )
     else:
         print "No Picture directory to copy."
    def test_createTempFile(self):
        #create dictionary
        basicDict = createDocs.createListDictionary(self.values[0], self.values[1], self.values[2],self.values[3],self.values[4],self.values[5],self.values[6],self.values[7],self.values[8])
        basicDict['tempPythonFilePath'] = os.path.realpath(self.values[5] + "/tmpfilter.py")
        #redirecting output of function so it doesn't display to stout. Needs more work.
        saveout = sys.stdout  
        fsock = open('test_createTempFile.log', 'w') 
        sys.stdout = fsock

        #run creation file
        createDocument.checkOutputPath(self.values[5])
        createDocs.createTempFile(basicDict)

        sys.stdout = saveout    
        fsock.close() 
        #should go back to stout now ...
        #test for existence. and that it runs.
        self.assertTrue(os.path.isfile(basicDict['tempPythonFilePath']))

        print "Tested createTempFile"
    def test_createDoxygen(self):
        #create dictionary
        basicDict = createDocs.createListDictionary(self.values[0], self.values[1], self.values[2],self.values[3],self.values[4],self.values[5],self.values[6],self.values[7],self.values[8])
        print "Output from test test_createDoxygen. Please ignore"
        #print self.values
        print "%%%%%%%%%%%%%%%%%%%%%%%%%"
        #redirecting output of function so it doesn't display to stout. Needs more work.
        saveout = sys.stdout  
        fsock = open('test_createDoxygen.log', 'w') 
        sys.stdout = fsock
        #run createDoxygen
        createDocument.checkOutputPath(self.values[5])
        createDocs.findVersion(basicDict)
        createDocs.createDoxygen(basicDict)
        sys.stdout = saveout    
        fsock.close() 
        #should go back to stout now ...
        print "%%%%%%%%%%%%%%%%%%%%%%%%%"
        #check for main index.html page in standard location. If it's there, Doxygen worked. Maybe not perfectly,
        # but it's there and running.
        self.assertTrue(os.path.isfile(os.path.join(basicDict['doxygenSubDirPath'], "html/index.html")))

        print "Tested Doxygen"
Exemple #8
0
def copyPics(pathFrom, pathTo):
    print "Copying content of directory of pictures :" + os.path.realpath(pathFrom) + "/* to directory: " + os.path.realpath(pathTo) 
    createDocument.checkOutputPath(pathTo)
    # Copy everything there to the moment
    os.system('cp '+ os.path.realpath(pathFrom) + "/* "+os.path.realpath(pathTo) )
Exemple #9
0
    
   
if __name__=='__main__':
    values = sys.argv
    for i in range(5):
        if len(values)< 5:
            values.append("")
    

    #Define input directory (relative to ~/stgUnderworldE/ )
    directoryPath = os.path.realpath('.')
    print directoryPath
    # Create the output directory. This is relative to the ./mainProj/config page.(relative to ~/stgUnderworldE/ )
    docPath = os.path.realpath('./doc/')
    
    # createDictionary
    mainDictionary = createListDictionary(values[1],values[2], values[3], values[4], directoryPath, docPath, "")

    # Set up help print statement
    if ((mainDictionary['arg1'] == "help") or (mainDictionary['arg1'] == '-h') or (mainDictionary['arg1'] =='--help') or (mainDictionary['arg1'] == 'h')):
        printHelpStatement(mainDictionary)

    else:
        #check the directory now exists.
        createDocument.checkOutputPath(docPath)

        createCodex(mainDictionary)
        createDoxygen(mainDictionary)


Exemple #10
0
    #Define input directory (relative to ~/stgUnderworldE/ )
    if values[2] != "" :
        directoryPath = os.path.realpath(values[2])
    else:
        directoryPath = os.path.realpath('../../')
    print directoryPath
    # Create the output directory. This is relative to the ./mainProj/config page.(relative to ~/stgUnderworldE/ )
    if values[3] != "":
        docPath = os.path.realpath(values[3])
    else:
        docPath = os.path.join(directoryPath, 'doc/')
    print docPath

    # createDictionary
    mainDictionary = createListDictionary("","", "", values[1], directoryPath, docPath, values[4])

    # Set up help print statement
    if ((values[1] == "help") or (values[1] == '-h') or (values[1] =='--help') or (values[1] == 'h')):
        printHelpStatement(mainDictionary)

    else:
        #check the directory now exists.
        createDocument.checkOutputPath(docPath)

        
        createDoxygen(mainDictionary)