当前位置: 首页>>代码示例>>Python>>正文


Python BuildTex类代码示例

本文整理汇总了Python中BuildTex的典型用法代码示例。如果您正苦于以下问题:Python BuildTex类的具体用法?Python BuildTex怎么用?Python BuildTex使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了BuildTex类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: makeReport

def makeReport(inputFileName, outputDir, projectDir):

    print '\n Processing input file ' + inputFileName, 'Time:', time.asctime()

    #try :
    # For each input file create a separate subfolder for all the related files
    [inputId, subFolder] = CheckFolders.MakeSubfolder(inputFileName, outputDir)

    # Move the prefilled Tex files into the subfolder
    BuildTex.MoveFiles(subFolder, projectDir)  

    # Parse the input file  
    [graphData, statData] = ParseInput.dataFromFile(inputFileName, inputId, outputDir, subFolder)

    # Compute the statistics values and build the charts
    StatValues.computeValues(subFolder, statData)

    orgSize = len(statData)
    if orgSize < 8 :
        print '\nNo graph data!'
        BuildTex.SimplifyResult(subFolder)
    else :
        try :
            # Create graphs for the reports 
            graphObject = BuildGraphs.makeGraphObject(graphData)
            BuildGraphs.BuildAllGraphs(inputId, subFolder, graphObject)
        except Exception as e:
            print e.message

    # Create PDF
    if orgSize > 37 :
        BuildTex.insertTables(subFolder, orgSize)
        BuildTex.splitTables(subFolder, orgSize)
    BuildTex.CreatePdf(outputDir, subFolder, inputId, inputFileName)
开发者ID:ryavorsky,项目名称:RPyAppl1,代码行数:34,代码来源:BuildAll.py

示例2: BuildAllGraphs

def BuildAllGraphs(inputId, subFolder, G0):

    # Save the number of employee into the Tex file
    BuildTex.addMacros(subFolder, 'nTotal', str(len(G0.nodes())))

    print '\nBuilding ', subFolder + '\\graph4a.png'
    G4a = aGraphObject(G0, [4,8], 'orange')
    G4a.draw(subFolder + '\\graph4a.png')
    
    G4b = aSymGraphObject(G0, [4,8], 'red')
    G4b.draw(subFolder + '\\graph4b.png')

    G51a = aGraphObject(G0, [5,7], 'blue')
    G51a.draw(subFolder + '\\graph5_1a.png')

    G51b = aSymGraphObject(G0, [5,7], '#808080')
    G51b.draw(subFolder + '\\graph5_1b.png')

    G52a = aGraphObject(G0, [3,6], 'darkgreen')
    G52a.draw(subFolder + '\\graph5_2a.png')

    G52b = aSymGraphObject(G0, [3,6], 'darkgreen')
    G52b.draw(subFolder + '\\graph5_2b.png')

    G53 = aGraphObject(G0, [3,5,6,7], '#448888')
    G53.draw(subFolder + '\\graph5_3.png')
开发者ID:vlasova-evgeniya,项目名称:RPyAppl1,代码行数:26,代码来源:BuildGraphs.py

示例3: MakeTitlePage

def MakeTitlePage(firstLine, subFolder) :

    [orgId, orgName] = firstLine.split('\t')

    orgName.replace('quot;','')
    orgName =  orgName.decode("CP1251").encode("UTF-8")
    BuildTex.addMacros(subFolder,'fullName', orgName)

    orgId = orgId.split('=')[1]
    BuildTex.addMacros(subFolder,'internalId', orgId)
开发者ID:vlasova-evgeniya,项目名称:RPyAppl1,代码行数:10,代码来源:ParseInput.py

示例4: computeTeachCat

def computeTeachCat(subFolder, statData) :
    values = StatValues.extractAnswers(statData, [19])
    keys = [str(i+55) for i in range(5)]
    stat = [values.count(key) for key in keys]
    print '\nTeacher categories:', values, stat
    BuildTex.addMacros(subFolder, 'numTechCatA', str(stat[0]))
    BuildTex.addMacros(subFolder, 'numTechCatB', str(stat[1]))
    BuildTex.addMacros(subFolder, 'numTechCatC', str(stat[2]))
    BuildTex.addMacros(subFolder, 'numTechCatD', str(stat[3]))
    BuildTex.addMacros(subFolder, 'numTechCatE', str(stat[4]))
开发者ID:ryavorsky,项目名称:RPyAppl1,代码行数:10,代码来源:StatValues1.py

示例5: ComputeAll

