Beispiel #1
0
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)
Beispiel #2
0
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))
Beispiel #3
0
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))
Beispiel #4
0
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)
Beispiel #5
0
 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'))))
Beispiel #6
0
 def test_sync_no_ledger(self):
     sync = CsvSynchronizer(None)
     self.assertEqual(
         2, len(sync.parse_file(os.path.join('fixtures', 'paypal.csv'))))
Beispiel #7
0
 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'))))
Beispiel #8
0
 def test_sync_no_ledger(self):
     sync = CsvSynchronizer(None)
     self.assertEqual(
         2, len(sync.parse_file(
             os.path.join('fixtures', 'paypal.csv'))))