Commit graph

80 commits

Author SHA1 Message Date
John Wiegley
15bf3ed39e account(NAME) function can lookup account objects
For example, just the word "account" returns the name of the current
posting's account, but account("Expenses:Food") returns the actual
account object, so that it's total may be accessed.
2010-06-13 01:03:47 -04:00
John Wiegley
dea2aed0b5 Untabified all source files 2010-06-11 17:02:25 -04:00
John Wiegley
038c24357e Changed --european option to --decimal-comma
Fixes #211 / 1736ACA5-5DE6-4826-AEB4-DB5B2A2217AC
2010-06-01 17:56:41 -04:00
John Wiegley
ab416f759f Updated copyrights to 2003-2010 2010-03-05 22:14:10 -05:00
John Wiegley
4e30fcdf40 Many improvements to Ledger's Python bindings 2009-11-19 22:24:24 -05:00
John Wiegley
b2b0ae37e8 session_t now holds a std::auto_prt<journal_t> 2009-11-12 03:32:10 -05:00
John Wiegley
3f00f8362c Don't use archive_t if boost_serialization unavailable 2009-11-06 16:17:30 -05:00
John Wiegley
a05d39b722 Renamed --set-reported-account to just --account
This fits better with the --amount and --total options, which both
change the amount and total used for calculation.  Same with --account:
it happens after filtering, but before calculation so that balance
reports look as you'd expect.
2009-11-06 02:39:30 -05:00
John Wiegley
05d0f1a17f The binary cache is working again 2009-11-06 02:07:56 -05:00
John Wiegley
34ee358f5e Moved journal reading code into journal_t 2009-11-05 02:27:42 -05:00
John Wiegley
3dc200983d Moved xdata clearing code into each type proper 2009-11-05 02:27:39 -05:00
John Wiegley
78e6770c4c Segregated symbols into 5 separate namespaces
The different namespaces are:

  Function      Value expression functions, which receive a "context"
  Option        Command-line options
  Precommand    Commands which are invoked before reading the journal
  Command       Commands which are invoked after reading the journal
  Directive     Directives that occur at column 0 in a data file

This greatly eases the ability for Python uses to add intercept hooks to
change how the basic Ledger module functions.  An example of what should
be possible soon:

  import ledger

  def my_foo_handler(value):
      print "--foo received:", value

  ledger.add_handler(ledger.Option, "foo=", my_foo_handler)
2009-11-04 20:40:48 -05:00
John Wiegley
d9963b0312 Removed an unnecessary comment 2009-11-03 14:51:22 -05:00
John Wiegley
094794c640 Added a --european flag, to use commas for decimals
Ledger can often figure this out for itself, but this flag just makes it
the default behavior.  It is meant to be added to one's ~/.ledgerrc
file.
2009-11-02 02:39:31 -05:00
John Wiegley
977e7db164 Improved archive header logic for cache files 2009-11-01 06:01:21 -05:00
John Wiegley
3909d2678e Removed most #if 0 blocks and callout comments 2009-10-31 04:50:07 -04:00
John Wiegley
a0a980b9f4 Don't add price_db to sources if it doesn't exist 2009-10-31 04:15:29 -04:00
John Wiegley
2149a8e773 Create a --cache option, for using a binary cache 2009-10-31 00:09:57 -04:00
John Wiegley
63aa8992a8 Moved ownership of master account into journal_t
The journal_t now completely represents the data part of a session.
2009-10-30 19:03:28 -04:00
John Wiegley
a757b19f51 Added serialization methods for most type
This allows journal_t objects to be completed serialized to disk and
deserialized.
2009-10-30 18:06:37 -04:00
John Wiegley
55f5868380 Setting --date-format in ~/.ledgerrc works again 2009-10-29 00:52:51 -04:00
John Wiegley
8b3a75fbbf The default ledger file is now ~/.ledger 2009-10-28 01:50:55 -04:00
John Wiegley
fc84eeb358 Rewrote the way date and time I/O is managed 2009-10-25 05:01:47 -04:00
John Wiegley
991e3a3eaf Split commodity.h/cc into three files
commodity.h - code for commodity_t
annotate.h  - commodity annotations
pool.h      - commodity pool management
2009-06-24 16:43:46 +01:00
John Wiegley
440124eacc Restored --download, although not done yet
The problem at this point is that it's recording prices in the price
database multiple times; it should only need to download a price for
each commodity once per day.
2009-06-24 02:44:07 +01:00
John Wiegley
521b935aa8 Restored --percent option, added baseline test 2009-06-21 18:07:27 +01:00
John Wiegley
3a926da4cb When --end is used, set a "terminus" date
This means that final balance valuations (with -V or -X) will be done in
terms of the date given to --end, rather than based on the current day.