def ComputeAll(subFolder, statData) :

    BuildTex.MakeTitlePage(subFolder, statData)
    BuildTex.buildNamesList(subFolder, statData)

    computeAllBossTeacher(subFolder, statData)
    computeParticipatedManWomen(subFolder, statData)
    computeAge(subFolder, statData)
    computeEducation(subFolder, statData)
    computeWorkYears(subFolder, statData)
    computeWorkHereYears(subFolder, statData)
    computeTeachCat(subFolder, statData)
开发者ID:ryavorsky,项目名称:RPyAppl1,代码行数:12,代码来源:StatValues1.py

示例6: BuildAllGraphs

def BuildAllGraphs(inputId, subFolder, G0):

    # Save the graph data 
    saveFullGraphData(subFolder, G0)
    buildGraph7a(subFolder, G0)
    buildGraph7b(subFolder, G0)
    buildGraph81a(subFolder, G0)
    buildGraph81b(subFolder, G0)
    buildGraph82a(subFolder, G0)
    buildGraph82b(subFolder, G0)
    BuildTex.addMacros(subFolder, 'linksnodes', str(len(G0.nodes())))

    print '\n Building graphs complete'
开发者ID:ryavorsky,项目名称:RPyAppl1,代码行数:13,代码来源:BuildGraphs_Test.py

示例7: computeBossTeacher

def computeBossTeacher(subFolder) :
    fileName =  subFolder + '\\nameslist.tex' # Teacher names to be included in report
    f = open(fileName, 'r')
    boss = 0
    teacher = 0
    for line in f.readlines() :
        pos = line.find(',')
        l = len(line) - pos
        print 'Boss:', pos, l, line
        if l > 80  :
            boss += 1
        else :
            teacher += 1

    BuildTex.addMacros(subFolder, 'numBoss', str(boss))
    BuildTex.addMacros(subFolder, 'numTeacher', str(teacher))

    f.close()
开发者ID:vlasova-evgeniya,项目名称:RPyAppl1,代码行数:18,代码来源:StatValues.py

示例8: compute23d

def compute23d(subFolder, statData): # aggregate
    print '\nComputing values for slide 2.3.4.'
    values = StatValues.extractAnswers(statData, [30])

    yesNum = values.count('83') + values.count('84')
    noNum = values.count('85') + values.count('86')
    [yesNumP, noNumP] = StatValues.percent([yesNum,noNum])

    BuildTex.addMacros(subFolder, 'valBCDyesNum', str(yesNum))
    BuildTex.addMacros(subFolder, 'valBCDnoNum', str(noNum))
    BuildTex.addMacros(subFolder, 'valBCDyesNumP', str(yesNumP))
    BuildTex.addMacros(subFolder, 'valBCDnoNumP', str(noNumP))

    BuildCharts.YesNoPie(subFolder + '\\pie234.png', yesNumP, noNumP)
开发者ID:ryavorsky,项目名称:RPyAppl1,代码行数:14,代码来源:StatValues2.py

示例9: compute23a

def compute23a(subFolder, statData): # aggregate
    print '\nComputing values for slide 2.3.1.'
    values = StatValues.extractAnswers(statData, [23])

    yesNum = values.count('61')
    noNum = values.count('62')
    [yesNumP, noNumP] = StatValues.percent([yesNum,noNum])

    BuildTex.addMacros(subFolder, 'valBCAyesNum', str(yesNum))
    BuildTex.addMacros(subFolder, 'valBCAnoNum', str(noNum))
    BuildTex.addMacros(subFolder, 'valBCAyesNumP', str(yesNumP))
    BuildTex.addMacros(subFolder, 'valBCAnoNumP', str(noNumP))

    BuildCharts.YesNoPie(subFolder + '\\pie231.png', yesNumP, noNumP)
开发者ID:ryavorsky,项目名称:RPyAppl1,代码行数:14,代码来源:StatValues2.py

示例10: compute31a

def compute31a(subFolder, statData): # aggregate
    print '\nComputing values for slide 3.1.1.'
    values = StatValues.extractAnswers(statData, [43])

    yesNum = values.count('103') + values.count('104')
    noNum = values.count('105') + values.count('106')
    [yesNumP, noNumP] = StatValues.percent([yesNum,noNum])

    BuildTex.addMacros(subFolder, 'valCAAyesNum', str(yesNum))
    BuildTex.addMacros(subFolder, 'valCAAnoNum', str(noNum))
    BuildTex.addMacros(subFolder, 'valCAAyesNumP', str(yesNumP))
    BuildTex.addMacros(subFolder, 'valCAAnoNumP', str(noNumP))

    BuildCharts.YesNoPie(subFolder + '\\pie311.png', yesNum, noNum)
