def report(dire=ROOT, date=None): """ Gives a full report """ rep = sheetReport(dire, date, totals=True) rep += 2 * pr.DELIMITER rep += pr.printkv('net', str(net(dire, date))) return rep
def report(dire=ROOT, date=None): """ Gives a full report """ rep = sheetReport(dire, date, totals=True) rep += 2*pr.DELIMITER rep += pr.printkv('net', str(net(dire, date))) return rep
def sheetReport(dire=ROOT, date=None, totals=True): """ Displays the sheet names alongwith totals if totals is set to True if date is not None, shows total for only that date """ if totals: l = [(sheetname, str(total)) for sheetname, total in \ total_all(dire, date)] for idx, val in enumerate(l): l[idx] = pr.printkv(val[0], val[1]) else: l = [sheetname for sheetname in sheetNames(dire)] return pr.printlist(l, pr.DELIMITER)