Fixes 647D5DB9-DBBB-47C8-80CE-F3F70E3B0253
2009-06-16 18:49:27 +01:00
John Wiegley
c79fd9e72d Added new debug option --options
This reports which options are in place before invoking a command, and
where exactly each option value came from.
2009-06-02 19:14:46 +01:00
John Wiegley
110f0b8023 Enabled use of pre-compiled headers by default 2009-03-10 17:02:03 -04:00
John Wiegley
2728e4d55e Changed the way that account balances are computed 2009-03-06 00:27:29 -04:00
John Wiegley
c11d325712 Reduced the #include dependency tree to a minimum 2009-03-04 23:53:43 -04:00
John Wiegley
238bd7f8a5 Marked all strings needing internationalization
These strings are now collected automagically in the file po/ledger.pot.
If you'd like to produce a translation, just run this command after
building Ledger:

    msginit -l LOCALE -o LANG.po -i po/ledger.pot

Where LOCALE is a string like de or en_GB, and LANG is a short
descriptive word for your language.

Then send me this .po file so I can commit it to the Ledger sources
(alternatively, you could maintain the file in a fork on GitHub), and
setup the build script to format and install your new message catalog
during a "make install".
2009-02-25 03:51:42 -04:00
John Wiegley
5a194cbdf4 Allow value expressions access to session options 2009-02-24 22:10:41 -04:00
John Wiegley
a8a87ab908 Added "date" valexpr to session, for bal -V 2009-02-24 21:07:05 -04:00
John Wiegley
944c63e6f2 The Great Renaming, Part II
The last commit did not contain the majority of changes because of a
slight mishap.  This contains the real changeset.
2009-02-23 19:07:30 -04:00
John Wiegley
e124811d8a Added --exchange (-x) option
This is like -V, except it lets you specify the goal commodity to report
in terms of, for example:

    reg -x CAD
2009-02-22 04:51:11 -04:00
John Wiegley
96782df17c Enabled --current option 2009-02-20 19:10:34 -04:00
John Wiegley
f2f52066d2 Added a --strict session option
When enabled, if any accounts or commodities are seen in an uncleared
transaction, which were not seen previously in a cleared or pending
transaction or a textual directive dealing with accounts or commodities,
a warning is generated about the unknown item.
2009-02-19 22:36:08 -04:00
John Wiegley
ec08dee745 Always perform tilde expansion on input pathnames 2009-02-18 21:00:02 -04:00
John Wiegley
2ec9b6a7b2 Split up session_t::reread_journal_files()
You now call session_t::close_journal_files() followed by
session_t::read_journal_files().
2009-02-15 19:32:15 -04:00
John Wiegley
70344b82e7 Added a "reload" command, for use at the REPL
Created a new function, session_t::reread_journal_files, which throws
away all previous state data and reads in the same files again.  This is
needed to allow Emacs to communicate with Ledger via the REPL, so that
it tell Ledger when it has made changes to the user's data file.
2009-02-13 05:24:28 -04:00
John Wiegley
3c3606aa0d Break libledger_data's dependency on session_t. 2009-02-09 18:46:01 -04:00
John Wiegley
47567307ce Removed reference to session_t from the iterators module. 2009-02-09 17:41:55 -04:00
John Wiegley
2d5ad7dee8 Added support for value expression definitions.
Example:

  ] expr f(x) := x + 100
  ] expr f(100)
  200
2009-02-08 04:30:05 -04:00
John Wiegley
71591555fd Added --leeway option (for quote downloading) into session_t. 2009-02-07 21:55:51 -04:00
John Wiegley
589eabd8e6 Threw away the "multiple parser" infrastructure. 2009-02-07 17:45:48 -04:00
John Wiegley
ea9330adae Allow value expressions to gain access to option settings.
For example, "ledger eval options.limit" prints 0 (for false), but:
"ledger -l hello eval options.limit" print "hello"s, since the value of
options.limit, once set to a value, is that string.  For flag options,
such as -Y, eval prints 0 if unset, and 1 if set.

This feature allows value expressions to be conditionalized based on the
presence of user options.
2009-02-07 05:47:21 -04:00
John Wiegley
eb98e0da8b More revision to the way options are handled; reworked CSV command. 2009-02-07 04:26:30 -04:00
John Wiegley
c1bf4bdf69 Moved the --abbrev-len option to report_t. 2009-02-06 23:38:12 -04:00
John Wiegley
cf6babcf90 Restored all the option handlers from 2.6.2, but not the options themselves. 2009-02-06 03:31:41 -04:00