예제 #1
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
예제 #2
0
 def journal_load_failed(self, e):
     traceback.print_exc()
     gui.FatalError(
         "Add transaction loading failed",
         "An unexpected error took place:\n%s" % e,
     )
     self.emit('delete-event', None)