summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Rename quoted_rfc4180 to quoted_rfc, to avoid parser quirkDonald Lam2023-01-256-18/+27
| | | | | | | Ledger's expression parser considers quoted_rfc4180 to be an amount (quantity 4180 of commodity "quoted_rfc"). Fixes #2007.
* typo and column alignmentspaette2023-01-234-4/+4
|
* Initial fix for #2147WY2023-01-202-1/+29
|
* Python: Transaction.remove_post should call xact_base_t::remove_postDavid Sklar2023-01-102-7/+22
|
* Python: test cleanupsDavid Sklar2023-01-094-8/+9
| | | | | | | | 1. Remove references to modules (exceptions, StringIO) no longer needed for Pythn3 2. Use assertEqual instead of assertEquals 3. Clear journal files with a close_journal_files() function that uses the then-current underlying python_session pointer. Calling session.close_journal_files() sometimes leads to segfaults because python_session has changed after it was injected into the python module (as "session") on module startup.
* fix brew link error on mac CIAndy Clayton2023-01-091-0/+9
| | | | | | | | | | | | | | The github mac runner images added python 3.11 but, unlike 3.10, not via brew. This causes brew install to fail with link conflict errors now that boost-python3 switched over to 3.11. Workaround this, and future python brew link errors, by overwriting all links for python packages. https://github.com/Homebrew/homebrew-core/commit/8c79089ae410bcd38065dfa3748bbcdb64b228d2 https://github.com/orgs/Homebrew/discussions/3895 https://github.com/actions/setup-python/issues/577 https://github.com/actions/runner-images/issues/6459 https://github.com/actions/runner-images/issues/6507 https://github.com/actions/runner-images/issues/2322
* typosspaette2023-01-076-10/+10
|
* Add compatability for Python 3.10 and later to acprepAlexis Hildebrandt2022-12-291-1/+4
| | | | Fixes #2154
* docs: add info on on expr directiveMartin Michlmayr2022-12-271-1/+1
| | | | Fixes #2149
* Update Debian releasesMartin Michlmayr2022-12-261-3/+3
|
* Add python support for error_contextAdam Wendt2022-11-131-0/+7
| | | | | | Added ledger.session.error_context() to py_session.cc to get the error context message when exceptions are thrown.
* Fix balancing commodity with smaller unit.Maria2022-10-113-1/+27
|
* xml: Include posting-specific payee in outputGwyneth Morgan2022-10-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In `ledger xml` export, include the `<posting>`-specific payee (from the `Payee:` tag) as `<payee>`. This data is already included under `<metadata>` as `<value key="Payee">`, but that is more specific to Ledger's implementation; if in the future there is another way to set the payee (or perhaps an option to have the Payee tag in one's own language), that field wouldn't be a reliable method of getting this info. Example: 2022-01-01 Transaction-level payee a 10 b ; Payee: Posting-level payee Relevant XML output: <transaction> <date>2022-01-01</date> <payee>Transaction-level payee</payee> <postings> <posting> <account ref="0000558defd6f260"> <name>a</name> </account> <post-amount> <amount> <quantity>10</quantity> </amount> </post-amount> <total> <amount> <quantity>10</quantity> </amount> </total> </posting> <posting> <payee>Posting-level payee</payee> <account ref="0000558defd6f960"> <name>b</name> </account> <post-amount> <amount> <quantity>-10</quantity> </amount> </post-amount> <note> Payee: Posting-level payee</note> <metadata> <value key="Payee"> <string>Posting-level payee</string> </value> </metadata> <total> <amount> <quantity>0</quantity> </amount> </total> </posting> </postings> </transaction>
* Handle return value of PyUnicode_READYAlexis Hildebrandt2022-10-021-1/+2
| | | | | | to ensure access macros are only called on "legacy" unicode string objects that are "ready". See https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_READY
* Fix handling of UCS-2 encoded stringsAlexis Hildebrandt2022-10-022-13/+13
| | | | | | Add test to python/demo.py Fixes #2132
* Fix handling of UCS-1 encoded stringsAlexis Hildebrandt2022-10-022-12/+16
| | | | Add test to python/demo.py
* Properly handle PyUnicode_1BYTE_DATAAlexis Hildebrandt2022-07-201-3/+1
|
* Fix use of deprecated Python legacy Unicode APIAlexis Hildebrandt2022-07-201-18/+52
| | | | | | | | replacing it with APIs introduced in Python 3.3 to ensure ledger's Python bindings continue to function when the legacy Unicode API is removed in Python 3.12. For details see https://docs.python.org/3.10/c-api/unicode.html
* Fix typos found by codespellAlexis Hildebrandt2022-07-1916-30/+30
|
* Fix SIGABRT when python subcommand raises an exceptionAaron L. Zeng2022-07-131-2/+3
| | | | | | | | | | | | | Before, `ledger python -- -c 'raise RuntimeError'` would terminate messily via SIGABRT, printing the following: terminate called after throwing an instance of 'int' [1] 2151711 abort (core dumped) ledger python -c 'raise RuntimeError' This change makes the python subcommand throw a standard C++ exception rather than just a plain int, which is never caught and triggers the SIGABRT. Now, the process prints the uncaught Python exception as usual and then exits with exit code 1.
* Fix typoMartin Michlmayr2022-07-081-1/+1
|
* Add usePython option to flake.nixAlexis Hildebrandt2022-07-081-3/+15
| | | | to toggle building ledger's Python bindings.
* Add useGgpme option to flake.nixAlexis Hildebrandt2022-07-081-2/+8
| | | | | to toggle building ledger with support for encrypted journal files using gpgme.
* Update copyright statement for 2022Alexis Hildebrandt2022-07-02128-129/+129
|
* Improve update copyright year scriptAlexis Hildebrandt2022-07-021-5/+9
|
* Replace os.path.abspath with os.path.realpathAlexis Hildebrandt2022-07-015-10/+10
| | | | | | to fix failing tests on Darwin, where /tmp is a symlink to /private/tmp and the tests fail as ledger reports filenames with the symlink resolved to /private/tmp, but the tests expect files with /tmp.
* Document --exchange can accept multiple commoditiesGwyneth Morgan2022-06-292-13/+62
| | | | | | | | | | | | | | | | | | | | | The --exchange option can accept multiple comma-separated commodities, but this is only mentioned in one place where --exchange is documented, and notably not in the Texinfo manual. Examples made with the following ledger file: ``` P 2022-06-28 USD 54.81 PHP P 2022-06-28 EUR 58.01 PHP 2022-06-28 * Opening Balances Equity:Opening Balances Assets:USD Bank 100 USD Assets:EUR Bank 100 EUR Assets:PHP Bank 100 PHP ``` [ci skip]
* acprep: add support for arch linuxBalaji Sivaraman2022-06-261-1/+19
|
* Bump required CMake versionOleg Bulatov2022-05-061-1/+1
| | | | | | | | CMake 3.21.4 reports that compatibility with CMake < 2.8.12 will be removed from a future version of CMake. CMake 3.0 has new defaults for MACOSX_RPATH. It seems ledger works fine with them. See CMake Policy CMP0042 for the details.
* Fix unrounding for equityOleg Bulatov2022-05-064-3/+36
|
* Remove git from brew installOleg Bulatov2022-05-051-1/+1
| | | | git is now provided by GitHub Actions by default
* Fix test formattingJohn Wiegley2022-05-031-3/+3
|
* Add test/regress/2109.testJohn Wiegley2022-05-031-0/+23
|
* When calculating balance assignments, strip away lot annotationsJohn Wiegley2022-05-031-12/+15
|
* Update git clone instructionsFlorent Espanet2022-04-171-1/+1
|
* Remove some UTF-8 code that was having no effectkanreki2022-04-141-38/+5
| | | | Fixes #2061.
* docs: add instructions for querying quoted commoditiesMarcus Zanona2022-04-081-0/+6
| | | resolves #2077
* Change header guard names to use `INCLUDED_` prefixPhil Newton2022-04-0659-177/+177
| | | | Fixes #2049
* README.md: Fix for Homebrew and CondaKunht Kun2022-03-181-11/+13
| | | | | | | | | | | In README we provide instructions for how to build Ledger instead of how to use Ledger. So the sections for Homebrew and Conda are currently inconsistent with others. Therefore, we update the two sections to provide installation instructions for build dependencies. [ci skip]
* Avoid making references to nullKunht Kun2022-03-172-8/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | In `compare_items` if `sort_order` is a top level expression, it has no context and `get_context()` method returns the null pointer. To see this, run $ ledger -f test/input/demo.ledger --sort display_amount reg --debug scope.symbols and there will be many lines like [DEBUG] Binding scope 0 with ... In such case making a reference to the context is an undefined behavior (honestly the dereferencing itself feels quite problematic, but many compilers just run without any complaints) and could potentially cause segfaults. Therefore, we change to use only the grandchild scope (`left` or `right`) for `find_sort_values` here. Note that it may seem to be more appropriate to use `report` here for the parent scope. However, in `find_sort_values` which is called right after, the `report` scope is always bound to this scope. So we only use grandchild scope to avoid unnecessary operations. Fixes #2069.
* NEWS.md: fix bug referenceMartin Michlmayr2022-03-151-1/+1
|
* Add a NEWS entry for ba8ec324Kunht Kun2022-03-131-0/+4
| | | | [ci skip]
* Avoid dereferencing null pointerKunht Kun2022-03-122-1/+14
| | | | | | | Here `comm` could be a null pointer (the new test regress/2057 shows such a case). So test it before dereferencing to avoid segfault. Re: #2057
* Ensure absolute path for includeKunht Kun2022-03-092-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure the path of file to include in `instance_t::include_directive` is always an absolute path. Previously when the journal file is given through stdin, we prepend a "./" to the filename to include. However, in Boost >= 1.77, `path::normalize` strips the leading "./" [1]. Our `resolve_path` function calls `normalize` and thus now it returns "file" for "./file" instead of the previous "./file". This change causes a failing test regress/BF3C1F82-2 [2], and also breaks the `include` directive for stdin input: $ touch file-to-include $ echo "include file-to-include" | ledger -f - reg gives While parsing file "", line 1: Error: File to include was not found: "file-to-include" Therefore, we change to prepend the `context.current_directory` to make the filename absolute in this case as well. The test regress/BF3C1F82-2 is also updated to match the new output. Fixes #2075. [1] https://github.com/boostorg/filesystem/commit/16bd89b7c0398d0dc5904148a865ef3fc3ece7ec [2] https://github.com/ledger/ledger/issues/2075
* Fixed misspelling of Deutsche Mark.PortStone2022-03-071-2/+2
|
* Modify a regression test to match output from Boost 1.77John Wiegley2022-02-241-2/+2
| | | | A better fix for this issue is needed, however.
* fileinfo_t: remove size memberMaximilian Eschenbacher2022-02-222-7/+2
| | | | | | | | | | | it is currently not required but set. Incidentally, calling file_size() on a bash pipe e.g. /proc/self/fd/11 fails with: Error: boost::filesystem::file_size: Operation not permitted: "/proc/self/fd/11" when executing ledger as ledger -f <(cat journal)
* Revert "Use amount_width for balance report"John Wiegley2022-02-031-3/+3
| | | | This reverts commit 7baa0efd71896711e563feb957926433f529d892.
* Use amount_width for balance reportVladimir Parfinenko2022-02-031-3/+3
|
* check that commodity format uses correct symbolChristopher Zimmermann2022-02-031-1/+4
| | | | closes 1948