开发者ID:vlasova-evgeniya,项目名称:RPyAppl1,代码行数:14,代码来源:StatValues3.py

示例11: compute23b

def compute23b(subFolder, statData): # aggregate
    print '\nComputing values for slide 2.3.2.'
    values = StatValues.extractAnswers(statData, [52])

    yesNum = values.count('99') + values.count('100')
    noNum = values.count('101') + values.count('102')
    [yesNumP, noNumP] = StatValues.percent([yesNum,noNum])

    BuildTex.addMacros(subFolder, 'valBCByesNum', str(yesNum))
    BuildTex.addMacros(subFolder, 'valBCBnoNum', str(noNum))
    BuildTex.addMacros(subFolder, 'valBCByesNumP', str(yesNumP))
    BuildTex.addMacros(subFolder, 'valBCBnoNumP', str(noNumP))

    BuildCharts.YesNoPie(subFolder + '\\pie232.png', yesNumP, noNumP)
开发者ID:ryavorsky,项目名称:RPyAppl1,代码行数:14,代码来源:StatValues2.py

示例12: computeParticipatedManWomen

def computeParticipatedManWomen(subFolder, statData) :
    values = StatValues.extractAnswers(statData, [9])
    men = values.count('14')
    women = values.count('15')
    BuildTex.addMacros(subFolder, 'nParticipated', str(men+women))
    BuildTex.addMacros(subFolder, 'numMen', str(men))
    BuildTex.addMacros(subFolder, 'numWomen', str(women))
开发者ID:ryavorsky,项目名称:RPyAppl1,代码行数:7,代码来源:StatValues1.py

示例13: compute42c

def compute42c(subFolder, statData): # one question 
    print '\nComputing values for slide 4.2.c.'
    values = StatValues.extractAnswers(statData, [54])

    yesNum = values.count('87') + values.count('88')
    noNum = values.count('89') + values.count('90')
    [yesNumP, noNumP] = StatValues.percent([yesNum,noNum])

    BuildTex.addMacros(subFolder, 'valDBCyesNum', str(yesNum))
    BuildTex.addMacros(subFolder, 'valDBCnoNum', str(noNum))
    BuildTex.addMacros(subFolder, 'valDBCyesNumP', str(yesNumP))
    BuildTex.addMacros(subFolder, 'valDBCnoNumP', str(noNumP))

    BuildCharts.YesNoPie(subFolder + '\\pie42_c_.png', yesNumP, noNumP)
开发者ID:ryavorsky,项目名称:RPyAppl1,代码行数:14,代码来源:StatValues4.py

示例14: compute32a

def compute32a(subFolder, statData): # aggregate
    print '\nComputing values for slide 3.2.1.'
    values = StatValues.extractAnswers(statData, [40,41,42])
    values = StatValues.joinLists(values)

    yesNum = values.count('99') + values.count('100')
    noNum = values.count('101') + values.count('102')
    [yesNumP, noNumP] = StatValues.percent([yesNum,noNum])

    BuildTex.addMacros(subFolder, 'valCBAyesNum', str(yesNum))
    BuildTex.addMacros(subFolder, 'valCBAnoNum', str(noNum))
    BuildTex.addMacros(subFolder, 'valCBAyesNumP', str(yesNumP))
    BuildTex.addMacros(subFolder, 'valCBAnoNumP', str(noNumP))

    BuildCharts.YesNoPie(subFolder + '\\pie321.png', yesNum, noNum)
开发者ID:vlasova-evgeniya,项目名称:RPyAppl1,代码行数:15,代码来源:StatValues3.py

示例15: compute74

def compute74(subFolder, statData):  # by question
    print "\nComputing values for slide 7.4."
    values = StatValues.extractAnswers(statData, [56, 57])
    values = StatValues.joinListsByQuestion(values)

    yesNum = [val.count("87") + val.count("88") for val in values]
    noNum = [val.count("89") + val.count("90") for val in values]

    BuildTex.addMacros(subFolder, "valGDyesNumA", str(yesNum[0]))
    BuildTex.addMacros(subFolder, "valGDyesNumB", str(yesNum[1]))
    BuildTex.addMacros(subFolder, "valGDnoNumA", str(noNum[0]))
    BuildTex.addMacros(subFolder, "valGDnoNumB", str(noNum[1]))

    BuildCharts.YesNoPie(subFolder + "\\pie74a.png", yesNum[0], noNum[0])
    BuildCharts.YesNoPie(subFolder + "\\pie74b.png", yesNum[1], noNum[1])
开发者ID:ryavorsky,项目名称:RPyAppl1,代码行数:15,代码来源:StatValues5.py


注:本文中的BuildTex类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。