'Formats data on \'info\' for mediawiki table output'

def reporting_mediawiki(self, info, order, noheaders):

    outputheaders = ''
    outputbody = ''
    opentable = '{|    border="1"\n'
    closetable = '|}\n'
    sep1 = '||'
    sep2 = '|'
    sep3 = '|-'
    info_count = 0
    for item in info:
        item_count = 0
        for key in order:
            if ((info_count == 0) and (item_count == 0)):
                outputheaders += (sep2 + key)
            elif (info_count == 0):
                outputheaders += (sep1 + key)
            if (item_count == 0):
                if (key in item.keys()):
                    outputbody += (sep2 + str(item[key]))
                else:
                    outputbody += (sep2 + '-')
            elif (key in item.keys()):
                outputbody += (sep1 + str(item[key]))
            else:
                outputbody += (sep1 + '-')
            item_count = (item_count + 1)
        info_count = (info_count + 1)
        outputbody += (('\n' + sep3) + '\n')
    outputheaders += (('\n' + sep3) + '\n')
    if noheaders:
        outputheaders = ''
    return (((opentable + outputheaders) + outputbody) + closetable)
