def main(argv):
    p = get_argparser()
    args = p.parse_args(argv[1:])
    assert not args.assume_yes
    ledgerfile = gui.find_ledger_file_for_gui()
    try:
        leftcontents = codecs.open(ledgerfile, "rb", "utf-8").read()
        items = parser.lex_ledger_file_contents(leftcontents, debug=args.debug)
        rightcontents = u"".join(i.contents for i in sort_transactions(items))
        try:
            diffing.three_way_diff(ledgerfile, leftcontents, rightcontents)
        except subprocess.CalledProcessError, e:
            if args.debug:
                raise
            gui.FatalError("Meld failed",
                           "Meld process failed with return code %s" %
                           e.returncode,
                           outside_mainloop=True)
            return e.returncode
    except Exception, e:
        if args.debug:
            raise
        gui.FatalError("Transaction sort failed",
                       "An unexpected error took place:\n%s" % e,
                       outside_mainloop=True)
        return 9
示例#2
0
def main(argv):
    p = get_argparser()
    args = p.parse_args(argv[1:])
    assert not args.assume_yes
    ledgerfile = gui.find_ledger_file_for_gui()
    try:
        leftcontents = codecs.open(ledgerfile, "rb", "utf-8").read()
        items = parser.lex_ledger_file_contents(leftcontents, debug=args.debug)
        rightcontents = u"".join(i.contents for i in sort_transactions(items))
        try:
            diffing.three_way_diff(ledgerfile, leftcontents, rightcontents)
        except subprocess.CalledProcessError, e:
            if args.debug:
                raise
            gui.FatalError(
                "Meld failed",
                "Meld process failed with return code %s" % e.returncode,
                outside_mainloop=True
            )
            return e.returncode
    except Exception, e:
        if args.debug:
            raise
        gui.FatalError(
            "Transaction sort failed",
            "An unexpected error took place:\n%s" % e,
            outside_mainloop=True
        )
        return 9
示例#3
0
def main():
    ledger_file = gui.find_ledger_file_for_gui()
    return clear(ledger_file)
示例#4
0
def main():
    ledger_file = gui.find_ledger_file_for_gui()
    return clear(ledger_file)