Beispiel #1
0
                    insort(masterUpdates, syncUpdate)
                if(syncUpdate.sUpdated and not syncUpdate.mUpdated):
                    insort(slaveUpdates, syncUpdate)

        print debugUtils.hashify("COMPLETED MERGE")
        print timediff()

    #########################################
    # Write Report
    #########################################

    print debugUtils.hashify("Write Report")
    print timediff()

    with io.open(repPath, 'w+', encoding='utf8') as resFile:
        reporter = HtmlReporter()

        basic_cols = ColData_User.getBasicCols()
        address_cols = OrderedDict(basic_cols.items() + [
            ('address_reason', {}),
            ('Edited Address', {}),
            ('Edited Alt Address', {}),
        ])
        name_cols = OrderedDict(basic_cols.items() + [
            ('name_reason', {}),
            ('Edited Name', {}),
        ])
        csv_colnames = ColData_User.getColNames(
            OrderedDict(basic_cols.items() + ColData_User.nameCols([
                'address_reason',
                'name_reason',
Beispiel #2
0
    if user_id == 1:
        for value in changedMap.values():
            for val in value: 
                SanitationUtils.safePrint(val)
    dataMap = json2map(data)
    diffMap = listUtils.keysNotIn(dataMap, changedMap.keys()) if isinstance(changedMap, dict) else dataMap
    changeDataFmt.append( [
        user_id,
        c_time,
        "C:%s<br/>S:%s" % (map2table(changedMap), map2table(diffMap))
    ] )

print "creating report..."

with io.open(repPath, 'w+', encoding='utf-8') as resFile:
    reporter = HtmlReporter()

    group = HtmlReporter.Group('changes', 'Changes')
    group.addSection(
        HtmlReporter.Section(
            'wp_changes',
            'Wordpress Changes',
            "modifications made to wordpress" + ( "since %s" % since if since else ""),
            data = re.sub("<table>","<table class=\"table table-striped\">", 
                tabulate(changeDataFmt, headers="firstrow", tablefmt="html")
            ),
            length = len(changeDataFmt)
        )
    )

    resFile.write( SanitationUtils.coerceUnicode( reporter.getDocument() ))