def import_csv(ledger, args): if args.account is None: raise Exception( "When importing a CSV file, you must specify an account name.") sync = CsvSynchronizer(ledger, payee_format=args.payee_format) accountname = args.account for txn in sync.parse_file(args.PATH, accountname=args.account): print txn.format(args.indent)
def import_csv(ledger, args): if args.account is None: raise Exception( "When importing a CSV file, you must specify an account name.") sync = CsvSynchronizer(ledger, payee_format=args.payee_format) txns = sync.parse_file(args.PATH, accountname=args.account, unknownaccount=args.unknownaccount) if args.reverse: txns = reversed(txns) for txn in txns: print(txn.format(args.indent, args.assertions))
def import_csv(ledger, args): if args.account is None: raise Exception( "When importing a CSV file, you must specify an account name.") sync = CsvSynchronizer(ledger, payee_format=args.payee_format, date_format=args.date_format) txns = sync.parse_file(args.PATH, accountname=args.account, unknownaccount=args.unknownaccount) if args.reverse: txns = reversed(txns) for txn in txns: print(txn.format(args.indent, args.assertions))
def import_csv(ledger, args): sync = CsvSynchronizer(ledger) accountname = args.account for txn in sync.parse_file(args.PATH, accountname=args.account): print txn.format(args.indent)
def test_partial_sync(self): ledger = Ledger(os.path.join('fixtures', 'paypal.lgr')) sync = CsvSynchronizer(ledger) self.assertEqual( 1, len(sync.parse_file(os.path.join('fixtures', 'paypal.csv'))))
def test_sync_no_ledger(self): sync = CsvSynchronizer(None) self.assertEqual( 2, len(sync.parse_file(os.path.join('fixtures', 'paypal.csv'))))
def test_partial_sync(self): ledger = Ledger(os.path.join('fixtures', 'paypal.lgr')) sync = CsvSynchronizer(ledger) self.assertEqual( 1, len(sync.parse_file( os.path.join('fixtures', 'paypal.csv'))))
def test_sync_no_ledger(self): sync = CsvSynchronizer(None) self.assertEqual( 2, len(sync.parse_file( os.path.join('fixtures', 'paypal.csv'))))