blob: 0e814392a6dab2d556c74bc0edba96c1292607b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
{\rtf1\ansi\ansicpg1252\cocoartf1038
{\fonttbl\f0\fmodern\fcharset0 Courier;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl264\slmult1\ql\qnatural\pardirnatural
\f0\fs28 \cf0 from ledger import *\
\
session.read_journal("doc/sample.dat")\
\
new_session = Session()\
\
set_session_context(new_session)\
session.read_journal("doc/sample.dat")\
set_session_content(session) # restore the default session\
\
for txn in session.journal.transactions:\
print txn.payee\
\
for p in txn.postings:\
print p.account, "->", p.amount}
|