Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
def makeReport(inputFileName, outputDir):

    print '\n Processing input file ' + inputFileName

    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)  

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

        # Compute the values  
        StatValues.computeValues(subFolder, statData)

        # Process the input data to create charts, graphs, Tex and then PDF
        # Create graphs for the reports 
        graphObject = BuildGraphs.makeGraphObject(graphData)
        BuildGraphs.BuildAllGraphs(inputId, subFolder, graphObject)

        # Create charts and histograms for the reports 
        BuildCharts.BuildAllCharts(subFolder, statData)

        # Create PDF
        BuildTex.CreatePdf(outputDir, subFolder, inputId, inputFileName)

    except Exception as e:
        print e.message
        print 'Creating PDF failed for ', inputId

    print '\n', '*'*70, '\n', '-'*70, '\n'
Exemplo n.º 4
0
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)

    try:
        # Create graphs for the reports
        graphObject = BuildGraphs.makeGraphObject(graphData)
        BuildGraphs.BuildAllGraphs(inputId, subFolder, graphObject)
    except Exception as e:
        print e.message

    # get socio numbers
    fsocio = open(projectDir + '\\socio_table.txt', 'a')
    ftex = open(subFolder + '\\commands.tex', 'r')
    data = statData[0].split('\t')
    schoolInfo = [data[i].split('=')[1] for i in range(7)]
    fsocio.write(inputId + '\t' + '\t'.join(schoolInfo))
    for i1 in range(7):
        ftex.readline()
    for line in ftex.readlines():
        res = line.split('}')
        res[0] = res[0].replace('\\newcommand{\\links', '')
        res[1] = res[1].replace('{', '')
        print 'Socio numbers', res
        fsocio.write('\t' + res[1])

    fsocio.write('\n')
    ftex.close()
    fsocio.close()
Exemplo n.º 5
0
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)

    try :
        # Create graphs for the reports 
        graphObject = BuildGraphs.makeGraphObject(graphData)
        BuildGraphs.BuildAllGraphs(inputId, subFolder, graphObject)
    except Exception as e:
        print e.message

    # get socio numbers
    fsocio = open (projectDir + '\\socio_table.txt','a')
    ftex = open(subFolder  + '\\commands.tex', 'r')
    data = statData[0].split('\t')
    schoolInfo = [data[i].split('=')[1] for i in range(7) ]
    fsocio.write(inputId + '\t' + '\t'.join(schoolInfo))
    for i1 in range(7) :
        ftex.readline()
    for line in ftex.readlines() :
        res = line.split('}')
        res[0] = res[0].replace('\\newcommand{\\links','')
        res[1] = res[1].replace('{','')
        print 'Socio numbers', res
        fsocio.write('\t' + res[1])

    fsocio.write('\n')
    ftex.close()
    fsocio.close()