Merge commit '88ad616d18b69eb03bc14eaa9ce6b32be90867a6' into next

This commit is contained in:
Craig Earls 2015-09-18 06:53:23 -07:00
commit 5905c21ded
11 changed files with 130 additions and 58 deletions

View file

@ -22,7 +22,7 @@ env:
# _MIN is used when building the master branch # _MIN is used when building the master branch
# _MAX is used when building any other branch # _MAX is used when building any other branch
- BOOST_VERSION_MIN="1.49.0" - BOOST_VERSION_MIN="1.49.0"
- BOOST_VERSION_MAX="1.58.0" - BOOST_VERSION_MAX="1.59.0"
# List of required boost libraries to build # List of required boost libraries to build
- BOOST_LIBS="date_time,filesystem,iostreams,python,regex,system,test" - BOOST_LIBS="date_time,filesystem,iostreams,python,regex,system,test"
# List of required Homebrew formulae to install # List of required Homebrew formulae to install

View file

@ -9,8 +9,8 @@ PROJECT(ledger)
set(Ledger_VERSION_MAJOR 3) set(Ledger_VERSION_MAJOR 3)
set(Ledger_VERSION_MINOR 1) set(Ledger_VERSION_MINOR 1)
set(Ledger_VERSION_PATCH 1) set(Ledger_VERSION_PATCH 1)
set(Ledger_VERSION_PRERELEASE "-alpha.1") set(Ledger_VERSION_PRERELEASE "")
set(Ledger_VERSION_DATE 20141005) set(Ledger_VERSION_DATE 20150915)
set(Ledger_TEST_TIMEZONE "America/Chicago") set(Ledger_TEST_TIMEZONE "America/Chicago")
@ -164,6 +164,32 @@ endif()
cmake_pop_check_state() cmake_pop_check_state()
# Check if fix for https://github.com/boostorg/python/issues/39 is needed
if (HAVE_BOOST_PYTHON)
cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_INCLUDE_PATH} ${Boost_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES ${Boost_LIBRARIES} ${PROFILE_LIBS})
check_cxx_source_runs("
#include <boost/python.hpp>
struct X { int y; };
int main()
{
boost::python::make_setter(&X::y);
}" BOOST_MAKE_SETTER_RUNS)
if (BOOST_MAKE_SETTER_RUNS)
set(HAVE_BOOST_159_ISSUE_39 0)
else()
set(HAVE_BOOST_159_ISSUE_39 1)
endif()
cmake_pop_check_state()
endif()
######################################################################## ########################################################################
include_directories(${CMAKE_INCLUDE_PATH}) include_directories(${CMAKE_INCLUDE_PATH})

1
acprep
View file

@ -1085,7 +1085,6 @@ typical user:
products Report the products directory path products Report the products directory path
rsync Rsync a copy of the source tree into Products rsync Rsync a copy of the source tree into Products
sloc Report total Source Lines Of Code sloc Report total Source Lines Of Code
submodule Updates Git submodules (better to use 'pull')
version Output current HEAD version to version.m4 version Output current HEAD version to version.m4
NOTE: If you wish to pass options to CMake or make, add "--" followed by NOTE: If you wish to pass options to CMake or make, add "--" followed by

View file

@ -1,11 +1,13 @@
Ledger NEWS Ledger NEWS
* 3.x.x * 3.1.1
- Added a --no-revalued option - Added a --no-revalued option
- Improved Embedded Python Support - Improved Embedded Python Support
- Use ./.ledgerrc if ~/.ledgerrc doesn't exist
- Fixed parsing of transactions with single-character payees and comments - Fixed parsing of transactions with single-character payees and comments
- Fixed crash when using -M with empty result - Fixed crash when using -M with empty result
@ -16,7 +18,7 @@
- Fixed crash when using --trace 10 or above - Fixed crash when using --trace 10 or above
- Build fix for boost 1.56 - Build fix for boost 1.56, 1.58, 1.59
- Build fix for Cygwin - Build fix for Cygwin
@ -24,6 +26,10 @@
- Various documentation improvements - Various documentation improvements
- Examples in the documentation are tested just like unit tests
- Add continuous integration (https://travis-ci.org/ledger/ledger)
* 3.1 * 3.1
- Changed the definition of cost basis to preserve the original cost basis - Changed the definition of cost basis to preserve the original cost basis

View file

@ -1359,12 +1359,12 @@ option.
.It Fn trim value .It Fn trim value
Trim leading and trailing whitespace from Trim leading and trailing whitespace from
.Ar value . .Ar value .
.It Fn truncated string, total_len, account_len .It Fn truncated string total_len account_len
Truncate Truncate
.Ar string .Ar string
to to
.Ar total_len .Ar total_len
enusring that each account is at least ensuring that each account is at least
.Ar account_len .Ar account_len
long. long.
.\".It Sy uncleared .\".It Sy uncleared

View file

@ -3,6 +3,7 @@
@setfilename ledger3.info @setfilename ledger3.info
@include version.texi @include version.texi
@set FIXME:UNDOCUMENTED @sc{undocumented}! Please help by contributing documentation for this feature. @set FIXME:UNDOCUMENTED @sc{undocumented}! Please help by contributing documentation for this feature.
@set InternalUseOnly For internal use only.
@settitle Ledger: Command-Line Accounting @settitle Ledger: Command-Line Accounting
@c Before release, run C-u C-c C-u C-a (texinfo-all-menus-update with @c Before release, run C-u C-c C-u C-a (texinfo-all-menus-update with
@ -405,7 +406,7 @@ install` to install. If these intructions do not work for you can check the
Ledger has a complete online help system based on GNU Info. This manual Ledger has a complete online help system based on GNU Info. This manual
can be searched directly from the command-line using @code{info ledger}, can be searched directly from the command-line using @code{info ledger},
which will bring up this entire manual in your TTY. Alternatively, the which will bring up this entire manual in your TTY. Alternatively, the
shorter man page can be accessed from the command-line either via shorter man page can be accessed from the command-line either via
@code{man ledger} or @code{ledger --help} @code{man ledger} or @code{ledger --help}
@ -4682,7 +4683,7 @@ from the file above.
@findex --account @var{STR} @findex --account @var{STR}
@findex --rich-data @findex --rich-data
The @command{convert} command accepts four options. They are The @command{convert} command accepts four options. They are
@option{--invert} which inverts the amount field, @option{--auto-match} @option{--invert} which inverts the amount field, @option{--auto-match}
which automatically matches an account from the Ledger journal for every which automatically matches an account from the Ledger journal for every
CSV line, @option{--account @var{STR}} which you can use to specify the CSV line, @option{--account @var{STR}} which you can use to specify the
@ -4733,7 +4734,7 @@ the environment variable @env{LEDGER_FILE}) this entry will not be
printed again. printed again.
In the output above, the account is @samp{Expenses:Unknown} for CSV In the output above, the account is @samp{Expenses:Unknown} for CSV
lines. You can use the @option{--auto-match} option to automatically lines. You can use the @option{--auto-match} option to automatically
match an account from your Ledger journal. match an account from your Ledger journal.
You can also use @command{convert} with @code{payee} and @code{account} You can also use @command{convert} with @code{payee} and @code{account}
@ -5901,7 +5902,8 @@ or testing small journal files not associated with your main financial
database. database.
@item --debug @var{CODE} @item --debug @var{CODE}
@value{FIXME:UNDOCUMENTED} If ledger has been built with debug options this will provide extra data during
the run.
@item --help @item --help
@itemx -h @itemx -h
@ -5964,7 +5966,8 @@ slowdown. When combined with @option{--debug @var{CODE}} ledger will
produce memory trace information. produce memory trace information.
@item --verify-memory @item --verify-memory
@value{FIXME:UNDOCUMENTED} Verify that every constructed object is properly destructed. This is for
debugging purposes only.
@item --version @item --version
Print version information and exit. Print version information and exit.
@ -6753,7 +6756,8 @@ week.
@item --subtotal @item --subtotal
@itemx -s @itemx -s
@value{FIXME:UNDOCUMENTED} Group all postings together. This is very similar to the totals shown by
the balance report.
@item --tail @var{INT} @item --tail @var{INT}
@itemx --last @var{INT} @itemx --last @var{INT}
@ -8154,7 +8158,8 @@ Assets:Cash ¤ 123,45
@end defun @end defun
@defun amount_expr @defun amount_expr
@value{FIXME:UNDOCUMENTED} Return the calculated amount of the posting according to the @option{--amount}
option.
@end defun @end defun
@defun ansify_if value color bool @defun ansify_if value color bool
@ -8236,8 +8241,8 @@ Expenses:Office Supplies ¤ 123,00
@end smallexample @end smallexample
@end defun @end defun
@defun format @defun format string
@value{FIXME:UNDOCUMENTED} Evaluate @var{string} as format just like the @option{--format} option.
@end defun @end defun
@defun format_date date format @defun format_date date format
@ -8251,20 +8256,22 @@ Friday, January 16. 2015
@end smallexample @end smallexample
@end defun @end defun
@defun format_datetime @defun format_datetime datetime format
@value{FIXME:UNDOCUMENTED} Return the @var{datetime} as a string using @var{format}. Refer to strftime (3)
for format string details.
@end defun @end defun
@defun get_at @defun get_at sequence index
@value{FIXME:UNDOCUMENTED} Return the value in @var{sequence} at @var{index}. The first element is @var{index} 0.
@value{InternalUseOnly}
@end defun @end defun
@defun is_seq @defun is_seq value
@value{FIXME:UNDOCUMENTED} Return true if @var{value} is a sequence. @value{InternalUseOnly}
@end defun @end defun
@defun join @defun join value
@value{FIXME:UNDOCUMENTED} Replace all newlines in @var{value} with @code{\n}.
@end defun @end defun
@defun justify value first_width latter_width right_justify colorize @defun justify value first_width latter_width right_justify colorize
@ -8285,9 +8292,11 @@ $ ledger -f expr.dat --format "»%(justify(account, 30, 30, true))«\n" reg
@end smallexample @end smallexample
@end defun @end defun
@defun market @defun market value datetime
@defunx P @defunx P
@value{FIXME:UNDOCUMENTED} Return the price of @var{value} at @var{datetime}. Note that @var{datetime}
must be surrounded by brackets in order to be parsed correctly,
e.g. @code{[2012/03/23]}.
@end defun @end defun
@defun nail_down @defun nail_down
@ -8297,7 +8306,7 @@ $ ledger -f expr.dat --format "»%(justify(account, 30, 30, true))«\n" reg
@defvar now @defvar now
@defvarx d @defvarx d
@defvarx m @defvarx m
@value{FIXME:UNDOCUMENTED} Return the current datetime.
@end defvar @end defvar
@defvar options @defvar options
@ -8323,12 +8332,12 @@ $ ledger -f expr.dat --format "%(percent(amount, 200))\n" reg
@end smallexample @end smallexample
@end defun @end defun
@defun print @defun print value
@value{FIXME:UNDOCUMENTED} Print @var{value} to stdout. @value{InternalUseOnly}
@end defun @end defun
@defun quantity @defun quantity value
@value{FIXME:UNDOCUMENTED} Return the quantity of @var{value} for values that have a per-unit cost.
@end defun @end defun
@defun quoted expression @defun quoted expression
@ -8361,37 +8370,38 @@ Expenses:Office Supplies ¤ 123,50
@end smallexample @end smallexample
@end defun @end defun
@defun scrub @defun scrub value
@value{FIXME:UNDOCUMENTED} Clean @var{value} using various transformations such as @code{round}, stripping
value annotations, and more.
@end defun @end defun
@defun should_bold @defun should_bold
@value{FIXME:UNDOCUMENTED} Return true if expression given to @option{--bold-if} evaluates to true. @value{InternalUseOnly}
@end defun @end defun
@defun strip @defun strip value
@defunx S @defunx S
@value{FIXME:UNDOCUMENTED} Strip value annotation from @var{value}.
@end defun @end defun
@defun to_amount @defun to_amount value
@value{FIXME:UNDOCUMENTED} Convert @var{value} to an amount. @value{InternalUseOnly}
@end defun @end defun
@defun to_balance @defun to_balance value
@value{FIXME:UNDOCUMENTED} Convert @var{value} to a balance. @value{InternalUseOnly}
@end defun @end defun
@defun to_boolean @defun to_boolean value
@value{FIXME:UNDOCUMENTED} Convert @var{value} to a boolean. @value{InternalUseOnly}
@end defun @end defun
@defun to_date @defun to_date value
@value{FIXME:UNDOCUMENTED} Convert @var{value} to a date. @value{InternalUseOnly}
@end defun @end defun
@defun to_datetime @defun to_datetime value
@value{FIXME:UNDOCUMENTED} Convert @var{value} to a datetime. @value{InternalUseOnly}
@end defun @end defun
@defun to_int value @defun to_int value
@ -8406,12 +8416,12 @@ $ ledger -f expr.dat --format "%(1 + to_int('1'))\n%(2,5 + int(2,5))\n" reg asse
@end smallexample @end smallexample
@end defun @end defun
@defun to_mask @defun to_mask value
@value{FIXME:UNDOCUMENTED} Convert @var{value} to a mask. @value{InternalUseOnly}
@end defun @end defun
@defun to_sequence @defun to_sequence value
@value{FIXME:UNDOCUMENTED} Convert @var{value} to a sequence. @value{InternalUseOnly}
@end defun @end defun
@defun to_string value @defun to_string value
@ -8434,7 +8444,8 @@ $ ledger -f expr.dat --now 2015/01/01 --format "%(today)\n" reg assets
@end defun @end defun
@defun total_expr @defun total_expr
@value{FIXME:UNDOCUMENTED} Return the calculated total of the posting according to the @option{--total}
option.
@end defun @end defun
@defun trim value @defun trim value
@ -8447,8 +8458,9 @@ $ ledger -f expr.dat --format "»%(trim(' Trimmed '))«\n" reg assets
@end smallexample @end smallexample
@end defun @end defun
@defun truncated @defun truncatedstring total_len account_len
@value{FIXME:UNDOCUMENTED} Truncate @var{string} to @var{total_len} ensuring that each account is at least
@var{account_len} long.
@end defun @end defun
@defun unround @defun unround
@ -8588,7 +8600,7 @@ $ ledger -f expr.dat --format "%12(5*O)\n" reg assets
@item [DATEFMT] @item [DATEFMT]
Inserts the result of formatting a posting's date with a date Inserts the result of formatting a posting's date with a date
format string, exactly like those supported by @code{strftime}. For format string, exactly like those supported by strftime (3). For
example: @samp{%[%Y/%m/%d %H:%M:%S]}. example: @samp{%[%Y/%m/%d %H:%M:%S]}.
@item S @item S

View file

@ -46,7 +46,8 @@
(beginning-of-line) (beginning-of-line)
(while (< (point) end) (while (< (point) end)
(cond ((or (looking-at ledger-xact-start-regex) (cond ((or (looking-at ledger-xact-start-regex)
(looking-at ledger-posting-regex)) (looking-at ledger-posting-regex)
(looking-at ledger-recurring-line-regexp))
(ledger-fontify-xact-at (point))) (ledger-fontify-xact-at (point)))
((looking-at ledger-directive-start-regex) ((looking-at ledger-directive-start-regex)
(ledger-fontify-directive-at (point)))) (ledger-fontify-directive-at (point))))

View file

@ -158,7 +158,7 @@ Requires empty line separating xacts."
(save-excursion (save-excursion
(goto-char pos) (goto-char pos)
(beginning-of-line) (beginning-of-line)
(if (looking-at "[ =~0-9]") (if (looking-at "[ =~0-9\\[]")
(ledger-navigate-find-xact-extents pos) (ledger-navigate-find-xact-extents pos)
(ledger-navigate-find-directive-extents pos)))) (ledger-navigate-find-directive-extents pos))))

View file

@ -238,6 +238,22 @@
code code
(note end-note)) (note end-note))
(ledger-define-regexp recurring-line
(macroexpand
`(rx (and line-start
(regexp "\\[.+/.+/.+\\]")
(? (and (+ blank) (regexp ,ledger-state-regexp)))
(? (and (+ blank) (regexp ,ledger-code-regexp)))
(+ blank) (+? nonl)
(? (regexp ,ledger-end-note-regexp))
line-end)))
"Match a transaction's first line (and optional notes)."
(actual-date full-date actual)
(effective-date full-date effective)
state
code
(note end-note))
(ledger-define-regexp account (ledger-define-regexp account
(rx (group (and (not (any blank ?\[ ?\( ?: ?\;)) (*? nonl)))) (rx (group (and (not (any blank ?\[ ?\( ?: ?\;)) (*? nonl))))
"") "")

View file

@ -71,6 +71,7 @@
#define HAVE_BOOST_PYTHON @HAVE_BOOST_PYTHON@ #define HAVE_BOOST_PYTHON @HAVE_BOOST_PYTHON@
#define HAVE_BOOST_REGEX_UNICODE @HAVE_BOOST_REGEX_UNICODE@ #define HAVE_BOOST_REGEX_UNICODE @HAVE_BOOST_REGEX_UNICODE@
#define HAVE_BOOST_159_ISSUE_39 @HAVE_BOOST_159_ISSUE_39@
#define DEBUG_MODE @DEBUG_MODE@ #define DEBUG_MODE @DEBUG_MODE@
#define NO_ASSERTS @NO_ASSERTS@ #define NO_ASSERTS @NO_ASSERTS@
@ -253,6 +254,17 @@ typedef std::ostream::pos_type ostream_pos_type;
#include <boost/iterator/indirect_iterator.hpp> #include <boost/iterator/indirect_iterator.hpp>
#if BOOST_VERSION == 105900 && HAVE_BOOST_159_ISSUE_39
// Fix for https://github.com/boostorg/python/issues/39
namespace boost { namespace python {
template <class D>
inline object make_setter(D const& x)
{
return detail::make_setter(x, default_call_policies(), is_member_pointer<D>(), 0);
}
}}
#endif
#endif // HAVE_BOOST_PYTHON #endif // HAVE_BOOST_PYTHON
#endif // _SYSTEM_HH #endif // _SYSTEM_HH

View file

@ -15,7 +15,7 @@ if (BUILD_LIBRARY)
add_ledger_test(UtilTests) add_ledger_test(UtilTests)
add_executable(MathTests t_amount.cc t_commodity.cc t_balance.cc t_expr.cc t_value.cc) add_executable(MathTests t_amount.cc t_commodity.cc t_balance.cc t_expr.cc t_value.cc)
set_source_files_properties(t_amount.cc PROPERTIES COMPILE_FLAGS "-Wno-unused-comparison") set_source_files_properties(t_amount.cc t_value.cc PROPERTIES COMPILE_FLAGS "-Wno-unused-comparison")
if (CMAKE_SYSTEM_NAME STREQUAL Darwin AND HAVE_BOOST_PYTHON) if (CMAKE_SYSTEM_NAME STREQUAL Darwin AND HAVE_BOOST_PYTHON)
target_link_libraries(MathTests ${PYTHON_LIBRARIES}) target_link_libraries(MathTests ${PYTHON_LIBRARIES})
endif() endif()