Beispiel #1
0
 def AnalyzeDoxygen(self, doxygenpath):
    self.db_functions.DBRead()
    files = [file for file in glob.glob(doxygenpath+'/**/*', recursive=True) if file.find('class_') != -1]
    # files = [file for file in glob.glob(doxygenpath+'/**/*', recursive=True) if file.find('.xml') != -1]
    self.temp_dict = self.db_functions.GetDict()
    MyLogger.SetFraction(len(files))
    for file in files:
       MyLogger.SetNumerator(files.index(file))
       self.__ParseFunctions(file)
       # self.__ParseDefines(file)
    self.db_functions.DBImportDict(self.temp_dict)
    self.db_functions.DBWrite()
    self.__LoadFunctionList()
Beispiel #2
0
 def main():
     db = MyDataBase.GetInstance('MyDataBaseSample.xlsx')
     db.DBAppendColumn(['data/column1', 'data/column2', 'data/column3'])
     MyLogger.SetFraction(100)
     dict = db.GetDict()
     for i in range(100):
         MyLogger.SetNumerator(i)
         db.DBAppendRow([str(i), str(i), str(i)], dict)
     db.DBImportDict(dict)
     MyLogger.success(db.GetColumns())
     MyLogger.success(db.GetDict())
     MyLogger.success(db.GetStr())
     MyLogger.success(db.GetHTML())
     db.DBSort('data/column3', ascending=False)
     db.DBDropDuplicates('data/column3')
     db.DBWrite()
Beispiel #3
0
 def DraftUML(self):
    MyLogger.SetFraction(len(self.all_functions.items()))
    for index,values in self.all_functions.items():
       MyLogger.SetNumerator(index)
       compoundname = values['compoundname']
       definition = values['definition']
       argsstring = values['argsstring']
       name = values['name'][values['name'].rfind(":")+1:]
       samenamecnt = str(values['samenamecnt'])
       bodyfile = values['bodyfile']
       bodystart = int(values['bodystart'])-1
       bodyend = int(values['bodyend'])
       inputfile = self.inputbase+bodyfile
       outputfile = self.outputbase+bodyfile+'/'+name+"("+samenamecnt+').pu'
       MyLogger.sakura(outputfile)
       if not os.path.exists(os.path.dirname(outputfile)):
          os.makedirs(os.path.dirname(outputfile))
       if bodyend != -1:
          functionbody = myopen(inputfile, 'r').readlines()[bodystart:bodyend]
       else:
          functionbody = myopen(inputfile, 'r').readlines()[bodystart]
       functionbody = self.__CustomizeFunctionBody(functionbody, compoundname)
       with myopen(outputfile, 'w', encoding='utf-8') as f:
          f.write("' #######################################\n")
          f.write("' definition="+definition+"\n")
          f.write("' bodyfile="+bodyfile+"\n")
          f.write("' bodystart="+str(bodystart)+"\n")
          f.write("' bodyend="+str(bodyend)+"\n")
          f.write("' #######################################\n")
          f.write("@startuml\n")
          f.write("skinparam SequenceDividerFontSize 30\n")
          f.write("skinparam SequenceGroupFontSize 30\n")
          f.write("== " + compoundname + ":" + name + argsstring + " ==\n")
          f.write("activate " + compoundname + "\n")
          f.write("' #######################################\n")
          f.write(''.join(functionbody))
          f.write("' #######################################\n")
          f.write("deactivate " + compoundname + "\n")
          f.write("@enduml\n")
          f.write("' #######################################\n")