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